Repository navigation
preview-controller tests: resolve python3 instead of hardcoding /usr/bin/python3 (#207) - #307
Merged
Conversation
…bin/python3
GH#207. The fake compilers ran as Command::new("/usr/bin/python3") in
tests/lifecycle.rs, and as scripts with a #!/usr/bin/python3 shebang at five
places in tests/stdio.rs. NixOS has no /usr/bin/python3, so 24 tests failed
there and the crate could not be verified locally.
Both files now resolve the interpreter the same way:
1. FLASHTEX_TEST_PYTHON, following the crate's existing
FLASHTEX_TEST_COMPILER override;
2. /usr/bin/python3 if it exists, so CI and macOS keep exactly the
interpreter they used, even when a runner puts another python3 earlier
on PATH;
3. otherwise the first python3 on PATH (NixOS).
The shebangs are written with the resolved path, so exec does no PATH
lookup.
macOS (/usr/bin/python3 present), `cargo test --no-fail-fast`: every target
passes. With FLASHTEX_TEST_PYTHON=/opt/homebrew/bin/python3 it also passes.
As a control, FLASHTEX_TEST_PYTHON=/nonexistent/python3 fails the 18
lifecycle tests, so the override really is used. The PATH branch needs a
machine without /usr/bin/python3 (NixOS) to exercise.
Implementation-Agent: daniel-vpclaude (Claude Code, Claude Pro plan)
Commit-Executor: daniel-vpclaude, direct git (Cursor-limit fallback)
Co-authored-by: d-q222 <[email protected]>
Claude-Session: https://claude.ai/code/session_012iWhnaQddU1UTMh6ZssGBJ
This was referenced Sep 14, 2026
GoKubar
added a commit
that referenced
this pull request
Sep 14, 2026
…bin/python3 The restart-capability test added in this branch was written against the old `tests/lifecycle.rs` convention; #307 replaced that with a resolver (`FLASHTEX_TEST_PYTHON`, else `/usr/bin/python3` when it exists, else the first `python3` on `PATH`) because NixOS has no `/usr/bin/python3`. The unit-test module cannot borrow the integration test's helper — it needs the private `layout_capabilities` field — so it carries the same resolver. `cargo test -p flashtex-preview-controller` now passes 89 tests, 0 failures, matching a control run of the same base. Implementation-Agent: claude-opus-5 (mac lane, linux-primary NixOS) Commit-Executor: claude-opus-5 (direct git; Cursor usage limit in effect) Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
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.
Closes #207. Lane
daniel-vpclaude(Claude Pro, mac-m5pro-dq222), self-assigned and documented on #207 first. The change is test-only:crates/preview-controller/tests/{lifecycle,stdio}.rs.Fix. The fake-compiler interpreter now resolves in this order:
FLASHTEX_TEST_PYTHON, the same pattern asFLASHTEX_TEST_COMPILER;/usr/bin/python3if it exists, so CI and macOS keep exactly what they use today;python3onPATH, which is the NixOS case.It replaces
Command::new("/usr/bin/python3")inlifecycle.rsand five#!/usr/bin/python3shebangs instdio.rs, which now get the resolved absolute path.Evidence (macOS)
cargo test --no-fail-fastFLASHTEX_TEST_PYTHON=/opt/homebrew/bin/python3FLASHTEX_TEST_PYTHON=/nonexistent/python3(control)Not verified here: the PATH fallback needs a machine without
/usr/bin/python3. @GoKubar / kabir-claude, acargo test -p flashtex-preview-controller --no-fail-fastrun on NixOS would confirm it.🤖 Generated with Claude Code
https://claude.ai/code/session_012iWhnaQddU1UTMh6ZssGBJ