fix(herdr): record a stopped default session in the lab fleet-state tripwire#660
Closed
lukeforshort wants to merge 6 commits into
Closed
fix(herdr): record a stopped default session in the lab fleet-state tripwire#660lukeforshort wants to merge 6 commits into
lukeforshort wants to merge 6 commits into
Conversation
fm-dispatch-select.test.sh and fm-x-mode.test.sh hard-coded a BASE_PATH that misses jq when it lives outside /usr/bin:/bin (e.g. ~/.local/bin). Generalize fm-x-mode.test.sh's JQ_DIR trick into a shared fm_test_base_path helper in tests/lib.sh and use it from both suites. fm-session-start.test.sh's forced-missing-node cases only removed node from the fakebin dir, so a real node elsewhere on BASE_PATH (e.g. apt's /usr/bin/node) silently satisfied detection. Mask `command -v node` the same way the file already masks tmux for its Herdr cases.
…d default session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
Make firstmate's test suite hermetic against machine-specific jq and node tool locations
What Changed
defaultsession whether or not it is running, instead of hard-refusing on any host without a live default server; a start or stop of that session during lab work still trips the before/after comparison. Synced the matching wording inbin/fm-herdr-lab.sh,bin/fm-brief.sh, anddocs/herdr-backend.md.fm_test_base_pathandfm_test_command_maskhelpers totests/lib.shthat symlink only the named real tools into a scopedrealbindir and maskcommand -vfor a tool, so tests resolve host-installedjq/nodewithout dragging in unrelated binaries or silently satisfying absence checks.fm-x-mode,fm-dispatch-select, andfm-session-starttests onto the new helpers and add afm-herdr-labtest covering the stopped-default tripwire path.Risk Assessment
✅ Low: Test-hermeticity refactor plus a narrow, intentional tripwire relaxation that preserves change detection (running flag still recorded and compared), backed by a new regression test and matching doc/comment updates.
Testing
Baseline suite already passed; I re-ran the four test files touched by this change and all pass. To show the intent end-to-end, I exercised the two new helpers directly on this host, whose tool layout (jq at ~/.local/bin off the bare BASE_PATH, plus a real /usr/bin/node) is exactly the machine-specific hazard the change targets: fm_test_base_path imports only the requested jq via a realbin symlink and never node, and fm_test_command_mask makes
command -v nodefail while leaving other tools resolvable, with a captured counterfactual proving a bare BASE_PATH cannot find jq here. Non-visual, test-infrastructure change, so evidence is a CLI transcript rather than a rendered surface.Evidence: Hermeticity demo transcript (helpers vs. this host's jq/node layout)
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; for t in tests/*.test.sh; do echo "== $t =="; bash "$t" || rc=1; done; exit "$rc"bash tests/fm-x-mode.test.sh(uses fm_test_base_path for jq)bash tests/fm-dispatch-select.test.sh(uses fm_test_base_path for jq)bash tests/fm-session-start.test.sh(uses fm_test_command_mask for node)bash tests/fm-herdr-lab.test.sh(new stopped-default tripwire test)Direct helper demo: sourced tests/lib.sh, called fm_test_base_path (verified only jq symlinked into realbin, node absent) and fm_test_command_mask (verifiedcommand -v nodefails under BASE_PATH whilecommand -v shstill works), plus the bare-BASE_PATH counterfactual showing jq is unfindable without the helper✅ **Document** - passed
✅ No issues found.
🔧 Fix: no code lint issues; failure is shellcheck 0.11.0 pin unmet
1 warning still open:
🔧 Fix: no code lint issues; unmet shellcheck 0.11.0 version pin
1 warning still open:
🔧 Fix: no code lint issues; local shellcheck 0.11.0 pin unmet
1 warning still open:
✅ **Push** - passed
✅ No issues found.