test: add mutation tests to reach 85%+ test efficacy#479
Conversation
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.
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
|
There was a problem hiding this comment.
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.gofor 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) |
|
🚀 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. |
Summary
cli,config,core,middlewares, andwebpackagesdoctor.goto satisfygoconstlinterMutation Score Progress
New Test Files
cli/config_mutation_test.gocli/daemon_mutation_test.gocli/deprecations_mutation_test.gocli/docker_config_handler_mutation_test.gocli/doctor_mutation_test.goconfig/validator_mutation_test.gocore/buffer_pool_mutation_test.gocore/performance_metrics_mutation_test.gocore/resilience_mutation_test.gocore/retry_mutation_test.gocore/scheduler_mutation_test.gomiddlewares/preset_mutation_test.gomiddlewares/slack_mutation_test.gomiddlewares/webhook_mutation_test.goweb/middleware_mutation_test.goweb/server_mutation_test.goTest plan
go test ./... -tags='!e2e'passgolangci-lintpasses