Skip to content

👷 ci: scope mutation testing to production code - #2165

Merged
gaborbernat merged 1 commit into
mainfrom
fix/mutation-scope-2164
Sep 2, 2026
Merged

👷 ci: scope mutation testing to production code#2165
gaborbernat merged 1 commit into
mainfrom
fix/mutation-scope-2164

Conversation

@gaborbernat

@gaborbernat gaborbernat commented Sep 2, 2026

Copy link
Copy Markdown
Member

The nightly mutation run covers 18,902 sites, and 1,063 of them sit in code that answers to nobody outside this repository. A surviving mutant marks a gap where the behaviour is a promise to someone. Production code promises behaviour to the people running peryx, so a survivor there is a missing test. Benchmark workloads, the shared harness and fixture binaries make no such promise, so a survivor in them is noise that each run reports again. The triage in #1893 spent 19 of its 48 sites on those paths.

.cargo/mutants.toml takes three paths out of scope, with a reason beside each glob. A benchmark workload under crates/*/src/bench/ builds load for CodSpeed to measure, so changing how much it builds moves the measurement rather than any claim about correctness. Fixture binaries under crates/*/tests/, such as the S3 multipart fixture, hold up assertions that live elsewhere, and mutating one fails the suite that drives it. 🔬 The harness in crates/peryx-test-support/ is the one worth arguing over, since a fault injector that stopped injecting would leave every test using it green while testing nothing. That failure shows up red instead. A test that arms a fault asserts the faulted outcome, so it fails when the fault does not arrive, and -D dead_code covers harness behaviour no test reaches. Both checks land before mutation asks the question, and the inventory agrees, with no mutant in that crate surviving a run. No carve-out earns its place today, and adding a path back means saying in the config why.

Shard length holds rather than growing, because mutation-count feeds mutation-shard-count from the same plan the run mutates, so 148 shards become 140 with each still targeting 128 mutants. 📉 A contract in lint-automation pins the three globs and checks that the count still comes from that plan, so a wider count cannot size the matrix for mutants nothing examines.

Closes #2164

@gaborbernat gaborbernat added the enhancement New feature or request label Sep 2, 2026
The nightly run covers 18,902 mutants, and 1,063 of them sit in code that
promises nothing to anyone outside this repository. Every nightly reports those
again. Benchmark workloads and the shared harness answer to the tests and
measurements that use them, so a mutant there asks a question no assertion can
settle.

Three paths leave the plan. A benchmark workload builds load for CodSpeed to
measure, so changing how much it builds moves the measurement rather than any
claim about correctness. Fixture binaries under tests/ hold up assertions that
live elsewhere, and mutating one fails the suite that drives it. The shared
harness is the one worth arguing over, since an injector that stopped injecting
would leave every test using it green while testing nothing. That failure shows
up red instead. A test that arms a fault asserts the faulted outcome, so it
fails when the fault does not arrive, and -D dead_code covers harness behaviour
no test reaches. The inventory agrees, with no mutant in that crate surviving a
run.

The plan drops to 17,839 mutants. Shard length holds rather than growing,
because the nightly divides the same list it mutates, so the count goes from 148
shards to 140 with each still targeting 128 mutants.

The reasoning sits in the config beside each glob and in contributing/ci.md,
since an exclusion list without a reason is what drifts. A contract pins the
three globs and checks that the shard count still comes from the plan the run
mutates, so a wider count cannot size the matrix for mutants nothing examines.
@gaborbernat
gaborbernat force-pushed the fix/mutation-scope-2164 branch from cdabeff to aecb241 Compare September 2, 2026 20:52
@codspeed-hq

codspeed-hq Bot commented Sep 2, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 29 untouched benchmarks
⏩ 133 skipped benchmarks1


Comparing fix/mutation-scope-2164 (aecb241) with main (68b3d3c)

Open in CodSpeed

Footnotes

  1. 133 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 peryx | 🛠️ Build #34361705 | 📁 Comparing aecb241 against latest (68b3d3c)

  🔍 Preview build  

2 files changed
± contributing/ci/index.html
± core/repositories/artifact-source/index.html

@gaborbernat
gaborbernat merged commit c29968b into main Sep 2, 2026
20 checks passed
@gaborbernat
gaborbernat deleted the fix/mutation-scope-2164 branch September 2, 2026 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Decide whether mutation covers bench and test-support code

1 participant