Skip to content

fix(ci): derive the killed-mutant count instead of grepping a line mutmut never prints - #19

Merged
wshallwshall merged 1 commit into
mainfrom
claude/mutmut-killed-count
Jul 28, 2026
Merged

fix(ci): derive the killed-mutant count instead of grepping a line mutmut never prints#19
wshallwshall merged 1 commit into
mainfrom
claude/mutmut-killed-count

Conversation

@wshallwshall

Copy link
Copy Markdown
Collaborator

Follow-up to #18, caught on that PR's own first run of the job it added.

The mutation summary table reports "Killed 0" on a perfectly healthy run. mutmut results lists
only the mutants worth looking at — survived, no tests, timeout, suspicious — and never lists killed
ones, so grep -c ': killed' can only ever return 0.

Run 30308667584 printed killed=0 survived=19 no-tests=355 for a run mutmut's own progress counter
scored at 87 killed. The 87 quoted in the docs was read off that counter and is correct; only the
table's arithmetic was wrong.

The fix

Derive it: the run's final progress line carries the total, and every non-killed mutant is exactly one
line of the results file, so killed = total − listed. Validated against that run's own uploaded
artifact — 461 total − 374 listed = 87, matching mutmut exactly.

If the total can't be read, the table prints ? rather than a fabricated 0. A wrong number is worse
than an obviously missing one here: "Killed 0" reads as a catastrophically broken test suite, which is
exactly the misreading this job exists to prevent.

Pinned by a test asserting the grep is gone and the derivation is present.

Verification

ruff check + format --check clean · zizmor real exit 0 · pytest 9098 passed, 797 skipped ·
the shell derivation re-run against the real CI artifact.

Advisory-only, as before: no write scope on any job, no new required check.

…e mutmut never prints

The mutation summary table shipped in #18 reports "Killed 0" on a perfectly healthy run. `mutmut
results` lists ONLY the mutants worth looking at -- survived, no tests, timeout, suspicious -- and
never lists killed ones, so `grep -c ': killed'` can only ever return 0.

Caught on the very first real run of the job (30308667584), which printed
`killed=0 survived=19 no-tests=355` for a run mutmut's own counter scored at 87 killed. The 87 in
the docs was read off that counter and is correct; only the table's arithmetic was wrong.

Derive it instead: the run's final progress line carries the total, and every non-killed mutant is
exactly one line of the results file, so killed = total - listed. Validated against that run's own
uploaded artifact -- 461 total, 374 listed, 87 killed, matching mutmut exactly.

If the total cannot be read the table prints "?" rather than a fabricated 0, because a wrong number
here is worse than an obviously missing one -- "Killed 0" reads as a catastrophic test suite, and
that is precisely the misreading this job existed to avoid.

Pinned by a test asserting the grep is gone and the derivation is present.
@wshallwshall
wshallwshall enabled auto-merge (squash) July 27, 2026 23:57
@wshallwshall
wshallwshall merged commit f246724 into main Jul 28, 2026
32 checks passed
@wshallwshall
wshallwshall deleted the claude/mutmut-killed-count branch July 28, 2026 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant