Skip to content

test: add mutation tests to reach 85%+ test efficacy#479

Merged
CybotTM merged 3 commits intomainfrom
feat/mutation-score
Feb 15, 2026
Merged

test: add mutation tests to reach 85%+ test efficacy#479
CybotTM merged 3 commits intomainfrom
feat/mutation-score

Conversation

@CybotTM
Copy link
Member

@CybotTM CybotTM commented Feb 15, 2026

Summary

  • Add 16 mutation test files targeting surviving mutants across cli, config, core, middlewares, and web packages
  • Raises gremlins mutation test efficacy from 82.55% to 85.87% (1149 killed, 189 lived)
  • Extract status string constants in doctor.go to satisfy goconst linter

Mutation Score Progress

Metric Before After Change
Killed 1102 1149 +47
Lived 233 189 -44
Test efficacy 82.55% 85.87% +3.32%

New Test Files

  • cli/config_mutation_test.go
  • cli/daemon_mutation_test.go
  • cli/deprecations_mutation_test.go
  • cli/docker_config_handler_mutation_test.go
  • cli/doctor_mutation_test.go
  • config/validator_mutation_test.go
  • core/buffer_pool_mutation_test.go
  • core/performance_metrics_mutation_test.go
  • core/resilience_mutation_test.go
  • core/retry_mutation_test.go
  • core/scheduler_mutation_test.go
  • middlewares/preset_mutation_test.go
  • middlewares/slack_mutation_test.go
  • middlewares/webhook_mutation_test.go
  • web/middleware_mutation_test.go
  • web/server_mutation_test.go

Test plan

  • All go test ./... -tags='!e2e' pass
  • golangci-lint passes
  • Gremlins mutation testing confirms 85.87% efficacy

Add 16 mutation test files targeting surviving mutants across cli,
config, core, middlewares, and web packages. Raises gremlins mutation
test efficacy from 82.55% to 85.87% (1149 killed, 189 lived).
Fix gofumpt formatting, replace deprecated assert patterns with
testifylint-compliant alternatives, use Go 1.22+ integer ranges,
remove unused types and stale nolint directives.
Replace repeated "pass", "fail", "skip" string literals with
package-level constants to satisfy goconst linter.
Copilot AI review requested due to automatic review settings February 15, 2026 22:35
@gemini-code-assist
Copy link

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@github-actions
Copy link

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Automated approval for solo maintainer project

All CI checks passed. See SECURITY.md for compensating controls.

@github-actions
Copy link

⚠️ Mutation Testing Results

Mutation Score: 50.00% (threshold: 60%)

⚠️ Score is below threshold. Consider improving test coverage or test quality.

What is mutation testing?

Mutation testing measures test quality by introducing small changes (mutations) to the code and checking if tests detect them. A higher score means better test effectiveness.

  • Killed mutants: Tests caught the mutation (good!)
  • Survived mutants: Tests missed the mutation (needs improvement)

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request adds comprehensive mutation tests to increase test efficacy from 82.55% to 85.87%, killing 44 additional mutants. The changes include 16 new mutation test files targeting surviving mutants across cli, config, core, middlewares, and web packages. Additionally, status string constants are extracted in doctor.go to satisfy the goconst linter.

Changes:

  • Add 16 mutation test files targeting boundary conditions, conditional negations, arithmetic operations, and increment/decrement mutations
  • Extract status string constants ("pass", "fail", "skip") in doctor.go for code quality
  • Update test files to use the new status constants

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated no comments.

Show a summary per file
File Description
cli/doctor.go Extract status constants (statusPass, statusFail, statusSkip) to satisfy goconst linter
cli/doctor_test.go Update tests to use new status constants
web/server_mutation_test.go Tests for token expiry, UI filesystem mounting, job type reflection, and HTTP timeouts
web/middleware_mutation_test.go Tests for rate limiter cleanup boundaries, window calculations, and IP extraction
middlewares/webhook_mutation_test.go Tests for webhook retry logic, attempt counting, sleep timing, and trigger filtering
middlewares/slack_mutation_test.go Tests for Slack HTTP client initialization, error handling, and message formatting
middlewares/preset_mutation_test.go Tests for preset validation, method defaults, content-type handling, and URL building
core/scheduler_mutation_test.go Tests for scheduler initialization, job management, workflow cleanup, and concurrency limits
core/retry_mutation_test.go Tests for retry attempt boundaries, delay calculations, and exponential backoff
core/resilience_mutation_test.go Tests for circuit breaker transitions, rate limiter refills, and bulkhead counters
core/performance_metrics_mutation_test.go Tests for metrics boundary conditions, counter increments, and rate calculations
core/buffer_pool_mutation_test.go Tests for buffer pool operations (not shown in diff)
cli/docker_config_handler_mutation_test.go Tests for Docker configuration resolution, container filtering, and error handling
cli/deprecations_mutation_test.go Tests for deprecation detection in webhooks, config keys, and migration logic
cli/daemon_mutation_test.go Tests for daemon option application, config defaults, and timeout values
cli/config_mutation_test.go Tests for config operations (not shown in diff)

@CybotTM CybotTM enabled auto-merge February 15, 2026 22:38
@CybotTM CybotTM added this pull request to the merge queue Feb 15, 2026
Merged via the queue into main with commit 79df78d Feb 15, 2026
36 checks passed
@CybotTM CybotTM deleted the feat/mutation-score branch February 15, 2026 22:43
@github-actions github-actions bot added the released:v0.20.0 Included in v0.20.0 release label Feb 17, 2026
@github-actions
Copy link

🚀 Released in v0.20.0

Thank you for your contribution! 🙏

This is now available in the latest release. Please test and verify everything works as expected in your environment.

If you encounter any issues, please open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released:v0.20.0 Included in v0.20.0 release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants