Skip to content

ci: mutation testing with gremlins (just mutation, Test Action job) - #334

Merged
0x73746F66 merged 1 commit into
mainfrom
fix/224-gremlins-mutation-testing
Nov 13, 2026
Merged

0x73746F66 merged 1 commit into
mainfrom
fix/224-gremlins-mutation-testing

Conversation

@0x73746F66

Copy link
Copy Markdown
Member

Closes #224

What

  • justfile: mutation pkg="./internal/purl" efficacy="80" runs go run github.com/go-gremlins/gremlins/cmd/gremlins@v0.6.0 unleash --threshold-efficacy <efficacy> --timeout-coefficient 10 <pkg>. Pinned like golangci-lint, so an upgrade is a deliberate commit. just mutation ./internal/versions 0 surveys another package without gating.
  • .github/workflows/test.yml: a Mutation testing job (needs: [lint], same runner labels) that checks out, sets up Go, configures the private fetch of vdb-sca-match/vdb-manifest exactly like the test and worktree jobs (gremlins runs go mod download itself), then runs the same command. It uses only actions/checkout@v7 and actions/setup-go@v7, already in actions.lock for this workflow, so the lockfile is unchanged.

Threshold

Measured locally with gremlins v0.6.0 on internal/purl: 33 killed, 6 lived, efficacy 84.62% on main; 100% with the tests in #323 (#225). 80% passes today and fails if a test change stops catching mutants. --timeout-coefficient 10 keeps a loaded self-hosted runner from turning slow tests into timeouts.

Verified

  • just --dry-run mutation renders the command.
  • gremlins unleash --threshold-efficacy 80 --timeout-coefficient 10 ./internal/purl exits 0 at 84.62%.
  • No Go code changed; go build ./... unaffected.

@github-actions

Copy link
Copy Markdown
Contributor

Vulnetix config plan

Manager gitops:vulnetix/cli, prune off, plan hash a8bd984f1753c68b180298051dd9e2524ab644d2ebe9e4c7c811ff4126753b5f

Object Action Changes
~ QualityGate/default update (adopt) severity: null -> "high"

0 to create, 1 to update, 0 to delete, 0 unchanged

@0x73746F66 0x73746F66 left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reuse review: the CI job reuses the same private-module fetch step and pinned actions as the existing test jobs, and runs exactly the just mutation default so local and CI agree. gremlins is pinned (v0.6.0) like golangci-lint. No changes needed.

@0x73746F66 0x73746F66 left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reuse review: the CI job mirrors the existing test job (same checkout/setup-go actions already recorded for test.yml in actions.lock, same private-module fetch step) and the just recipe pins gremlins the way golangci-lint is pinned, so no new mechanism is introduced. The 'Lockfile matches the workflows' failure was HTTP 403 rate limit on PACKAGES_TOKEN during 'gh extension install', not a lockfile mismatch; it will re-run on the rebased head.

Adds a pinned gremlins v0.6.0 run as a justfile recipe (any package,
default internal/purl at 80% efficacy) and as a "Mutation testing" job
in the Test Action workflow. The job sets up the private module fetch
first, since gremlins runs go mod download itself. The threshold sits
under the measured baseline (84.62% on internal/purl today; 100% once
the #225 tests land), so a test change that stops catching a mutant
fails the job.

Closes #224
@0x73746F66
0x73746F66 force-pushed the fix/224-gremlins-mutation-testing branch from 8af5789 to 5cb417e Compare November 13, 2026 12:12
@github-actions

Copy link
Copy Markdown
Contributor

Vulnetix config plan

Manager gitops:vulnetix/cli, prune off, plan hash a8bd984f1753c68b180298051dd9e2524ab644d2ebe9e4c7c811ff4126753b5f

Object Action Changes
~ QualityGate/default update (adopt) severity: null -> "high"

0 to create, 1 to update, 0 to delete, 0 unchanged

@0x73746F66
0x73746F66 merged commit 7f3dc85 into main Nov 13, 2026
30 of 34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add gremlins mutation testing to the project and CI

1 participant