Repository navigation
Run the mutants in parallel and the mutation job only when it matters - #4
Merged
Merged
Conversation
tests/mutate writes every mutant to its own directory, runs the suite for all of them with xargs -P, and reports the verdicts in order. MUTATE_JOBS sets the number of parallel runs, with the processor count as the default. With 32 processors the run takes 68 seconds instead of 11 minutes, and with 4 it takes 3 minutes 14 seconds. The verdicts are the same 187 detected mutants. The mutation job moves to its own workflow with a paths filter, so a change outside the checker, the tests, and the mise files does not run it.
A push to a pull request branch started a push run and a pull_request run on almost the same tree. push now runs only on main, so a pull request runs once, on the merge result, and main runs after the merge.
The UBUNTU_VERSION repository variable is the one source of the runner version.
tests/mutate prints the mutant and job counts before it starts, and --verbose prints one line per mutant as its verdict lands. The CI job passes --verbose, so the step log shows progress. The checkout and mise steps have names.
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.
Summary
tests/mutatewrites every mutant to its own directory, runs the suite for all of them withxargs -P, and reports the verdicts in order.MUTATE_JOBSsets the number of parallel runs; the default is the processor count.ci.ymltomutate.yml, with apathsfilter on the checker,tests/, the mise files, and the workflow itself. A change elsewhere does not run it.CLAUDE.mdno longer say the check takes several minutes.Timing
Same machine, same 187 mutants, all detected:
Verification
footgunlines removed fromtests/fail/idiom.md, the script reportsNOT DETECTED: [idiom] without \bfootguns?\band exits 1.NOT APPLIEDand exits 1.