test: make resolveClientCommand codex/claude tests hermetic (#642) - #643
Conversation
The old test hard-coded /usr/bin as a PATH that does not contain codex/claude. On any machine with those CLIs installed in /usr/bin the not-on-PATH assertion failed (resolveOnPath returns the absolute path). Split into two hermetic tests, following the pi/codebuddy pattern: - not-on-PATH: PATH points at an empty temp dir → bare-name fallback - on-PATH: fake codex/claude executables in a temp bin dir → the absolute path is returned
📦 Built Package ArtifactBranch: Option A — Install from npm PR tag (recommended)npm install -g billion-context@pr-643Each push to this PR publishes a new version under the Option B — Download artifact
tar xzf billion-context-pr643.tgz
npm install -g packageThis comment is automatically updated on each push. |
[bot] 🏷 Review: ✅ approved — ready to merge I did an independent pass rather than taking the pre-flight at face value. 1. Bug is real & reproduced. In this environment 2. Fix is correct.
3. Hermetic & consistent. Both new tests use 4. Test-only. What I ran:
Minor nit (non-blocking): in the "on PATH" test the two
LGTM. Merge is human-only per AGENTS.md — please merge when ready: #643 |
Fixes #642
Problem
tests/launcher.test.ts:1064—resolveClientCommand: codex/claude resolve to themselveshard-coded/usr/binas a PATH that does NOT contain codex/claude. On any machine with those CLIs in/usr/binthe not-on-PATH assertion fails:Reproduced in this sandbox (has
/usr/bin/codex+/usr/bin/claude): 1 failure before the fix, 0 after.Change
Split the test into two hermetic tests, following the existing pi / codebuddy (#641) pattern:
PATHpoints at an empty temp dir → bare-name fallback (codex/claude)codex/claudeexecutables created in a temp bin dir → the absolute path is returnedTest-only change;
src/launcher.tsuntouched (resolveOnPathwas already correct).Pre-flight
npm run typecheck— cleannpm test— 1241/1241 pass (on this sandbox, where the old test failed)npm run build— success