Running and extending the open-dj conformance corpus¶
Phase 16 (OPEN-03c) ships a seed corpus under
tests/fixtures/conformance/. Each
fixture is a self-contained triple:
expected.opendj.json-- hand-authored canonical document.capabilities.yaml-- per-adapter drop mask (which fields the adapter is legitimately allowed to lose on round-trip).- optional vendor-DB snapshot under
fixtures/(empty in v0; adapters synthesise from the expected document).
Running the suite¶
pytest -m conformance
A subset across adapters:
pytest tests/test_conformance.py -k "serato"
pytest tests/test_conformance.py -k "traktor"
Unimplemented adapters (rekordbox, djay in Phase 16 execution; potentially
others) emit skip at collection time rather than fail. A green CI run
with skips is expected while adapter phases are still in flight.
Fixture format¶
Each capabilities.yaml looks like:
source: manual # or "generated" for auto-built fixtures
applies:
serato:
drops: ["rating", "bpm"] # fields Serato is allowed to lose
traktor:
drops: ["bpm"]
rekordbox:
drops: ["bpm"]
djay:
drops: ["bpm"]
The set of supported drop paths lives in
tests/test_conformance.py _mask() --
currently rating, cue_points.color, cue_points.memory, bpm,
duration_ms, album, play_count, color_rgb, cues, and identity
masks for track_id and file_path.
Adding a fixture¶
- Pick the next unused number (
04-<slug>). - Create
expected.opendj.json-- must validate againstopen-dj/schema/v0.2/open-dj.schema.json. - Create
capabilities.yamlwith adropslist per adapter. - Run
pytest -m conformanceand adjust the mask until it passes for every adapter you expect to support.
Adding an adapter¶
- Land
apps/adapters/<name>/implementing theAdapterProtocol inapps/open_dj/schema.py. (The formerapps/adapters/_shim/package was retired in phase 16-15 whenapps.open_djshipped its typed dataclass layer.) - Register the adapter in
tests/test_conformance.py_load_adapterwith a short name. - Add a per-adapter entry to the
applies:section of every fixturecapabilities.yamldescribing which fields it legitimately drops. - Re-run
pytest -m conformance; a passing run proves round-trip.