Skip to content

test(reporters): put the forwarding checks in the packages they guard - #17

Merged
Disble merged 1 commit into
mainfrom
test/forwarding-tested-where-it-lives
Aug 30, 2026
Merged

test(reporters): put the forwarding checks in the packages they guard#17
Disble merged 1 commit into
mainfrom
test/forwarding-tested-where-it-lives

Conversation

@Disble

@Disble Disble commented Aug 30, 2026

Copy link
Copy Markdown
Owner

The gate passed at 0.56 and still reported four survivors — the return -1 in
each reporter decorator — even though assertions covering exactly those lines
existed and passed.

Why the passing tests did not count

A gated mutant is compiled and run with the tests of its own package.
gatedlaboratory builds go test -c for packageOf(file), so a mutant in
internal/gatedreporter/gatedreporter.go is judged by
internal/gatedreporter's tests and nothing else.

Those assertions lived in internal/consolereporter. Every test green, the code
unguarded, and nothing but the gate to say so — which is the whole argument for
having the gate, arriving as a lesson rather than as a slogan.

What changed

The checks move beside the code they guard, one file per decorator. The two
fakes they need move to internal/dittotesting/fakereporter, because three
packages want the same pair — the two decorators and the release's own reader.

No production code changed.

Checks

  • Full suite, livetree counters, lint 0 issues.
  • mutantsPerReleaseOnThisRepository unchanged.

The gate passed at 0.56 and still reported four survivors -- the `return -1` in
each reporter decorator -- even though assertions covering exactly those lines
existed and passed.

The reason is a property of the gated path worth writing down: **a gated mutant
is compiled and run with the tests of ITS OWN package.** Those assertions lived
in internal/consolereporter, so the mutants in gatedreporter.go and
verbosereporter.go were never judged by them. Every test green, the code
unguarded, and nothing but the gate to say so.

They now live beside the code they guard. The two fakes they need move to
internal/dittotesting/fakereporter, because three packages want the same pair
and the release's own reader wants it too.
@Disble Disble added the bug Something isn't working label Aug 30, 2026
@sonarqubecloud

Copy link
Copy Markdown

@Disble
Disble merged commit 5f65e3d into main Aug 30, 2026
8 checks passed
@Disble
Disble deleted the test/forwarding-tested-where-it-lives branch August 30, 2026 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant