test(reporters): put the forwarding checks in the packages they guard - #17
Merged
Conversation
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.
|
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.



The gate passed at 0.56 and still reported four survivors — the
return -1ineach 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.
gatedlaboratorybuildsgo test -cforpackageOf(file), so a mutant ininternal/gatedreporter/gatedreporter.gois judged byinternal/gatedreporter's tests and nothing else.Those assertions lived in
internal/consolereporter. Every test green, the codeunguarded, 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 threepackages want the same pair — the two decorators and the release's own reader.
No production code changed.
Checks
livetreecounters, lint0 issues.mutantsPerReleaseOnThisRepositoryunchanged.