test: invented artists, albums and MusicBrainz ids in place of real ones
release / web (push) Failing after 1m16s
release / go (push) Successful in 1m48s
release / govulncheck (push) Successful in 20s
release / integration (push) Successful in 4m0s
release / android (push) Successful in 4m34s
release / Build signed APK (push) Successful in 5m9s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Skipped
release / Verify release artifacts (tag releases only) (push) Skipped

Test data and example comments named real artists, records and songs, and
carried real MusicBrainz ids. One mapping swaps them for invented ones
throughout (Fields of Ontario, Plastic Apes, Marlo Davies, ...), keeping
what each case tests: sort order, index letter, escaping, title keys,
artist-prefix stripping. A test username is no longer the operator's name.

The cover-art and Last.fm connection checks still query real releases;
they reach live services and need something that exists there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-25 13:21:34 -05:00
co-authored by Claude Opus 5.5
parent 4244d81dfd
commit 4e1807cbba
80 changed files with 570 additions and 570 deletions
+19 -19
View File
@@ -42,10 +42,10 @@ func newPool(t *testing.T) *pgxpool.Pool {
}
const (
gorillaz = "e21857d5-3256-4547-afb3-4b6ded592596"
demonDays = "0c4d5b5f-2f3c-3d31-9c4e-4b4f6b4c1a01"
demonDaysR = "1a2b3c4d-0000-4000-8000-000000000001"
demonDaysJ = "1a2b3c4d-0000-4000-8000-000000000002"
apes = "0a11ce00-0000-4000-8000-000000000001"
ghostNights = "0a11ce00-0000-4000-8000-000000000002"
ghostNightsR = "1a2b3c4d-0000-4000-8000-000000000001"
ghostNightsJ = "1a2b3c4d-0000-4000-8000-000000000002"
)
// fakeMB is a MusicBrainz with one album in two editions. down makes every
@@ -67,19 +67,19 @@ func newFakeMB(t *testing.T) *fakeMB {
}
q := r.URL.Query()
switch {
case r.URL.Path == "/release-group/"+demonDays:
_, _ = fmt.Fprintf(w, `{"id": %q, "title": "Demon Days", "primary-type": "Album", "first-release-date": "2005-05-11",
"artist-credit": [{"name": "Gorillaz", "artist": {"id": %q}}]}`, demonDays, gorillaz)
case r.URL.Path == "/release" && q.Get("release-group") == demonDays:
case r.URL.Path == "/release-group/"+ghostNights:
_, _ = fmt.Fprintf(w, `{"id": %q, "title": "Ghost Nights", "primary-type": "Album", "first-release-date": "2005-05-11",
"artist-credit": [{"name": "Plastic Apes", "artist": {"id": %q}}]}`, ghostNights, apes)
case r.URL.Path == "/release" && q.Get("release-group") == ghostNights:
_, _ = fmt.Fprintf(w, `{"release-count": 2, "releases": [
{"id": %q, "title": "Demon Days", "status": "Promotion", "date": "2005-04", "country": "JP",
{"id": %q, "title": "Ghost Nights", "status": "Promotion", "date": "2005-04", "country": "JP",
"media": [{"position": 1, "format": "CD", "tracks": [
{"position": 1, "number": "1", "title": "Intro", "length": 63000, "recording": {"id": "rec-intro"}}]}]},
{"id": %q, "title": "Demon Days", "status": "Official", "date": "2005-05-11", "country": "GB",
{"id": %q, "title": "Ghost Nights", "status": "Official", "date": "2005-05-11", "country": "GB",
"media": [{"position": 1, "format": "CD", "tracks": [
{"position": 1, "number": "1", "title": "Intro", "length": 63000, "recording": {"id": "rec-intro"}},
{"position": 2, "number": "2", "title": "Last Living Souls", "length": 190000, "recording": {"id": "rec-lls"}}]}]}
]}`, demonDaysJ, demonDaysR)
]}`, ghostNightsJ, ghostNightsR)
default:
w.WriteHeader(http.StatusNotFound)
}
@@ -100,17 +100,17 @@ func TestRefreshReleaseGroup_ReadsEditionsAndTrackLists_Integration(t *testing.T
q := dbq.New(pool)
// The group isn't held yet: it is looked up first.
if err := s.RefreshReleaseGroup(ctx, demonDays); err != nil {
if err := s.RefreshReleaseGroup(ctx, ghostNights); err != nil {
t.Fatal(err)
}
group, err := q.GetMBReleaseGroup(ctx, demonDays)
group, err := q.GetMBReleaseGroup(ctx, ghostNights)
if err != nil {
t.Fatal(err)
}
if group.Title != "Demon Days" || !group.ReleasesRefreshedAt.Valid {
if group.Title != "Ghost Nights" || !group.ReleasesRefreshedAt.Valid {
t.Fatalf("group = %+v", group)
}
tracks, err := q.ListMBReleaseTracksForGroup(ctx, demonDays)
tracks, err := q.ListMBReleaseTracksForGroup(ctx, ghostNights)
if err != nil {
t.Fatal(err)
}
@@ -123,15 +123,15 @@ func TestRefreshReleaseGroup_ReadsEditionsAndTrackLists_Integration(t *testing.T
lls = &tracks[i]
}
}
if lls == nil || lls.ReleaseMbid != demonDaysR || lls.LengthMs != 190000 {
if lls == nil || lls.ReleaseMbid != ghostNightsR || lls.LengthMs != 190000 {
t.Errorf("Last Living Souls = %+v", lls)
}
// Refreshing replaces rather than adds.
if err := s.RefreshReleaseGroup(ctx, demonDays); err != nil {
if err := s.RefreshReleaseGroup(ctx, ghostNights); err != nil {
t.Fatal(err)
}
if again, _ := q.ListMBReleaseTracksForGroup(ctx, demonDays); len(again) != 3 {
if again, _ := q.ListMBReleaseTracksForGroup(ctx, ghostNights); len(again) != 3 {
t.Errorf("after a refresh: %d tracks, want 3", len(again))
}
}
@@ -145,7 +145,7 @@ func TestRefreshReleaseGroup_UnknownAndUnreachable_Integration(t *testing.T) {
t.Errorf("unknown group: err = %v, want ErrNotFound", err)
}
mb.down.Store(true)
if err := s.RefreshReleaseGroup(ctx, demonDays); !errors.Is(err, musicbrainz.ErrUnreachable) {
if err := s.RefreshReleaseGroup(ctx, ghostNights); !errors.Is(err, musicbrainz.ErrUnreachable) {
t.Errorf("MusicBrainz down: err = %v, want ErrUnreachable", err)
}
}