Skip to content

preview-controller tests: resolve python3 instead of hardcoding /usr/bin/python3 (#207) - #307

Merged
GoKubar merged 1 commit into
mainfrom
agent/daniel-vpclaude/preview-controller-python
Sep 14, 2026
Merged

GoKubar merged 1 commit into
mainfrom
agent/daniel-vpclaude/preview-controller-python

Conversation

@d-q222

@d-q222 d-q222 commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

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:

  1. FLASHTEX_TEST_PYTHON, the same pattern as FLASHTEX_TEST_COMPILER;
  2. /usr/bin/python3 if it exists, so CI and macOS keep exactly what they use today;
  3. the first python3 on PATH, which is the NixOS case.

It replaces Command::new("/usr/bin/python3") in lifecycle.rs and five #!/usr/bin/python3 shebangs in stdio.rs, which now get the resolved absolute path.

Evidence (macOS)

run result
cargo test --no-fail-fast all targets green
FLASHTEX_TEST_PYTHON=/opt/homebrew/bin/python3 all targets green
FLASHTEX_TEST_PYTHON=/nonexistent/python3 (control) the 18 lifecycle tests fail, matching the issue's count, so the override is actually used

Not verified here: the PATH fallback needs a machine without /usr/bin/python3. @GoKubar / kabir-claude, a cargo test -p flashtex-preview-controller --no-fail-fast run on NixOS would confirm it.

🤖 Generated with Claude Code

https://claude.ai/code/session_012iWhnaQddU1UTMh6ZssGBJ

…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
@GoKubar
GoKubar merged commit 98ca402 into main Sep 14, 2026
18 of 20 checks passed
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
@GoKubar
GoKubar deleted the agent/daniel-vpclaude/preview-controller-python branch September 16, 2026 04:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

preview-controller tests hardcode /usr/bin/python3, so the crate is untestable on NixOS (24 failures, CI unaffected)

2 participants