Repository navigation
fix(mutants): tell a row that did not run from one that survived - #248
Merged
Merged
Conversation
scripts/mutants.sh gave every row it did not kill the same label, "SURVIVED or did not run". A server that never came up (issue #93: AddrInUse, exit 4) therefore read like a surviving mutant, which is the very finding the job exists to make. A real survivor could also hide among setup failures. scripts/lib/mutants-verdict.sh now gives each row one of four verdicts: - KILLED: its tests ran and one failed, with the needle in the log when the row has one. - SURVIVED: its tests ran and all passed. - UNCLEAR: tests failed, but the log lacks the needle. - DID NOT RUN: the run stopped before its tests gave a verdict. The detail names the reason from contract.sh's exit status: 2 is a missing precondition, 3 a failed setup, 4 a target that never came up, 5 the vacuity guard, and 101 tests that did not build. For cargo rows, exit 101 with no failed test means the tests did not build. Only KILLED (and REFUSED, for the guard rows) passes, as before. The summary now ends with the count of each verdict. The four kill_check* functions keep their names and arguments, so no row changed. A row that `cargo test` runs now shows the end of its log when it is not killed; before, it showed nothing. test-mutants-verdict.sh runs in ci-scripts. It checks 200 generated cases: every exit status x every report shape x no needle, a needle the log contains, and one it lacks. It also checks the wiring in mutants.sh. 14 hand mutants each fail it, under dash. The mutant that reads a run that never started as SURVIVED (the #93 bug) fails 112 checks. Checked on real runs as well: - an OIDC mutant against the csrfoff pass, a planted mutant those tests cannot kill: SURVIVED; - csrf-switch-ignored-when-off: KILLED; - a target whose port is held by a listener: DID NOT RUN (exit 4). plan-ci runs mutants and ci-scripts for either file. Two new checks in test_plan_ci.py fail when the rule leaves out ci-scripts. Refs: #93 Co-Authored-By: Claude Opus 5.5 <[email protected]>
4 tasks
aRustyDev
added a commit
that referenced
this pull request
Nov 17, 2026
main moved while CI ran on this branch: #248 (the mutation controls tell a row that did not run from one that survived) edits plan-ci.py, test_plan_ci.py and ci.yml, as this branch does. The merge is textually clean and was tested before it was committed, because a clean merge of two CI changes is not evidence that they agree (the last one was not): - test_plan_ci.py: 6,771 checks pass - test-ci-scripts.sh under dash: 173 cases pass - mutate_gate.py: 53 of 53 mutants killed, none broken, both equivalent mutants survive - lint-all-workflows.sh, lint-actionlint.sh and check-ci-index.sh exit 0 - the merged ci.yml keeps #248's test-mutants-verdict.sh beside this branch's two new tests and its two new deps steps Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
aRustyDev
added a commit
that referenced
this pull request
Nov 17, 2026
… cargo test (test-suites PR 2) (#252) * test: run the adapter suites on nextest, so only the doctests stay on cargo test PR 2 of the test-suites plan. - .config/nextest.toml: an `adapters` profile for the suites that need Docker. It selects `binary(pg_adapter) | binary(smtp_sink)`, writes a JUnit report, and kills nothing, as cargo test did: the slowest test took 30 s here, and a runner is slower. Each test starts its own Postgres or Mailpit container, so nextest's process per test shares nothing those suites did not share before. - CI's `pg-adapter` job installs nextest (setup-rust's `nextest` input) and runs each suite as `cargo nextest run -p thrust-adapters-selfhosted --profile adapters -E 'binary(...)'`, two steps as before, so a failure still names its suite. - scripts/verify-all.sh: the same two commands. - scripts/mutants.sh: the adapter rows run through `adapter_row` (the `adapters` profile with `--ignore-default-filter`, so the hermetic smtp_wire, smtp_config and Cloudflare email suites can be rows too). With every row on nextest there is one kill rule: nextest exits 100 and the row's JUnit report counts a failure. The libtest checks are gone. Every one of the 7 invocations selects the same tests as on cargo test, name for name: pg_adapter 82, smtp_sink 7, and the rows' filtersets. Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs: every Rust test runs on nextest except the doctests AGENTS.md (the suites paragraph, and the commands table's adapter row), the testing chapter (rules.md, running.md: the exit codes and the pg-adapter job; real-backends.md), the contributing pages (standards.md: the kill rule and the Postgres row; features.md: the planted Postgres bug's command, as mutants.sh runs it), the rust-test-logic skill's nextest reference, and the plan's status. Dated records that cite a run's `exit 101` (status.md, mutation.md) say what was measured then, and stay as written. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(mutants): every row on nextest, judged by verdict_suite On top of #248's verdicts. The adapter rows (pg_adapter's two, the six SMTP, the four Cloudflare email) run through `adapter_row`: nextest with the `adapters` profile and `--ignore-default-filter`, the log in `<name>.test.log` and the JUnit report beside it as `<name>.junit.xml`. That is the shape a contract.sh pass has, so verdict_suite judges both unchanged, and kill_check_suite and kill_check_suite_msg take every row. adapter_row turns nextest's 4 (no test ran) into 5, as contract.sh does, so the verdict reads it as the vacuity guard and not as "the target never came up". No row runs on cargo test any more, so the libtest judge goes: the library's verdict_cargo, mutants.sh's kill_check and kill_check_msg, the `cargo` kind of `record`, and the test's cargo section. test-mutants-verdict.sh generates its cases for the log of a contract pass and of an adapter row alike (286 checks), and checks the wiring: both functions use verdict_suite, no row runs `cargo test`, and adapter_row maps 4 to 5. Controls, each a broken copy that must fail the test, under dash: - the #93 bug (a run that never started read as SURVIVED): 32 bad; - the needle ignored: 6 bad; - adapter_row keeping nextest's 4: 1 bad; - an SMTP row back on cargo test: 1 bad. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
#93 still had one open criterion:
scripts/mutants.shreported every row it did not kill asSURVIVED or did not run. Thatcauses two problems:
is the very finding this job exists to make.
What changes
scripts/lib/mutants-verdict.shdecides one verdict per row:The exit statuses
contract.shuses to say why a run stopped:For a
cargo testrow, exit 101 with no failed test also means the tests did not build.What stays the same and what is new in
scripts/mutants.sh:kill_check*functions keep their names and arguments, so no row changed. The job still fails on anything thatis not KILLED, or REFUSED for the guard rows.
killed=1 survived=1 unclear=0 did-not-run=1 refused=0 not-refused=0.cargo testrow that is not killed now shows the end of its log. Before this change it showed nothing.Tests
test-mutants-verdict.shruns inci-scripts. It is 200 generated cases: every exit status, crossed with every reportshape, crossed with three needle cases (no needle, a needle the log contains, and one it lacks). It also checks the
wiring in
mutants.sh. 14 hand mutants fail it under dash. The mutant that brings back the #93 bug, where a run that neverstarted is called SURVIVED, fails 112 checks.
Real runs, AGENTS.md rule 8. I ran a trimmed copy of the new
mutants.shagainst three real rows:mutant_unverified_email(OIDC) against thecsrfoffpasscsrf-switch-ignored-when-off, a row of the real scriptshow_whyprinted the AddrInUse lineplan-ci. A change to either file now runs bothmutantsandci-scripts. Two new checks intest_plan_ci.py(5027 checks pass) fail when the rule leaves out
ci-scripts.Locally. All 43
ci-scriptsanddepscommands pass under dash.Docs. Recorded as D-21 in
docs/src/testing/status.md.Not changed.
.agents/plans/project-skills/artifacts/skills/rust-testing/references/must-fail-controls.mdis a draftskill. It still describes the old wording, and it already predated the move to nextest.
Refs #93. With this change, every acceptance criterion of #93 is met. Whether to close it is the owner's call.
🤖 Generated with Claude Code