Repository navigation
fix(tests): give helper-crate dummy tests crate-prefixed filenames - #2493
Closed
worktrunk-bot wants to merge 1 commit into
Closed
worktrunk-bot wants to merge 1 commit into
worktrunk-bot wants to merge 1 commit into
Conversation
Both `tests/helpers/mock-stub/tests/builds.rs` and `tests/helpers/wt-perf/tests/builds.rs` produced test target binaries named `builds`, with no other distinguishing artifact on disk. cargo-affected's runner-shim resolves a binary path to a target id by exact-hash match, then by basename fallback, then by filesystem state or binary-content marker. With the same basename in two crates and nothing to break the tie, the shim aborts the run, which fails the `collect affected coverage` job on every push to main. Rename the files to `mock_stub_builds.rs` and `wt_perf_builds.rs` so the test target basenames are unique, and mention the constraint in each crate's HOW THE BINARY GETS BUILT note so a future helper crate doesn't reintroduce the collision. Co-Authored-By: Claude <[email protected]>
Owner
|
we'll fix upstream |
This was referenced Apr 30, 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.
Problem
The
collect affected coveragejob has been failing on every push to main since the cargo-affected jobs were added in #2475. Failed run: 25147440158.The runner-shim aborts with:
Both
tests/helpers/mock-stub/tests/builds.rsandtests/helpers/wt-perf/tests/builds.rsare one-line dummy tests whose only job is to force their crate's binary to compile undercargo test. Cargo derives the test target name from the file stem, so each produced a binary namedbuilds-<hash>. Whenever the recorded hash drifts (incremental rebuilds, different runner image, etc.), cargo-affected's shim falls back to a basename match — which is ambiguous between the two crates and has nothing else to break the tie.Solution
Rename the files so each test target gets a crate-prefixed, unique basename:
tests/helpers/mock-stub/tests/builds.rs→tests/helpers/mock-stub/tests/mock_stub_builds.rstests/helpers/wt-perf/tests/builds.rs→tests/helpers/wt-perf/tests/wt_perf_builds.rsBoth
Cargo.tomlHOW THE BINARY GETS BUILTnotes are updated to reference the new filenames and to call out the disambiguation constraint, so a future helper crate doesn't reintroduce a generic name likebuilds.rs.This is the local fix that's tractable from the worktrunk side. Even if cargo-affected later improves its disambiguation, unique basenames are the more robust contract.
Testing
Local
cargo test -p mock-stub -p wt-perfbuilds and passes; produced executables are nowmock_stub_builds-<hash>andwt_perf_builds-<hash>, removing the basename collision the shim was tripping on.Automated fix for failed run.