Repository navigation
fix(affected): skip a mix test shard whose partition gets no selected file - #98
Merged
Merged
Conversation
… file `mix test --partitions N` deals the files it is given out in turn, so partition K of fewer than K files is empty, and Mix fails with "Paths given to mix test did not match any directory/file". A narrowed shard was handed the whole selection whatever its partition, so a change that reached one test file failed every shard but the first. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Merged
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.
What
A narrowed
mix test --partitions Nshard is skipped when its partition gets none of the selected test files.Why
mix test --partitions Nsorts the files it is given and deals them out in turn. Partition K of fewer than K files is empty, and Mix then fails:--relatedhanded every shard the whole selection, whatever its partition. A change that reached one test file therefore failed every shard but the first.Seen in CI on a private monorepo with four shards: a one-file selection passed in shard 1 in seconds, failed in shards 2 to 4, and each of those was then retried in full (about 10 minutes each).
How
MIX_TEST_PARTITION=Kwritten in front of the command in the shard's one-liner, and the total from--partitions Nor--partitions=N.Tests
a_shard_whose_partition_gets_no_selected_file_is_skipped.shard_projects_run_their_slice_of_the_selected_testsnow selects two files so that both shards run; it previously asserted the failing behaviour for the second shard.cargo test: all pass exceptdev_services::dynamic_port_bundles_are_distinct_propagated_and_released, which fails the same way onmainon my machine.cargo clippy --all-targets -- -D warningsandcargo fmt --checkare clean.🤖 Generated with Claude Code