Shard 0 of the nightly mutation run reported two MISSED mutants:
src/builder.rs:178 Builder::failure_retry_period -> Self
src/builder.rs:210 Builder::dht_backend -> Self
Both replaced the setter body with `Default::default()`, wiping the
receiver's accumulated state. The existing #[cfg(test)] mod tests has
one of these `<setter>_setter_stores_exact_value` pinning tests for
nearly every other Builder method, but these two were missing:
- failure_retry_period: no test exercised the setter at all.
- dht_backend: the method and its callers (build_wait_none_does_not_block
et al.) are gated `#[cfg(feature = "test-support")]`, but
cargo-mutants ran with default features only, so neither the method
nor its tests were ever compiled — the mutation survived trivially.
Fixes:
- Add `failure_retry_period_setter_stores_exact_value` matching the
pattern of the other setter tests.
- Add `dht_backend_setter_stores_value` (gated on `test-support`).
- Set `additional_cargo_args = ["--features", "test-support"]` in
.cargo/mutants.toml so cfg-gated setters are part of the mutation
surface.
Verified locally: `cargo mutants --file src/builder.rs` → 17 mutants,
16 caught, 1 unviable, 0 missed.
48 lines
1.9 KiB
TOML
48 lines
1.9 KiB
TOML
# cargo-mutants configuration.
|
|
# https://mutants.rs/reference.html
|
|
|
|
# Use nextest for faster mutation runs.
|
|
test_tool = "nextest"
|
|
|
|
# Async tests + crypto work takes longer under mutation load.
|
|
timeout_multiplier = 3.0
|
|
|
|
# Enable `test-support` so cfg-gated setters (e.g. Builder::dht_backend) and
|
|
# the integration tests that exercise them are part of the mutation surface.
|
|
# Without this, dht_backend mutations always "survive" trivially because the
|
|
# method isn't compiled in.
|
|
additional_cargo_args = ["--features", "test-support"]
|
|
|
|
# Skip paths that either can't be meaningfully mutated or are covered by
|
|
# other tools:
|
|
# - sim_impl.rs: simulator is exercised via the simulator example, not
|
|
# unit tests; mutation scores would mislead.
|
|
# - dht/mainline.rs: covered only by the nightly mainline-live lane.
|
|
# - kani_proofs.rs: proof harnesses, NOT runtime code. They're gated on
|
|
# `#[cfg(kani)]` and only built by Kani itself; our test suite never
|
|
# touches them, so every mutation would "survive" trivially. Mutation
|
|
# testing of proof harnesses is a category error — the proofs verify
|
|
# invariants in the production code, not the other way around.
|
|
# - examples: not part of the library surface.
|
|
# - tests/*: the tests themselves.
|
|
# - benches: not on the hot path.
|
|
exclude_globs = [
|
|
"src/sim_impl.rs",
|
|
"src/dht/mainline.rs",
|
|
"src/kani_proofs.rs",
|
|
"examples/**/*",
|
|
"tests/**/*",
|
|
"benches/**/*",
|
|
]
|
|
|
|
# Acceptable mutation classes: arithmetic, logical, comparison, return-value
|
|
# substitution. Default set is fine.
|
|
|
|
# Fail if any mutant survives on the algorithmic core after the full run.
|
|
# Acceptance target (see PROTOCOL.md + CHANGELOG):
|
|
# * keys, wire, crypto, merge: ≥ 80% caught.
|
|
# * crate-wide: ≥ 70% caught (error-logging mutants in protocol.rs
|
|
# often survive without affecting correctness).
|
|
|
|
# Run via `just mutants` locally; CI shards across jobs.
|