Audit Cadence¶
The Audit Cadence workflow runs on the first day of each month and can also
be started manually from GitHub Actions. It is a lightweight inventory audit,
not a full test-suite substitute.
The workflow performs three checks:
- Install the development test environment with
python tools/ci_install_dev.py. - Run
python -m pytest tests/ --collect-only -q. - Run
python tools/test_inventory_audit.pyagainst the collection transcript.
The audit compares tracked test_*.py files with the files observed in
pytest's collect-only output. A tracked file may be absent from base collection
only when it declares a module-level pytest.importorskip(...) optional
dependency gate. Any other uncollected tracked test file fails the workflow.
The workflow uploads two artefacts:
| Artefact | Purpose |
|---|---|
audit-collect-only.txt |
Raw pytest collection transcript. |
audit-inventory.json |
Stable JSON summary of tracked files, collected files, collected tests, optional import-skip files, and unexpected gaps. |
Use the same command locally when adding or moving tests:
PYTHONPATH=src:. python -m pytest tests/ --collect-only -q | tee audit-collect-only.txt
python tools/test_inventory_audit.py \
--repo . \
--collect-output audit-collect-only.txt \
--output audit-inventory.json
This cadence detects drift in the test inventory between larger audit sweeps. Runtime correctness remains owned by the normal CI matrix, optional-dependency lanes, perf-gated selector, and focused tests attached to each code change.