Skip to content

Commit 17c65ae

Browse files
SEP-1166: Add scoped mutmut pilot tooling for app/core/db/utils.py (#1213)
- Pin `mutmut` (^3.6) as a Poetry **dev** dependency and add `[tool.mutmut]` scoped to `app/core/db/utils.py` with driver `tests/app/core/db/test_utils.py` (not wired into `make test`, pre-commit, or CI). - Document how to re-run the pilot in `CONTRIBUTING.md`; gitignore mutmut's `mutants/` working copy. - Implements the tooling half of [SEP-1166](https://percona.atlassian.net/browse/SEP-1166). Survivor inventory + kill work tracked in follow-up [SEP-1662](https://percona.atlassian.net/browse/SEP-1662) (blocked by SEP-1166).
1 parent 10c25da commit 17c65ae

4 files changed

Lines changed: 355 additions & 6 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ __pypackages__/
107107
celerybeat-schedule
108108
celerybeat.pid
109109

110+
# Mutation testing
111+
mutants/
112+
110113
# Environments
111114
.env*
112115
.venv

CONTRIBUTING.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,25 @@ Ensure all tests pass before pushing your code:
197197
make test
198198
```
199199

200+
Mutation testing (`mutmut`) is an optional local spike tool, not part of
201+
`make test`, pre-commit, or CI. Configuration for the pilot scoped to
202+
`app/core/db/utils.py` lives under `[tool.mutmut]` in `pyproject.toml`. Run it
203+
from the repo root; it writes a gitignored `mutants/` working copy:
204+
205+
```shell
206+
poetry run mutmut run # generate and test mutants
207+
poetry run mutmut results # list surviving mutants
208+
poetry run mutmut show <mutant> # diff for a single mutant
209+
```
210+
211+
On macOS, export the Homebrew library path first. `mutmut` invokes pytest
212+
directly, so it bypasses the wrapper that `make test` uses to make WeasyPrint's
213+
native libraries resolvable:
214+
215+
```shell
216+
export DYLD_FALLBACK_LIBRARY_PATH="$(brew --prefix)/lib:${DYLD_FALLBACK_LIBRARY_PATH}"
217+
```
218+
200219
## Getting Help
201220

202221
If you have any questions or need assistance, feel free to reach out:

0 commit comments

Comments
 (0)