test(coverart): no-MBID enrich settles 'none' (per canonical behavior)
Operator decision: the enricher is canonical. No MBID still runs the provider chain (name-based providers — Deezer/Last.fm — resolve without an MBID); if every provider returns ErrNotFound the row settles cover/artist source 'none' at the current sources version (re-eligible only when the registered provider set changes). It does NOT skip-and-leave-NULL. The two _NoMBID_LeavesNull tests predated the name-based providers (0020 slice) and asserted the old skip→NULL contract. Updated: - TestEnrichArtist_NoMBID_SettlesNone: stub now returns ErrNotFound (realistic MBID-only-provider-with-empty-MBID), expect source 'none'. - TestEnrichAlbum_NoSidecarNoMBID_SettlesNone: empty registry → allWere404 stays true → expect 'none'. Last failing cluster from the CI-integration initiative; suite should now be fully green. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -121,7 +121,7 @@ func TestEnrichAlbum_SidecarFound(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestEnrichAlbum_NoSidecarNoMBID_LeavesNull(t *testing.T) {
|
||||
func TestEnrichAlbum_NoSidecarNoMBID_SettlesNone(t *testing.T) {
|
||||
pool := newPool(t)
|
||||
id, _ := seedAlbumWithTrack(t, pool, "NoMbid", "Artist", "")
|
||||
resetRegistryForTests() // deterministic empty registry (no provider can supply)
|
||||
@@ -134,8 +134,11 @@ func TestEnrichAlbum_NoSidecarNoMBID_LeavesNull(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatalf("get: %v", err)
|
||||
}
|
||||
if row.CoverArtSource != nil {
|
||||
t.Errorf("source = %v, want nil (NULL — eligible for retry on next scan)", row.CoverArtSource)
|
||||
// No sidecar, no MBID, no provider yields → the chain settles
|
||||
// 'none' (allWere404 stays true), version-stamped so it is only
|
||||
// re-tried when the registered provider set changes.
|
||||
if row.CoverArtSource == nil || *row.CoverArtSource != "none" {
|
||||
t.Errorf("source = %v, want 'none' (settled)", row.CoverArtSource)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user