Skip to content

v0.7.0

Latest

Choose a tag to compare

@k3rn31 k3rn31 released this 01 Dec 05:45
· 26 commits to main since this release
4b5a012

The first release in a year, with a lot of fixes from contributors. Thanks to everyone who sent a PR or reported a bug, and sorry for the long wait.

Before you upgrade

  • Go 1.27 is now required to build or go install Gremlins (#333).
  • Threshold flags now take effect. --threshold-efficacy and --threshold-mcover passed on the command line used to be ignored (#281). A run that passed before may now exit with code 10 or 11. A run that lands exactly on a threshold now passes (#280).
  • v0.6.0 checksum error. The v0.6.0 tag was moved after release, so go install ...@v0.6.0 fails with a checksum mismatch when it fetches from GitHub directly (#326). Use v0.7.0.

New

  • //nomutant:all and //nomutant:<type>[,...] comments turn off mutants for a file, a declaration, a block or a single line. Suppressed mutants are reported as SKIPPED (#279, closes #180).
  • --coverage-profile and --coverage-elapsed reuse a coverage profile you already have, instead of running the whole test suite again first (#303).
  • --timeout-min sets a floor under each mutant's timeout, for suites that are fast overall but have slow waits. The value needs a unit, such as 30s (#313).
  • --output-diff-statuses prints the code change for mutants with the given statuses (#276).

Fixes

  • --diff works for a module in a subdirectory of the repository and for runs scoped to a subdirectory. Before, every mutant was SKIPPED and the run passed without testing anything (#304, fixes #278 and #296). Changed lines are also matched per block within a hunk (#302).
  • On Windows, mutants are no longer all reported NOT COVERED (#337, carrying @vivganes's fix from #250; fixes #222).
  • Mutants in package main and other packages outside the module root are tested in their own package (#306, fixes #268).
  • gremlins unleash ./... mutates the module instead of finding nothing (#315).
  • Coverage no longer marks mutants NOT COVERED when a directory has the same name as the module (#335, fixes #319), and case expressions count as covered when their clause ran (#325).
  • Files the go command doesn't build on this platform or with the given tags are no longer mutated (#341).
  • The module path is read with modfile, so comments or a quoted path in go.mod no longer break it (#317, fixes #295).
  • Tests run with -count=1, so a timed run is never served from the test cache (#314).
  • INVERT_ASSIGNMENTS turns %= into *= instead of leaving it unchanged (#307).
  • Timed-out test processes no longer pile up (#260), and -cpu is passed correctly (#273).
  • Dependency updates, including go-gitdiff 0.9.0, which fixes unbounded decompression of binary diff fragments (#339).

What's Changed

Other Changes

  • chore: gitignore CLAUDE.local.md by @k3rn31 in #259
  • fix(engine): prevent orphaned process accumulation during mutation testing by @k3rn31 in #260
  • chore(deps): bump github.com/google/go-cmp from 0.6.0 to 0.7.0 by @dependabot[bot] in #265
  • chore(deps): bump golang.org/x/tools from 0.39.0 to 0.40.0 by @dependabot[bot] in #266
  • fix(engine): pass -cpu flag as separate exec argument by @ZhukovAlleon in #273
  • chore(deps): bump golang.org/x/tools from 0.40.0 to 0.43.0 by @dependabot[bot] in #271
  • chore(deps): bump github.com/fatih/color from 1.18.0 to 1.19.0 by @dependabot[bot] in #275
  • feat: add output mutation diff by @zalleon in #276
  • ci(lint): pin golangci-lint and exempt tests from goconst by @k3rn31 in #332
  • build(go): require Go 1.27 by @k3rn31 in #333
  • test: stop paying ThreadSanitizer's exit sleep in every helper process by @matuszeg in #316
  • fix(engine): INVERT_ASSIGNMENTS maps %= to *=, not to itself by @matuszeg in #307
  • fix(report): treat threshold as satisfied when efficacy/coverage equals it by @matuszeg in #280
  • fix(configuration): coerce typed flag values via spf13/cast by @matuszeg in #281
  • fix: run tests uncached, so a timed run is not served from the cache by @matuszeg in #314
  • fix(diff): scope changes to each added-line run within a hunk by @elitwilson in #302
  • fix(engine): derive the package path from the file's directory by @thanhtrann293 in #306
  • fix(gomodule): strip a package pattern from CallingDir, so ./... mutates by @matuszeg in #315
  • fix(engine): read case expressions as covered when the clause bodies ran by @volchanskyi in #325
  • chore(deps): bump golang.org/x/tools from 0.43.0 to 0.53.0 by @dependabot[bot] in #294
  • docs(readme): replace retired badges by @k3rn31 in #334
  • chore(deps): bump github.com/hectane/go-acl from 0.0.0-20230122075934-ca0b05cb1adb to 1.0.0 by @dependabot[bot] in #287
  • fix(coverage): strip the module name only from the start of paths by @tridev-tej in #335
  • feat(coverage): accept a pre-computed coverage profile by @matuszeg in #303
  • fix(diff): express the diff in the same paths as the mutant positions by @matuszeg in #304
  • feat(unleash): add --timeout-min, a floor under each mutant's timeout by @matuszeg in #313
  • fix(gomodule): parse go.mod for the module path by @matuszeg in #317
  • test(diff): cover a real git diff with two added blocks in one fragment by @matuszeg in #336
  • feat(engine): add //nomutant:all directive for inline mutation suppression by @matuszeg in #279
  • chore(deps): bump github.com/aymanbagabas/go-udiff from 0.4.1 to 0.4.2 by @dependabot[bot] in #338
  • chore(deps): bump github.com/bluekeyes/go-gitdiff from 0.8.1 to 0.9.0 by @dependabot[bot] in #339
  • chore(deps): bump github.com/spf13/pflag from 1.0.10 to 1.1.0 by @dependabot[bot] in #340
  • fix(coverage): normalise coverage profile paths to forward slashes by @rennanbastosc-source in #337
  • fix(engine): mutate only the files the go command builds here by @matuszeg in #341
  • build(release): migrate goreleaser config to version 2 by @k3rn31 in #345

New Contributors

Full Changelog: v0.6.0...v0.7.0