Repository navigation
Scoped mutation run splits by project #309
Description
Requirement
scripts/mutation-changed.sh runs Stryker once per changed project instead of once over the whole solution.
Stryker 5.0's solution mode captures per-test coverage once per mutated project, and every capture runs all tests in all assemblies (StrykerRunner.AnalyzeCoverage → MicrosoftTestPlatformRunnerPool.CaptureCoverageTestByTest, which ignores the project). All five captures record the same coverage. A scoped run on one Worker file took 9:22 in solution mode and 2:15 with --project Anichron.Worker.csproj, with the same 31 mutants and the same 100% score.
Acceptance criteria:
- Projects are mutation targets by an MSBuild convention:
IsMutationTargetis true for every non-test project (Directory.Build.props), andAnichron.Testingopts out in its csproj. scripts/mutation-targets.shlists the target projects fromAnichron.slnxthrough MSBuild.mutation-changed.shuses it to group the changed files by project.- One Stryker run per changed target project (
--project <Name>.csprojplus that project's-mfiles), one after another, each with its ownTMPDIR. - Every project's run goes ahead even when an earlier one fails. The script exits with the worst status.
- A changed file outside any target project is named in one line ("not mutated: …") and does not fail the run. A test file that maps to no source file still exits
1, as today. mutation-guard.shchecks that every project opted out ofIsMutationTargethas a!**/<Name>/**entry instryker-config.json'smutate, and that every whole-project exclusion belongs to an opted-out project. The local full sweep still runs in solution mode and needs that entry.docs/mutation-testing.mdand CLAUDE.md state no fixed run durations.- ADR 0009 records why mutation runs per project, with the measurements.
First caller
scripts/mutation-changed.sh, run before every production change (CLAUDE.md). The CI matrix issue reuses mutation-targets.sh.
Design
Not needed because the change is confined to the scoped-run script, an MSBuild property and the guard, and measures the same mutants against the same tests. The trade-off is recorded in ADR 0009, written with this issue.
Activity
feat(scripts): Scoped mutation run goes one project at a time (#309) (#…