Incremental runs

Gooze caches mutation results and skips unchanged files on subsequent runs. Use --no-cache to force a full re-test.

Related pages: Report format and gooze run.

Output directory -o/--output

Choose where reports are written. This is also where the incremental cache lives. Cache entries are keyed on the project-relative path, so a baseline pulled from a registry matches on another machine or CI runner. Re-testing a changed file replaces its previous reports.

gooze run -o .gooze-reports ./...

Reports are written as one YAML per run (<hash>.yaml) plus an index (_index.yaml).

When a file is re-tested

On each run Gooze compares every source file against the stored reports and re-tests it when:

  • it has no stored reports yet,
  • its content changed,
  • its test file (<name>_test.go) changed, or
  • the mutators that produced its reports changed (a Gooze upgrade).

Everything else is reused, and reports for deleted files are dropped, so the mutation score always covers the whole codebase, not only the files that were re-tested.

Changes are detected from file contents, not from git: no base branch, commit, or history is needed, and uncommitted edits are picked up. See incremental execution vs git diff.

What the cache does not see: changes in other files that a file's tests depend on (a helper in another file, a shared test fixture, testdata, a dependency bump). Those can leave a cached result out of date. Run a full pass with --no-cache on a schedule (for example nightly on main) to refresh the baseline.

Force a full re-run

If results look stale, or you changed something the cache can't see (test data, environment), ignore the cache for one run:

gooze run --no-cache ./...

Reuse the cache in CI

A fresh CI runner starts with an empty reports dir. Pull a baseline from an OCI registry before the run and push the updated one after: Sharing reports (OCI).