Sharding and merging

Split one mutation run across parallel jobs to cut wall-clock time, then merge the shards back into a single report set.

1. Run each shard

Give every job the same TOTAL and its own INDEX with -s INDEX/TOTAL. Example with 3 jobs:

gooze run -s 0/3 ./...
gooze run -s 1/3 ./...
gooze run -s 2/3 ./...

Shards are 0-based: the value must satisfy 0 <= INDEX < TOTAL (4/4 is an error). Each shard writes to .gooze-reports/shard_INDEX/.

2. Collect and merge

Bring every shard_* directory back into one reports directory (in CI, upload each shard as an artifact and download them all in a final job), then merge. Results don't show up in the viewer until you do.

gooze report merge
gooze report view

Shard reports replace base reports for the same source file, and base reports for files no shard re-tested are kept, so the cache still works. Details: gooze report merge.

Ready-made CI pipelines

  • GitHub Actions: a matrix of shards plus a merge job.
  • GitLab CI: parallel: N plus a merge stage (note CI_NODE_INDEX is 1-based).
  • To also skip unchanged files across runs, combine sharding with a shared baseline: Sharing reports (OCI).