Skip to content

ci(backend): run mutation testing monthly in shards - #399

Open
simonvanlierde wants to merge 3 commits into
mainfrom
ci/scheduled-mutation-testing
Open

simonvanlierde wants to merge 3 commits into
mainfrom
ci/scheduled-mutation-testing

Conversation

@simonvanlierde

@simonvanlierde simonvanlierde commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Runs mutmut over the backend app monthly in the Ops workflow (or on demand with operation: mutation), split into six shards by package so each stays inside the job time limit, and uploads each shard's survivor list. It reports functions whose survivor count is above a committed baseline and never fails on survivors. Run it locally with just mutation, narrowed with mutant globs; it runs at low priority on half the cores.

  • The test suite can now use an already-running Postgres, so forked mutant runs share one server, each with its own database.
  • Log calls are not mutated on their first line only; the argument lines of multi-line calls still are.
  • The baseline starts empty and is seeded from the first full run.

Refs #169.

- add `just mutation`: mutmut over app/ against one shared throwaway Postgres,
  listing functions whose survivor count exceeds a committed baseline
- add `just mutation-baseline` to accept triaged survivors
- let the test suite use an already-running Postgres (TEST_POSTGRES_HOST/PORT)
  and give each forked mutant run its own database
- schedule the run in the Ops workflow and upload the survivor lists
- run local mutation testing at low priority on half the cores; the Ops job
  uses all of them
- fail after 60s if the throwaway Postgres never accepts connections
- document cached verdicts and full-run-only rebaselining
- reuse the Postgres coordinates helper for xdist workers
- relock with the pinned uv version
@codecov

codecov Bot commented Oct 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

- split the Ops mutation job into six matrix shards by mutant name, so each
  stays well inside the job time limit
- move it to its own monthly schedule; the other Ops jobs stay weekly
- pass mutant globs through to mutmut without shell expansion
- document rebaselining from the shards' survivor lists
@simonvanlierde simonvanlierde changed the title ci(backend): run mutation testing weekly ci(backend): run mutation testing monthly in shards Oct 2, 2026

This branch has not been deployed

No deployments
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.

1 participant