Test fixture: a throwaway iPod with no hardware #3
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
wokoman/ironpod#3
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What to build
Tests can stand up a real, empty iPod in a temporary directory and talk to it exactly as they would a mounted device — parse it, copy a track in, read the track back, remove it — with no hardware attached and nothing left behind afterwards.
Today the only constructor for a database is one that parses a mounted device, so every test that touches the copy or removal paths is
#[ignore]d behindIRONPOD_MOUNT. That means the code with the most destructive failure modes is the code CI never runs. This ticket removes that constraint; it is a prefactor, and the tickets that follow are unverifiable without it.libgpod can do this unaided: its initialisation entry point takes a mountpoint, seeds the model into a sysinfo file, creates the directory skeleton, adds a master playlist and writes an empty database. No physical device is involved anywhere in that path. It is already exposed through the existing bindings — no new FFI, no build changes.
Acceptance criteria
src/(integration tests intests/stay hardware-gated and are out of scope)#[ignore]Notes
Keep the helper private to the crate's own tests. There is a known community pattern for sharing fixtures with integration tests as well (a self dev-dependency behind a doc-hidden feature); it is deliberately not adopted here, because nothing in
tests/needs the fixture yet. Adopt it the day something does.libgpod's initialisation function leaks its database handle on one error path — when directory creation fails. It is upstream, in vendored code, and affects only failed fixture setup. Noted, not fixed here.
Blocked by