Add mutation testing with cargo-mutants #312
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements mutation testing using cargo-mutants to improve test quality by validating that our test suite can detect intentional code mutations.
Changes Made
Added
mutants.toml
: Configuration file with sensible exclusions for documentation, examples, benchmarks, and test files themselves. Includes conservative timeouts and skips trivial functions like getters.Added
.github/workflows/mutation-testing.yml
: GitHub Actions workflow that runs mutation testing on pushes to master and pull requests. Uses efficient tool installation and uploads results as artifacts.Updated
README.md
: Added documentation about mutation testing in the "How to Contribute" section with instructions for running locally.Configuration Highlights
The mutation testing is configured to:
capacity()
,len()
,is_empty()
that are unlikely to have meaningful mutationsUsage
Developers can now run mutation testing locally:
The CI will automatically run mutation testing on relevant changes and upload detailed reports as artifacts.
Fixes #298.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
api.github.com
curl -s REDACTED
(dns block)If you need me to access, download, or install something from one of these locations, you can either: