Repository navigation
test(axis): shared stub-first PATH helper with /usr/bin:/bin fallback (#493 review) - #498
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Both fixtures still fail before applying fallback paths when the inherited PATH is empty.
Review effort: Balanced
Findings: 2
Open (2)
What changed in this PR
Centralizes test-fixture PATH construction while preserving stub precedence and fallback tool locations.
Changes:
- Adds shared
stubFirstPATH. - Uses it for MLX stop and model observation fixtures.
| File | Description |
|---|---|
cmd/axis/model_observation_test.go |
Adds helper and updates sample-shell environment. |
cmd/axis/model_mlx_test.go |
Reuses helper for MLX stop tests. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
toasterbook88
force-pushed
the
fix/493-review
branch
from
October 6, 2026 00:25
2eec512 to
213a695
Compare
Rebuilt on main after #493 (which inlined dir:$PATH:/usr/bin:/bin). Addresses the #498 review threads: an empty-PATH fallback is useless if exec.Command resolves the fixture's own sh/sleep from the parent PATH before cmd.Env applies. - stubFirstDirs(dir): stubs, inherited PATH entries (empty elements dropped), /run/current-system/sw/bin, /usr/bin, /bin. - stubFirstPATH(dir): the child PATH built from that list. - stubFirstCommand(dir, name, ...): resolves name from the same list and sets the child PATH; used for runSampleShell's sh and runMLXStopScript's sleep (the stop script already runs /bin/sh). - hack/e2e-fixture-empty-path.sh: committed E2E harness that compiles the cmd/axis test binary and runs both fixture tests under `env -i PATH=`. On main (471209c) both fail with "sleep"/"sh": executable file not found; with this change both pass.
toasterbook88
force-pushed
the
fix/493-review
branch
from
October 6, 2026 00:58
213a695 to
1b8c4b4
Compare
toasterbook88
added a commit
that referenced
this pull request
Oct 6, 2026
toasterbook88
added a commit
that referenced
this pull request
Oct 6, 2026
#494 (v0.19.5 release prep) merged at 2026-10-06 01:01 UTC, before the rest of the v0.19.5 merge chain. Its CHANGELOG section listed #476–#493 only. This PR adds the PRs that landed on `main` after it, so the v0.19.5 section matches what will be tagged: - #495 self-update download hardening (includes #496 and #499, applied to #495's branch before its squash) - #497 daemon restart after update; `axis version` shows the running daemon - #500 `model stop --live`, failed-unload receipts, MLX refusals - #501 keep `[N/A]` nvidia-smi rows - #498 stub-first fixture PATH helper The intro line is updated too (23 PRs, plus #494 itself). Docs-only change: `internal/buildinfo/version.go` stays `0.19.5`, and the section date `2026-10-05` is left as #494 set it. **Local checks:** `hack/verify-repo-truth.sh` OK; `hack/verify-doc-facts.sh` OK; `hack/validate-release-version.sh --source` → v0.19.5, and `validate-release-version.sh v0.19.5` → exit 0.
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.

Rebuilt on
main(471209c) after #493 merged. Test-only change, plus one committed E2E harness script.Problem: #493 inlined
dir:$PATH:/usr/bin:/binin two fixtures, but the fixture's own interpreter (shinrunSampleShell,sleepinrunMLXStopScript) is resolved byexec.Commandfrom the parent PATH beforecmd.Envapplies. With an empty PATH, the fallback directories are never reached.Change:
stubFirstDirs(dir): stubs, then inherited PATH entries (empty elements dropped, so the current directory never leaks in), then/run/current-system/sw/bin,/usr/bin,/bin.stubFirstPATH(dir): the child PATH built from that list.stubFirstCommand(dir, name, ...): resolvesnamefrom the same list and sets the child PATH. Used forshandsleep.hack/e2e-fixture-empty-path.sh: compiles thecmd/axistest binary and runs both fixture tests underenv -i PATH=.E2E evidence (empty PATH, compiled test binary):
exec: "sleep": executable file not foundandexec: "sh": executable file not found, so both tests failLocal gates (go1.26.6): deadcode passes;
go vetclean;gofmt -l .empty; staticcheck clean;verify-repo-truthandverify-public-boundarypass.hermetic-go-test.sh ./cmd/axis/... ./internal/facts/...is ok except the known pre-existing box failureTestProbeAdvisoryLockHeldDoesNotConfuseFileWithLock.Not merging. This is for review only.