Testing and Quality

A pytest suite plus the scripts/rotation_quality_gate.py mix-quality gate guard against regressions.

Markers

MarkerMeaning
slowResource-intensive tests. One of them, tests/test_audio_core.py::TestFeatures::test_detect_bpm, currently never terminates — see the warning below
integrationTests touching the I/O and mixing pipeline
rotationFull-set / long-duration regression runs
perfBenchmark-like performance checks
vizTests 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" -q

Never run the suite with slow enabled

librosa.beat.beat_track returns tempo 0.0 for the pure 440 Hz sine that the TestFeatures fixture generates, because it has no onsets to track. adjust_bpm_octave (packages/audio-core/src/audio_core/features.py:15-22) guards only bpm_min/bpm_max, never tempo, so while tempo < bpm_min: tempo *= 2 spins on 0.0 forever. test_detect_bpm therefore hangs instead of failing, and any command that selects the slow tests — pytest -m "not rotation" or a bare pytest — never finishes. Verified 2026-08-20: the other six TestFeatures tests each pass in about 8 s. This is the still-open zero-tempo defect tracked in the changelog; the slow marker is what has been hiding it. Use -m "not rotation and not slow" until it is fixed.

Rotation Gate

MetricMicro 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.

ModeInputPortable
microSynthetic clicks generated in-testyes
afroUncommitted 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 1

Asset-gated

Full afro rotation runs need the tunes/ directory, which is absent from the core repository.