alunduil / alunduil/zfs-replicate
Tests pin the thresholds and accumulation in task.report
- Lingua principale
- Python
- Stelle
- 24
- Fork
- 6
- Merge medio
- 3h 11m
- PR unite (30g)
- 49
Descrizione
## User story
As a **maintainer of zfs-replicate's test suite**, I want **tests that fail when `task.report` crosses a summarisation threshold at the wrong count or drops part of the report it accumulated**, so that **the operator-facing dry-run output is actually pinned down**.
## Why
The mutation baseline from #485 leaves 49 survivors in `zfs/replicate/task/report.py` against 95% line coverage. They fall into two kinds, both of which change what an operator reads.
Every `LIMITS` comparison can slide by one without failing a test, so the point at which the report collapses to a count is unconstrained:
```
- if len(filesystems) > LIMITS["filesystem"]:
+ if len(filesystems) >= LIMITS["filesystem"]:
```
The report builds its output by accumulation, and replacing an append with an assignment silently discards everything written so far:
```
- output += _counts("action", tasks, indentation=" ")
+ output = _counts("action", tasks, indentation=" ")
```
## Acceptance criteria
- [ ] A test exercises each `LIMITS` key at exactly the limit and at one over it, asserting which of the two report shapes comes out.
- [ ] A test asserts the whole rendered report for a task set that reaches every branch, so a dropped append fails.
- [ ] `poetry run mutmut run --max-children 1 'zfs.replicate.task.report.*'` reports no survivor that a test could have killed. Anything left is noted as an equivalent mutant.
## Out of scope
- Changing the report format or the `LIMITS` values.
- The other modules in the #485 baseline; each has its own issue.
## Notes
- Reproduce with `poetry install --with mutation` then `poetry run mutmut run --max-children 1`, and read one survivor with `poetry run mutmut show `. Serial matters: the parallel runner mis-attributes verdicts on this suite.
- Follow-up to #485.
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.