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
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:
@@ -44,7 +44,7 @@ func TestDeezer_FetchArtistArt_Success(t *testing.T) {
|
||||
mux.HandleFunc("/search/artist", func(w http.ResponseWriter, r *http.Request) {
|
||||
imgURL := "http://" + r.Host + "/img/cp.jpg"
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
_, _ = w.Write([]byte(`{"data":[{"name":"Caravan Palace","picture_xl":"` + imgURL + `"}]}`))
|
||||
_, _ = w.Write([]byte(`{"data":[{"name":"Caravel Palace","picture_xl":"` + imgURL + `"}]}`))
|
||||
})
|
||||
mux.HandleFunc("/img/", func(w http.ResponseWriter, _ *http.Request) {
|
||||
w.Header().Set("Content-Type", "image/jpeg")
|
||||
@@ -52,7 +52,7 @@ func TestDeezer_FetchArtistArt_Success(t *testing.T) {
|
||||
})
|
||||
|
||||
p := newDeezerTestProvider(t, srv.URL)
|
||||
thumb, fanart, err := p.FetchArtistArt(context.Background(), ArtistRef{Name: "Caravan Palace"})
|
||||
thumb, fanart, err := p.FetchArtistArt(context.Background(), ArtistRef{Name: "Caravel Palace"})
|
||||
if err != nil {
|
||||
t.Fatalf("err = %v, want nil", err)
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ func TestLastfm_FetchArtistArt_ByMBID(t *testing.T) {
|
||||
}
|
||||
imgURL := "http://" + r.Host + "/img/a.jpg"
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
_, _ = w.Write([]byte(`{"artist":{"name":"Radiohead","image":[
|
||||
_, _ = w.Write([]byte(`{"artist":{"name":"Signal Tower","image":[
|
||||
{"#text":"` + imgURL + `","size":"extralarge"}
|
||||
]}}`))
|
||||
})
|
||||
@@ -64,8 +64,8 @@ func TestLastfm_FetchArtistArt_ByMBID(t *testing.T) {
|
||||
|
||||
p := newLastfmTestProvider(t, srv.URL+"/", "test-key")
|
||||
thumb, fanart, err := p.FetchArtistArt(context.Background(), ArtistRef{
|
||||
MBID: "a74b1b7f-71a5-4011-9441-d0b5e4122711",
|
||||
Name: "Radiohead",
|
||||
MBID: "0a11ce00-0000-4000-8000-000000000003",
|
||||
Name: "Signal Tower",
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("err = %v, want nil", err)
|
||||
@@ -92,22 +92,22 @@ func TestLastfm_FetchArtistArt_ByName(t *testing.T) {
|
||||
}
|
||||
imgURL := "http://" + r.Host + "/img/b.jpg"
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
_, _ = w.Write([]byte(`{"artist":{"name":"Björk","image":[
|
||||
_, _ = w.Write([]byte(`{"artist":{"name":"Höla","image":[
|
||||
{"#text":"` + imgURL + `","size":"large"}
|
||||
]}}`))
|
||||
})
|
||||
mux.HandleFunc("/img/", func(w http.ResponseWriter, _ *http.Request) {
|
||||
w.Header().Set("Content-Type", "image/jpeg")
|
||||
_, _ = w.Write([]byte("bjork-bytes"))
|
||||
_, _ = w.Write([]byte("hola-bytes"))
|
||||
})
|
||||
|
||||
p := newLastfmTestProvider(t, srv.URL+"/", "test-key")
|
||||
thumb, _, err := p.FetchArtistArt(context.Background(), ArtistRef{Name: "Björk"})
|
||||
thumb, _, err := p.FetchArtistArt(context.Background(), ArtistRef{Name: "Höla"})
|
||||
if err != nil {
|
||||
t.Fatalf("err = %v, want nil", err)
|
||||
}
|
||||
if string(thumb) != "bjork-bytes" {
|
||||
t.Errorf("thumb = %q, want bjork-bytes", thumb)
|
||||
if string(thumb) != "hola-bytes" {
|
||||
t.Errorf("thumb = %q, want hola-bytes", thumb)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -242,7 +242,7 @@ func TestLastfm_FetchAlbumCover_Success(t *testing.T) {
|
||||
mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||
imgURL := "http://" + r.Host + "/img/c.jpg"
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
_, _ = w.Write([]byte(`{"album":{"name":"OK Computer","image":[
|
||||
_, _ = w.Write([]byte(`{"album":{"name":"OK Calculator","image":[
|
||||
{"#text":"` + imgURL + `","size":"mega"}
|
||||
]}}`))
|
||||
})
|
||||
@@ -253,8 +253,8 @@ func TestLastfm_FetchAlbumCover_Success(t *testing.T) {
|
||||
|
||||
p := newLastfmTestProvider(t, srv.URL+"/", "test-key")
|
||||
body, err := p.FetchAlbumCover(context.Background(), AlbumRef{
|
||||
ArtistName: "Radiohead",
|
||||
AlbumTitle: "OK Computer",
|
||||
ArtistName: "Signal Tower",
|
||||
AlbumTitle: "OK Calculator",
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("err = %v, want nil", err)
|
||||
@@ -275,7 +275,7 @@ func TestLastfm_FetchAlbumCover_WithMBIDHint(t *testing.T) {
|
||||
}
|
||||
imgURL := "http://" + r.Host + "/img/d.jpg"
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
_, _ = w.Write([]byte(`{"album":{"name":"Kid A","image":[
|
||||
_, _ = w.Write([]byte(`{"album":{"name":"Kid B","image":[
|
||||
{"#text":"` + imgURL + `","size":"extralarge"}
|
||||
]}}`))
|
||||
})
|
||||
@@ -286,9 +286,9 @@ func TestLastfm_FetchAlbumCover_WithMBIDHint(t *testing.T) {
|
||||
|
||||
p := newLastfmTestProvider(t, srv.URL+"/", "test-key")
|
||||
body, err := p.FetchAlbumCover(context.Background(), AlbumRef{
|
||||
MBID: "b80a8a53-c9bf-3a3a-9a8c-bf76bf9a553a",
|
||||
ArtistName: "Radiohead",
|
||||
AlbumTitle: "Kid A",
|
||||
MBID: "0a11ce00-0000-4000-8000-000000000004",
|
||||
ArtistName: "Signal Tower",
|
||||
AlbumTitle: "Kid B",
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("err = %v, want nil", err)
|
||||
|
||||
@@ -21,7 +21,8 @@ type FetcherConfig struct {
|
||||
HTTPClient *http.Client // optional override for tests
|
||||
}
|
||||
|
||||
// Sample MBID used by TestConnection. Beatles' "Abbey Road" UK release.
|
||||
// Sample MBID used by TestConnection: a long-established release that the
|
||||
// Cover Art Archive has always held art for.
|
||||
const mbcaaTestSampleMBID = "f4b3df80-8a6c-3e87-b51e-5c1ee70a78ee"
|
||||
|
||||
// mbcaaProvider implements Provider, AlbumCoverProvider, and
|
||||
|
||||
@@ -31,9 +31,8 @@ const (
|
||||
// 5xx before giving up and surfacing ErrTransient.
|
||||
theAudioDBMaxRetries = 3
|
||||
|
||||
// theAudioDBTestSampleMBID is used by TestConnection. Pink Floyd's
|
||||
// "The Dark Side of the Moon" — a stable popular release verified
|
||||
// present in TheAudioDB at design time.
|
||||
// theAudioDBTestSampleMBID is used by TestConnection: a stable,
|
||||
// widely known release verified present in TheAudioDB at design time.
|
||||
theAudioDBTestSampleMBID = "f5093c06-23e3-404f-aeaa-40f72885ee3a"
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user