Require committed fixtures so save drift fails loudly #278

Merged
jqueuniet merged 0 commits from refs/pull/278/head into main 2026-07-20 07:59:21 +02:00
jqueuniet commented 2026-07-20 07:48:55 +02:00 (Migrated from codeberg.org)

Follow-up to the merged save-fixtures change. Now that save files are committed, tests that read them should fail loudly if a save drifts (renamed/moved/deleted), not silently skip — skip-on-missing was only ever for the uncommitted copyrighted assets a contributor may lack.

Mechanism

Adds require_fixture_bytes! / require_fixture_dir! / require_fixture_path! to dm2-test-fixtures — panic-on-missing counterparts to the skip-on-missing macros, with a "committed fixture … (drift?)" message.

Applied

  • Committed reads (saves under */saves/, dos-en-beta/DATA/SKSAVE*, Saves01–08/) → required (panic on missing).
  • Uncommitted asset reads (dungeon.dat, graphics.dat, resource forks, cinematics, instrument banks) → kept skipping, so mixed tests still skip cleanly in CI where those assets are absent.
  • Song goldens in dm2-music were already compile-time-required via include_str! (fails the build on drift); left as-is.

Verification

  • CI mirror (all uncommitted fixtures stashed out, full suite --no-fail-fast): all pass, zero panics — no asset wrongly required.
  • Drift sims: hidden committed save → its tests panic; hidden golden → dm2-music build fails.
  • Broad drift: hiding all 88 committed saves (assets present) → 136 tests red; conversion bites across the suite.
  • cargo fmt --all --check + clippy -D warnings clean.
Follow-up to the merged save-fixtures change. Now that save files are committed, tests that read them should **fail loudly** if a save drifts (renamed/moved/deleted), not silently skip — skip-on-missing was only ever for the *uncommitted* copyrighted assets a contributor may lack. ## Mechanism Adds `require_fixture_bytes!` / `require_fixture_dir!` / `require_fixture_path!` to `dm2-test-fixtures` — panic-on-missing counterparts to the skip-on-missing macros, with a "committed fixture … (drift?)" message. ## Applied - **Committed reads** (saves under `*/saves/`, `dos-en-beta/DATA/SKSAVE*`, `Saves01–08/`) → required (panic on missing). - **Uncommitted asset reads** (`dungeon.dat`, `graphics.dat`, resource forks, cinematics, instrument banks) → **kept skipping**, so mixed tests still skip cleanly in CI where those assets are absent. - **Song goldens** in `dm2-music` were already compile-time-required via `include_str!` (fails the *build* on drift); left as-is. ## Verification - **CI mirror** (all uncommitted fixtures stashed out, full suite `--no-fail-fast`): all pass, zero panics — no asset wrongly required. - **Drift sims**: hidden committed save → its tests panic; hidden golden → `dm2-music` build fails. - **Broad drift**: hiding all 88 committed saves (assets present) → 136 tests red; conversion bites across the suite. - `cargo fmt --all --check` + clippy `-D warnings` clean.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jqueuniet/dm2-tools!278
No description provided.