test(coverart): fix registry-wipe + stale provider signature
Two distinct pre-existing test bugs in the last failing cluster: 1. newTestEnricher() called resetRegistryForTests() itself, wiping the fake providers callers Register() right before calling it (its own doc says callers register first and reconcile() picks them up). The ~8 TestEnrichArtist_* failures (source stayed NULL, no thumb written) all stem from reconcile() seeing an empty registry. Remove the internal reset; make every caller that lacked one own the registry lifecycle explicitly (resetRegistryForTests + t.Cleanup): SidecarFound, NoSidecarNoMBID, AlreadySidecar_NoOp, DrainsNullSourceOnly. 2. apiTestAlbumProvider.FetchAlbumCover had a stale signature (context, string) predating the AlbumRef refactor; it no longer satisfied coverart.AlbumCoverProvider, so the p.(AlbumCoverProvider) capability assertion failed and TestAdminListCoverSources got supports=[]. Fix the param to coverart.AlbumRef. Test-only. (A1/A2 were correct; they unmasked these. Any residual album-enricher semantics failures will be root-caused from the next clean run, not bundled speculatively.) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -27,7 +27,7 @@ func (p *apiTestAlbumProvider) DisplayName() string { re
|
||||
func (p *apiTestAlbumProvider) RequiresAPIKey() bool { return false }
|
||||
func (p *apiTestAlbumProvider) DefaultEnabled() bool { return true }
|
||||
func (p *apiTestAlbumProvider) Configure(_ coverart.ProviderSettings) error { return nil }
|
||||
func (p *apiTestAlbumProvider) FetchAlbumCover(_ context.Context, _ string) ([]byte, error) {
|
||||
func (p *apiTestAlbumProvider) FetchAlbumCover(_ context.Context, _ coverart.AlbumRef) ([]byte, error) {
|
||||
return []byte("img"), nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user