Testing and Quality
A pytest suite plus the scripts/rotation_quality_gate.py mix-quality gate guard against regressions.
Markers
| Marker | Meaning |
|---|---|
slow | Resource-intensive tests. One of them, tests/test_audio_core.py::TestFeatures::test_detect_bpm, currently never terminates — see the warning below |
integration | Tests touching the I/O and mixing pipeline |
rotation | Full-set / long-duration regression runs |
perf | Benchmark-like performance checks |
viz | Tests requiring optional visualization dependencies |
Markers are declared in pyproject.toml; asyncio_mode = "auto" runs async tests via pytest-asyncio; discovery covers tests/ and packages/*/tests; tests must be deterministic and isolated, never mutating global state (config is reset after modification).
uv run pytest -m "not rotation and not slow" -qNever run the suite with
slowenabled
librosa.beat.beat_trackreturns tempo0.0for the pure 440 Hz sine that theTestFeaturesfixture generates, because it has no onsets to track.adjust_bpm_octave(packages/audio-core/src/audio_core/features.py:15-22) guards onlybpm_min/bpm_max, nevertempo, sowhile tempo < bpm_min: tempo *= 2spins on0.0forever.test_detect_bpmtherefore hangs instead of failing, and any command that selects theslowtests —pytest -m "not rotation"or a barepytest— never finishes. Verified 2026-08-20: the other sixTestFeaturestests each pass in about 8 s. This is the still-open zero-tempo defect tracked in the changelog; theslowmarker is what has been hiding it. Use-m "not rotation and not slow"until it is fixed.
Rotation Gate
| Metric | Micro limit |
|---|---|
beat_phase_correction_p95_ms | ≤ 10.0 |
clipped_ratio | ≤ 0.001 |
energy_dip_worst_db | ≤ 3.0 |
Micro and afro runs stay separated to avoid cross-comparison baselines.
| Mode | Input | Portable |
|---|---|---|
| micro | Synthetic clicks generated in-test | yes |
| afro | Uncommitted tunes/ audio assets, corrections allowed up to roughly half a beat period (~255 ms) | no |
Results aggregate into rotation_summary.json and a human-readable rotation_summary.md.
uv run python scripts/rotation_quality_gate.py micro -n 1Asset-gated
Full afro rotation runs need the
tunes/directory, which is absent from the core repository.