test: the album-copy fold test makes each album once, as UpsertAlbum folds only by MBID (#5401)
release / govulncheck (push) Successful in 15s
release / web (push) Successful in 1m25s
release / go (push) Successful in 1m38s
release / android (push) Successful in 5m8s
release / integration (push) Successful in 5m8s
release / Build signed APK (releases and dev) (push) Successful in 5m20s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 15s
release / Verify release artifacts (tag releases only) (push) Skipped

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-20 12:01:16 -04:00
co-authored by Claude Opus 5.5
parent 3ebd35e51d
commit 16a152b862
+9 -3
View File
@@ -234,11 +234,17 @@ func TestResolveDuplicates_FoldsAnAlbumsExtraCopyInACrossReleaseGroup_Integratio
if err != nil {
t.Fatal(err)
}
// UpsertAlbum folds only by MBID, so each album is made once.
albums := map[string]dbq.Album{}
track := func(album, name, format string) dbq.Track {
t.Helper()
a, err := q.UpsertAlbum(ctx, dbq.UpsertAlbumParams{Title: album, SortTitle: album, ArtistID: artist.ID})
if err != nil {
t.Fatal(err)
a, ok := albums[album]
if !ok {
var err error
if a, err = q.UpsertAlbum(ctx, dbq.UpsertAlbumParams{Title: album, SortTitle: album, ArtistID: artist.ID}); err != nil {
t.Fatal(err)
}
albums[album] = a
}
path := filepath.Join(dir, album, name)
if err := os.MkdirAll(filepath.Dir(path), 0o755); err != nil {