Skip to content

fix: mutants in package main are tested, not reported as survived - #165

Merged
ExtraToast merged 1 commit into
mainfrom
fix/gremlins-main-packages
Oct 16, 2026
Merged

ExtraToast merged 1 commit into
mainfrom
fix/gremlins-main-packages

Conversation

@ExtraToast

Copy link
Copy Markdown
Contributor

The mutation report listed every mutant in package main as 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 main lives in cmd/<app>, so no directory matches, gremlins falls back to the module root, runs go test on a package with no tests, and every mutant there "lives". template-go#12 shows it: three survivors in cmd/template-go/start.go. Mutating those lines by hand fails the tests, and gremlins unleash --integration reports all three killed. Identity's cmd/identity has the same problem.

--integration makes 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.

@ExtraToast ExtraToast added type: bug Something is broken or behaving incorrectly. area: tooling Reusable workflows, Gradle, templates, Renovate, and API tooling. labels Oct 16, 2026
@ExtraToast
ExtraToast merged commit a4ea90b into main Oct 16, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: tooling Reusable workflows, Gradle, templates, Renovate, and API tooling. type: bug Something is broken or behaving incorrectly.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant