Repository navigation
fix: mutants in package main are tested, not reported as survived - #165
Merged
Merged
Conversation
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 mutation report listed every mutant in
package mainas survived, though the tests kill them.gremlins v0.6.0 picks the package to test for a mutant by walking up from the file's directory to one whose name ends with the Go package name.
package mainlives incmd/<app>, so no directory matches, gremlins falls back to the module root, runsgo teston a package with no tests, and every mutant there "lives". template-go#12 shows it: three survivors incmd/template-go/start.go. Mutating those lines by hand fails the tests, andgremlins unleash --integrationreports all three killed. Identity'scmd/identityhas the same problem.--integrationmakes gremlins run every test against each mutant instead of one package's tests. This is slower per mutant, but the run is limited to the pull request's changed lines, and the per-mutant timeout is already set from the whole suite's coverage run. The report still never fails the build.A test reads the workflow and checks that the gremlins command carries
--integration. It failed before the change.