Skip to content

Fix --coverage executing tests for uncovered mutants - #45

Merged
jonbaldie merged 2 commits into
mainfrom
fix/coverage-skip-uncovered-before-exec
Aug 26, 2026
Merged

Fix --coverage executing tests for uncovered mutants#45
jonbaldie merged 2 commits into
mainfrom
fix/coverage-skip-uncovered-before-exec

Conversation

@jonbaldie

Copy link
Copy Markdown
Contributor

Summary

--coverage classified mutants as NOT COVERED only after running go test (or --exec). Uncovered mutants paid the full suite cost, then were discarded. Covered-MSI was already correct; the waste was execution.

Root cause

runExecJob did this:

  1. mutateExec (overlay + go test)
  2. then coverProfile.IsCovered

The line number and coverage profile were already on the job before exec.

Fix

Check coverage first. Skip exec for uncovered mutants. Covered-MSI semantics are unchanged.

Test

TestEngineCoverageSkipsExecForUncoveredMutants uses a covered + uncovered fixture and a counting --exec. Exec count must equal scored mutants, not include not-covered.

go test ./internal/engine/ -run TestEngineCoverageSkipsExecForUncoveredMutants -count=1

runExecJob ran mutateExec before the coverage check, so uncovered
mutants paid a full test run and were then discarded. Classify
coverage first and skip exec for uncovered lines. Covered-MSI is
unchanged.
@jonbaldie

Copy link
Copy Markdown
Contributor Author

Retriggering checks after GitHub Actions outage left runs stuck in queued.

@jonbaldie jonbaldie closed this Aug 26, 2026
@jonbaldie jonbaldie reopened this Aug 26, 2026
@jonbaldie
jonbaldie merged commit 288efbf into main Aug 26, 2026
4 checks passed
@jonbaldie
jonbaldie deleted the fix/coverage-skip-uncovered-before-exec branch August 26, 2026 18:28
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