Skip to content

Run the mutants in parallel and the mutation job only when it matters - #4

Merged
MirzaMerdovic merged 4 commits into
mainfrom
mutate-parallel
Oct 8, 2026
Merged

MirzaMerdovic merged 4 commits into
mainfrom
mutate-parallel

Conversation

@MirzaMerdovic

Copy link
Copy Markdown
Contributor

Summary

  • 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; the default is the processor count.
  • The mutation job moves from ci.yml to mutate.yml, with a paths filter on the checker, tests/, the mise files, and the workflow itself. A change elsewhere does not run it.
  • The README and CLAUDE.md no longer say the check takes several minutes.

Timing

Same machine, same 187 mutants, all detected:

Run Wall time
Serial, before this change 10 min 58 s
32 jobs 1 min 8 s
4 jobs, the CI runner size 3 min 14 s

Verification

  • With both footgun lines removed from tests/fail/idiom.md, the script reports NOT DETECTED: [idiom] without \bfootguns?\b and exits 1.
  • A sed expression that matches nothing is reported as NOT APPLIED and exits 1.
  • shellcheck, shfmt, and actionlint report nothing.

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.
@MirzaMerdovic
MirzaMerdovic merged commit 45a6e5d into main Oct 8, 2026
2 checks passed
@MirzaMerdovic
MirzaMerdovic deleted the mutate-parallel branch October 9, 2026 20:46
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.

1 participant