fix(test): locate synth via CARGO_BIN_EXE — un-red Code Coverage - #908
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
avrabe
force-pushed
the
fix/coverage-binary-path
branch
from
August 5, 2026 04:13
3d289ce to
8a9446b
Compare
…overage`
`Code Coverage` has been RED repo-wide — on main and on every open PR — for a
reason unrelated to coverage.
Two CLI tests hand-rolled their binary path: two `.parent()` hops up from
`current_exe()`, then push "synth". That resolves for the plain
`target/debug/deps/<test>` layout and for nothing else. Under `cargo llvm-cov`
the test binary lives at
target/llvm-cov-target/debug/build/synth-cli/<hash>/out/<test>
so the walk produced `.../<hash>/synth` — a path that does not exist — and the
tests failed on a MISSING BINARY rather than on anything they assert: 2 in
async_intrinsics_gate.rs and ~56 in wast_compile.rs. The required `Test` job
runs the plain layout and stayed green throughout, so a real gate sat red for a
reason nobody read — the same "the checker is the defect" class as the vacuous
gates and the correlated validators elsewhere in this release.
Both now use `env!("CARGO_BIN_EXE_synth")`, which Cargo sets at compile time to
the built binary's real path and is therefore layout-independent by
construction — the mechanism every other CLI integration test already used.
wast_compile.rs's comment even said "cargo sets this for integration tests",
which is true of CARGO_BIN_EXE_synth and not of the walk beneath it.
Swept: zero code-level `current_exe()` binary walks remain under
crates/*/tests/, so this closes the class rather than the reported instance.
Verified in the EXACT failing configuration, not a proxy:
cargo llvm-cov --no-report --tests -p synth-cli \
--test wast_compile --test async_intrinsics_gate
-> 56 passed, 2 passed, 2 passed; 0 failed
plus the plain layout and a relocated CARGO_TARGET_DIR. `cargo fmt --check`
clean. No production code touched.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YJK5LZZEkV5smCY1jKn18L
avrabe
force-pushed
the
fix/coverage-binary-path
branch
from
August 5, 2026 06:06
8c2efd7 to
e598a58
Compare
This was referenced Aug 5, 2026
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.
The
Code Coveragejob has been failing repo-wide — onmainand on every open PR — for a reason that has nothing to do with coverage.crates/synth-cli/tests/async_intrinsics_gate.rsis the only CLI test that hand-rolls its binary path: two.parent()hops up fromcurrent_exe(), then push"synth". Correct for the plaintarget/debug/deps/<test>layout, wrong for any other. Undercargo llvm-covthe test binary lives atso the walk yields
…/<hash>/synth, which does not exist. Both tests then fail on a missing binary, not on anything they assert:The required
Testjob runs the plain layout and stays green, so a genuinely red gate sat unnoticed — the same "the checker is the defect, not the checked" shape as the vacuous gates and the correlated validators elsewhere in this release.Fix: use
env!("CARGO_BIN_EXE_synth"), which Cargo sets at compile time to the built binary's real path and is therefore layout-independent by construction. Every other CLI integration test in that directory already does this.Verified in the exact failing configuration, not a proxy:
cargo llvm-cov --no-report --tests --test async_intrinsics_gatecargo testCARGO_TARGET_DIRAlso
cargo fmt --checkclean. No production code touched — this is a test-harness fix only.