Skip to content

Scoped mutation run splits by project #309

Closed

Description

@bitbiter-dev

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: IsMutationTarget is true for every non-test project (Directory.Build.props), and Anichron.Testing opts out in its csproj.
  • scripts/mutation-targets.sh lists the target projects from Anichron.slnx through MSBuild. mutation-changed.sh uses it to group the changed files by project.
  • One Stryker run per changed target project (--project <Name>.csproj plus that project's -m files), one after another, each with its own TMPDIR.
  • 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.sh checks that every project opted out of IsMutationTarget has a !**/<Name>/** entry in stryker-config.json's mutate, 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.md and 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions