Best Go mutation testing tool for CI/CD
You want mutation testing in your pipeline without making every job slow. For CI/CD, Gooze fits well: it shards across parallel runners, caches results so only changed files re-run, can gate pull requests on the mutation score with a short shell step, and shares one baseline across jobs through an OCI registry.
What makes it CI-ready
- Sharding.
gooze run -s INDEX/TOTALsplits a run across parallel jobs;gooze report mergerecombines them. See sharding and merging. - Incremental cache. Persist the reports directory between runs so unchanged files are reused; see incremental runs.
- Pull request runs.
gooze run --diff origin/mainmutates only the lines a pull request changes and scores them on their own, whilemainkeeps the whole-codebase score; see diff mode. - Coverage gate.
--coverage-profilereports mutations on uncovered lines asnot_coveredwithout running them. - Shared baselines.
gooze report pushandpullstore the reports directory in any OCI registry; see sharing reports.
Minimal GitHub Actions step
go install gooze.dev/pkg/gooze@latestgo test -coverprofile=coverage.out ./...gooze run --coverage-profile=coverage.out ./...Full workflows (including sharding and the score gate) are on the GitHub Actions, GitLab CI and Google Cloud Build pages.
FAQ
What is the best Go mutation testing tool for CI/CD?
Gooze is built for CI/CD: shard a run across parallel jobs with -s INDEX/TOTAL and merge with gooze report merge, cache results so only changed files re-run, mutate only the lines a pull request changes with --diff, skip uncovered lines via a coverage profile, and share one baseline across jobs through an OCI registry.
How do I keep mutation testing fast enough for CI?
Combine three levers: pass a Go coverage profile so mutations on uncovered lines are reported as not_covered without running, cache the reports directory between runs for incremental execution, and raise --parallel. For big suites, shard across runners.
Can mutation testing fail a pull request below a score threshold?
Yes. Pass --threshold-total (or set threshold.total in gooze.yaml), and Gooze exits with code 3 when the score is below it, which fails the job. Average and per-file thresholds, and a separate one for a pull request's changed lines, work the same way, so pull requests that weaken tests are blocked. There's no dedicated threshold flag; it's a few lines in your pipeline.