Repository navigation
test: centralize shared shell fixtures - #3296
Merged
Merged
Conversation
Future tests can start from tests/fixtures.sh instead of copying stubs, and a no-mistakes version-floor bump is one constant rather than a multi-file edit. Migrated this round: fm-busy-adapter-wiring, fm-spawn-pool-base-freshen, fm-grok-harness, fm-tangle-guard, fm-gate-refuse, fm-spawn-dispatch-profile. Left for opportunistic migration: remaining make_spawn_fakebin copies (trace-context, kimi, muse, backend), the make_stubs send cluster, and the fake no-mistakes version banners in bootstrap/session-start/secondmate suites. Did not touch tests/fm-pr-check-security.test.sh.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Reviews (4): Last reviewed commit: "no-mistakes(ci): Added behavioral covera..." | Re-trigger Greptile |
… startup-sensitive timer-repair wait from 3s to 10s, matching existing loaded-runner budgets. Verified with the full tests/fm-watch-triage.test.sh suite, bash syntax validation, and git diff checks
…ve-reconcile fixture to prime status through the public fm_wake_status_mark_current API, ensuring classifier helpers load correctly and preventing the idle watcher from exiting. Verified the test three consecutive times, ran fm-test-fixtures, ShellCheck, bash syntax checks, and git diff checks. The outer no-mistakes executor can now bind a fresh attestation to the new head
…mux fixture defaults an unset FM_FAKE_PANE_PATH to empty. Verified the fixture suite, ShellCheck, syntax/diff checks, and all six migrated test suites; all passed. The outer executor can now bind a fresh no-mistakes attestation to the updated head
Intent
Create a shared test-fixture library for Firstmate's bash test suite and start migrating to it, so future test files start from a shared world instead of rebuilding one. This is a test-only, low-risk refactor: do not change bin/ production script behavior.
Promote the common fake-toolchain and spawn-world builders into tests/fixtures.sh (the existing helper convention: wake-helpers.sh and secondmate-helpers.sh source tests/lib.sh; lib.sh stays generic reporters/temp/git and does not own behavior-specific fakes). At minimum centralize: a fake no-mistakes binary with the version string behind ONE shared constant so a version-floor bump is a one-line change; fake gh and gh-axi builders; fake tmux and ssh builders; the spawn-world builders (make_spawn_fakebin, make_stubs, run_spawn) and the ubiquitous cleanup/fail helpers de-duplicated into one definition each (fail/cleanup already live in tests/lib.sh; fixtures.sh sources that rather than copying them). Keep each helper's behavior identical to the current copies; where copies drifted, converge on the most-complete behavior (spawn tmux pane path uses ${FM_FAKE_PANE_PATH:-} like 8 of 9 copies, not the one :? variant).
Migration is incremental, not a big-bang rewrite of all ~30+ files. This PR builds the shared library and migrates a first coherent batch of spawn-world test files (the make_spawn_fakebin / run_spawn cluster) enough to prove the seam end to end and delete real duplication while staying reviewable. Leave remaining files on their local copies for opportunistic future migration. The PR must note which files were migrated and which remain. EXCLUSION: do not touch tests/fm-pr-check-security.test.sh; a concurrent task owns that file's deletion. Every migrated test must still pass and still assert the same observable behavior through the same real interfaces; a migration that changes what a test proves is a bug. One concept per PR: shared fixtures plus the first migration batch only, no unrelated cleanup.
What Changed
tests/fixtures.shwith shared fake-toolchain, version, tmux/SSH, and spawn-world builders, plus behavioral fixture tests and test-runner mapping.fm-busy-adapter-wiring,fm-gate-refuse,fm-grok-harness,fm-spawn-dispatch-profile,fm-spawn-pool-base-freshen, andfm-tangle-guardtests to the shared fixtures.fm-backend,fm-kimi-harness,fm-muse-harness,fm-trace-context-spawn, and other suite-specific copies for later migration, withfm-pr-check-securityuntouched.Risk Assessment
✅ Low: The change is a well-bounded test-only fixture refactor, preserves migrated test behavior, documents deferred migrations, and the prior stdin-blocking issue is correctly fixed.
Testing
Exercised the shared fake binaries directly, then ran every migrated spawn-world suite through the real test runner and real Firstmate executable interfaces, including observable spawn success/refusal and persisted Git-state evidence. Changed-file selection recognized the new fixture library, all targeted behavior succeeded, and testing left the worktree clean.
Evidence: Shared fixtures and migrated spawn-world end-to-end transcript
Source: Shared fixtures and migrated spawn-world end-to-end transcript
Evidence: Changed-file test selection recognizing shared fixtures
Source: Changed-file test selection recognizing shared fixtures
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 1 issue found → auto-fixed ✅
tests/fm-test-fixtures.test.sh:109- This invocation inherits stdin, while fake-ssh runscat > /dev/nullbefore returning. Under the documented interactive test-runner path, it waits for terminal EOF and eventually times out instead of asserting exit 7. Redirect stdin from/dev/nullfor this invocation.🔧 Fix: Prevent fake SSH test from blocking on stdin
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
FM_TEST_EVIDENCE=1 bin/fm-test-run.sh tests/fm-test-fixtures.test.shFM_TEST_EVIDENCE=1 bin/fm-test-run.sh tests/fm-busy-adapter-wiring.test.shFM_TEST_EVIDENCE=1 bin/fm-test-run.sh tests/fm-gate-refuse.test.shFM_TEST_EVIDENCE=1 bin/fm-test-run.sh tests/fm-grok-harness.test.shFM_TEST_EVIDENCE=1 bin/fm-test-run.sh tests/fm-spawn-dispatch-profile.test.shFM_TEST_EVIDENCE=1 bin/fm-test-run.sh tests/fm-spawn-pool-base-freshen.test.shFM_TEST_EVIDENCE=1 bin/fm-test-run.sh tests/fm-tangle-guard.test.shbin/fm-test-run.sh --list --changed --base c731c36c381ea0886fa5aabf6a3be761534d3f30✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.