Skip to content

feat(rust) :: add mutants.rs as nonblocking step to CI - #1395

Closed
81reap wants to merge 1 commit into
sqlpage:mainfrom
81reap:rust/lint
Closed

feat(rust) :: add mutants.rs as nonblocking step to CI#1395
81reap wants to merge 1 commit into
sqlpage:mainfrom
81reap:rust/lint

Conversation

@81reap

@81reap 81reap commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

adds mutation testing for Rust as a non-blocking step to the CI :: https://mutants.rs/

This step is non-blocking as it does find issues, but it is up to the reader to interpret the results (at least for me I don't know of a quick way to do it just yet). It also is kinda really slow. I ran it over the entire codebase on my Ryzen 7 5800X3D ~3h (09:56 → 13:07). I left it running through the day as I was at work and these are the results.

{
  "cargo_mutants_version": "27.1.0",
  "start_time": "2026-08-21T13:56:34.66744901Z",
  "hostname": "jager",
  "username": "reap"
}

see #1396 for a more detailed breakdown of the full run

the goal is to break down these things into groups and create an issue to dicuss more about how this can help improve the codebase. this also is an progammatic way to catch the remaining issues called out in #1389

Comment thread .github/workflows/ci.yml
Comment on lines +546 to +572

mutants:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
timeout-minutes: 30
continue-on-error: true
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: taiki-e/install-action@v2
with:
tool: cargo-mutants
- name: Set up cargo cache
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4
with:
shared-key: rust-sqlpage-mutants
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Mutate only the lines this pull request changed
run: |
git diff "origin/${{ github.base_ref }}...HEAD" > mutants.diff
cargo mutants --in-diff mutants.diff --jobs 2
- uses: actions/upload-artifact@v7
if: always()
with:
name: mutants-report
path: mutants.out/

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

hmm, I was under the impression that this would also run in the CI so that I could show it as working

@lovasoa lovasoa closed this Aug 22, 2026
@lovasoa

lovasoa commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator

See my comment on the associated issue. Most of what this surfaces sounds like noise to me. 100% test coverage is not a useful goal IMHO.

New tests are welcome, but each one should come with a reasonable argument for why it is testing an important invariant that could realistically break in the future. Other tests just add churn and slow down development.

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.

2 participants