Add isolated integration coverage for the real playlistmanager store #50

Closed
opened 2026-09-05 22:42:26 +00:00 by tophattedcat · 0 comments
Owner

Problem

Sync tests replace beetsplug.playlistmanager with a fake module. Its PlaylistStore factory ignores the database path, and PlaylistDatabaseError is substituted with RuntimeError.

These useful unit tests cannot detect constructor-side mutations, snapshot behavior, actual transaction semantics, exception mismatches, or changes to the public playlistmanager API.

Proposed change

Keep the fast fake-based tests and add a small integration suite using a supported real playlistmanager version and temporary databases. Document a reproducible way to install/run the integration dependency.

Acceptance criteria

  • Exercise existing-target lookup and replacement through the real public API.
  • Confirm order and duplicates are preserved and playlist metadata is unchanged.
  • Cover dry-run reads, including the SQLite snapshot strategy.
  • Exercise a meaningful real-store failure and verify correct error translation.
  • Use isolated BEETSDIR, library, and playlist databases; never access the user's global beets setup.
  • Keep gateway calls network-free.
  • Document the supported/tested playlistmanager version or revision.

References: tests/test_sync.py:24-48, beetsplug/appleplaylists/sync.py:65-71,99-108,193-194. Audit finding 9 (testing gap).

## Problem Sync tests replace beetsplug.playlistmanager with a fake module. Its PlaylistStore factory ignores the database path, and PlaylistDatabaseError is substituted with RuntimeError. These useful unit tests cannot detect constructor-side mutations, snapshot behavior, actual transaction semantics, exception mismatches, or changes to the public playlistmanager API. ## Proposed change Keep the fast fake-based tests and add a small integration suite using a supported real playlistmanager version and temporary databases. Document a reproducible way to install/run the integration dependency. ## Acceptance criteria - Exercise existing-target lookup and replacement through the real public API. - Confirm order and duplicates are preserved and playlist metadata is unchanged. - Cover dry-run reads, including the SQLite snapshot strategy. - Exercise a meaningful real-store failure and verify correct error translation. - Use isolated BEETSDIR, library, and playlist databases; never access the user's global beets setup. - Keep gateway calls network-free. - Document the supported/tested playlistmanager version or revision. References: `tests/test_sync.py:24-48`, `beetsplug/appleplaylists/sync.py:65-71,99-108,193-194`. Audit finding 9 (testing gap).
Sign in to join this conversation.
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
coop/beets-appleplaylists#50
No description provided.