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:
@@ -10,7 +10,7 @@ import (
|
||||
// The group shapes the classifier tells apart.
|
||||
func TestClassifyDuplicateGroup(t *testing.T) {
|
||||
m := func(album, title string) ClassifyMember {
|
||||
return ClassifyMember{AlbumID: album, Title: title, ArtistName: "Gorillaz"}
|
||||
return ClassifyMember{AlbumID: album, Title: title, ArtistName: "Plastic Apes"}
|
||||
}
|
||||
cases := []struct {
|
||||
name string
|
||||
@@ -18,30 +18,30 @@ func TestClassifyDuplicateGroup(t *testing.T) {
|
||||
members []ClassifyMember
|
||||
want DuplicateClass
|
||||
}{
|
||||
{"Humanz: one album, one song twice", "exact",
|
||||
[]ClassifyMember{m("humanz", "Saturnz Barz"), m("humanz", "Saturnz Barz (Official Video)")}, ClassSameRelease},
|
||||
{"Mammalz: one album, one song twice", "exact",
|
||||
[]ClassifyMember{m("mammalz", "Neptunez Barz"), m("mammalz", "Neptunez Barz (Official Video)")}, ClassSameRelease},
|
||||
{"one album, video upload title with artist prefix", "acoustic",
|
||||
[]ClassifyMember{m("humanz", "Andromeda"), m("humanz", "Gorillaz - Andromeda (Official Audio)")}, ClassSameRelease},
|
||||
[]ClassifyMember{m("mammalz", "Cassiopeia"), m("mammalz", "Plastic Apes - Cassiopeia (Official Audio)")}, ClassSameRelease},
|
||||
{"one album, identical bytes under a version title: one file in two slots", "exact",
|
||||
[]ClassifyMember{m("www", "WWW"), m("www", "WWW (instrumental)")}, ClassMismatch},
|
||||
[]ClassifyMember{m("www", "XYZ"), m("www", "XYZ (instrumental)")}, ClassMismatch},
|
||||
{"one album, acoustic match, two versions named", "acoustic",
|
||||
[]ClassifyMember{m("moe", "Lovesick"), m("moe", "Lovesick (Instrumental)")}, ClassDistinct},
|
||||
[]ClassifyMember{m("moe", "Homesick"), m("moe", "Homesick (Instrumental)")}, ClassDistinct},
|
||||
{"Void: one album, one audio under three song titles", "acoustic",
|
||||
[]ClassifyMember{m("void", "Slimewar (into the void)"), m("void", "Void"), m("void", "Reach")}, ClassMismatch},
|
||||
[]ClassifyMember{m("void", "Slimeworld (into the void)"), m("void", "Void"), m("void", "Reach")}, ClassMismatch},
|
||||
{"a version named after a dash", "acoustic",
|
||||
[]ClassifyMember{m("andora", "Goodbye Yesterday"), m("andora", "Goodbye Yesterday - Instrumental Version")}, ClassDistinct},
|
||||
{"a dash that names no version", "acoustic",
|
||||
[]ClassifyMember{m("a", "Monday Chill - Part One"), m("a", "Monday Chill - Part Two")}, ClassMismatch},
|
||||
{"Slasher and Slasher II are not versions of one song", "acoustic",
|
||||
[]ClassifyMember{m("slasher", "Slasher"), m("slasher", "Slasher II")}, ClassMismatch},
|
||||
{"Big Me: the single and the album", "exact",
|
||||
[]ClassifyMember{m("single", "Big Me"), m("album", "Big Me")}, ClassCrossRelease},
|
||||
{"Big You: the single and the album", "exact",
|
||||
[]ClassifyMember{m("single", "Big You"), m("album", "Big You")}, ClassCrossRelease},
|
||||
{"remaster and featuring credits are one song", "acoustic",
|
||||
[]ClassifyMember{m("a", "Feel Good Inc. (2017 Remaster)"), m("b", "Feel Good Inc feat. De La Soul")}, ClassCrossRelease},
|
||||
[]ClassifyMember{m("a", "Feel Fine Ltd. (2017 Remaster)"), m("b", "Feel Fine Ltd feat. Del Mar Soul")}, ClassCrossRelease},
|
||||
{"a later release retitles the recording", "acoustic",
|
||||
[]ClassifyMember{m("coco", "Ragtime Cat"), m("single", "The Ragtime Cat")}, ClassCrossRelease},
|
||||
{"identical bytes on two albums under two titles", "exact",
|
||||
[]ClassifyMember{m("dookie", "F.O.D."), m("live", "F.O.D. (live)")}, ClassCrossRelease},
|
||||
[]ClassifyMember{m("cookie", "F.O.E."), m("live", "F.O.E. (live)")}, ClassCrossRelease},
|
||||
{"a lone copy", "exact", []ClassifyMember{m("a", "Song")}, ClassReview},
|
||||
}
|
||||
for _, tc := range cases {
|
||||
@@ -53,9 +53,9 @@ func TestClassifyDuplicateGroup(t *testing.T) {
|
||||
|
||||
func TestMatchTitleKey(t *testing.T) {
|
||||
cases := []struct{ title, artist, want string }{
|
||||
{"Saturnz Barz (Official Video)", "Gorillaz", "saturnzbarz"},
|
||||
{"Gorillaz - Saturnz Barz", "Gorillaz", "saturnzbarz"},
|
||||
{"Doin' It Right (Music Video) ft. Panda Bear", "Daft Punk", "doinitright"},
|
||||
{"Neptunez Barz (Official Video)", "Plastic Apes", "neptunezbarz"},
|
||||
{"Plastic Apes - Neptunez Barz", "Plastic Apes", "neptunezbarz"},
|
||||
{"Doin' It Twice (Music Video) ft. Koala Bear", "Deft Monks", "doinittwice"},
|
||||
{"Song [feat. X]", "", "song"},
|
||||
{"Song - Remastered 2009", "", "song"},
|
||||
{"Rock & Roll", "", "rockandroll"},
|
||||
@@ -79,12 +79,12 @@ func TestMatchTitleKey(t *testing.T) {
|
||||
// named differently must agree.
|
||||
func TestVersionWords(t *testing.T) {
|
||||
differ := [][2][2]string{
|
||||
{{"Suite-Pee", "/m/SOAD/Sugar/System of a Down - Sugar - 02 - Suite-Pee.mp3"},
|
||||
{"Suite-Pee", "/m/SOAD/Sugar/System of a Down - Sugar - 02 - Suite-Pee (Clean Version).mp3"}},
|
||||
{{"Luv (sic) Grand Finale", "/m/Nujabes/Hexalogy/Nujabes - Luv(sic) Hexalogy - 06 - Luv (sic) Grand Finale Instrumentals.mp3"},
|
||||
{"Luv (sic) Grand Finale", "/m/Nujabes/Hexalogy/0106 - Luvsic Grand Finale.m4a"}},
|
||||
{{"Charger", "/m/Gorillaz/Humanz/Gorillaz - Humanz - 08 - Charger - live in Cologne 2017.mp3"},
|
||||
{"Charger", "/m/Gorillaz/Humanz/CD 01/08 Charger.flac"}},
|
||||
{{"Suite-Tea", "/m/SOAC/Sugar/System of a Clown - Sugar - 02 - Suite-Tea.mp3"},
|
||||
{"Suite-Tea", "/m/SOAC/Sugar/System of a Clown - Sugar - 02 - Suite-Tea (Clean Version).mp3"}},
|
||||
{{"Hush (sic) Grand Finale", "/m/Sebanuj/Heptalogy/Sebanuj - Hush(sic) Heptalogy - 06 - Hush (sic) Grand Finale Instrumentals.mp3"},
|
||||
{"Hush (sic) Grand Finale", "/m/Sebanuj/Heptalogy/0106 - Hushsic Grand Finale.m4a"}},
|
||||
{{"Dynamo", "/m/Plastic Apes/Mammalz/Plastic Apes - Mammalz - 08 - Dynamo - live in Cologne 2017.mp3"},
|
||||
{"Dynamo", "/m/Plastic Apes/Mammalz/CD 01/08 Dynamo.flac"}},
|
||||
}
|
||||
for _, p := range differ {
|
||||
a, b := versionWords(p[0][0], p[0][1]), versionWords(p[1][0], p[1][1])
|
||||
@@ -93,12 +93,12 @@ func TestVersionWords(t *testing.T) {
|
||||
}
|
||||
}
|
||||
agree := [][2][2]string{
|
||||
{{"Heat Waves (Shakur Ahmad Remix)", "/m/GA/Glass Animals - Dreamland Deluxe - 02 - Heat Waves (Shakur Ahmad Remix).mp3"},
|
||||
{"Heat Waves (Shakur Ahmad Remix)", "/m/GA/02. Heat Waves (Shakur Ahmad Remix).flac"}},
|
||||
{{"Luv (sic) Instrumentals", "/m/Nujabes/0201 - Luvsic instrumentals.m4a"},
|
||||
{"Luv (sic) Instrumentals", "/m/Nujabes/Nujabes - Luv(sic) Hexalogy - 01 - Luv (sic) Instrumentals.mp3"}},
|
||||
{{"Henrietta", "/m/The Fratellis - Costello Music - 01 - Henrietta.mp3"},
|
||||
{"Henrietta", "/m/The Fratellis - Costello Music - 01 - Henrietta.flac"}},
|
||||
{{"Heat Lines (Tariq Amal Remix)", "/m/GA/Glass Insects - Dreamland Deluxe - 02 - Heat Lines (Tariq Amal Remix).mp3"},
|
||||
{"Heat Lines (Tariq Amal Remix)", "/m/GA/02. Heat Lines (Tariq Amal Remix).flac"}},
|
||||
{{"Hush (sic) Instrumentals", "/m/Sebanuj/0201 - Hushsic instrumentals.m4a"},
|
||||
{"Hush (sic) Instrumentals", "/m/Sebanuj/Sebanuj - Hush(sic) Heptalogy - 01 - Hush (sic) Instrumentals.mp3"}},
|
||||
{{"Henrietta Mae", "/m/The Fratellinis - Castello Music - 01 - Henrietta Mae.mp3"},
|
||||
{"Henrietta Mae", "/m/The Fratellinis - Castello Music - 01 - Henrietta Mae.flac"}},
|
||||
}
|
||||
for _, p := range agree {
|
||||
a, b := versionWords(p[0][0], p[0][1]), versionWords(p[1][0], p[1][1])
|
||||
@@ -113,11 +113,11 @@ func TestWrongSlots(t *testing.T) {
|
||||
copies := func(titles ...string) []slotCopy {
|
||||
out := make([]slotCopy, len(titles))
|
||||
for i, title := range titles {
|
||||
out[i] = slotCopy{Title: title, Artist: "Savant", DurationMs: 220000}
|
||||
out[i] = slotCopy{Title: title, Artist: "Savanta", DurationMs: 220000}
|
||||
}
|
||||
return out
|
||||
}
|
||||
void := []dbq.MbReleaseTrack{track("Slimewar (Into the Void)", 300000), track("Reach", 281000), track("Void", 220500)}
|
||||
void := []dbq.MbReleaseTrack{track("Slimeworld (Into the Void)", 300000), track("Reach", 281000), track("Void", 220500)}
|
||||
cases := []struct {
|
||||
name string
|
||||
copies []slotCopy
|
||||
@@ -126,17 +126,17 @@ func TestWrongSlots(t *testing.T) {
|
||||
losers []int
|
||||
ok bool
|
||||
}{
|
||||
{"Void: the file is Void's; the other two slots are other songs", copies("Slimewar (into the void)", "Void", "Reach"), void, 1, []int{0, 2}, true},
|
||||
{"Void: the file is Void's; the other two slots are other songs", copies("Slimeworld (into the void)", "Void", "Reach"), void, 1, []int{0, 2}, true},
|
||||
{"no track list", copies("Void", "Reach"), nil, -1, nil, false},
|
||||
{"a title the track list does not hold", copies("Void", "Bonus"), void, -1, nil, false},
|
||||
{"Killjoy held twice beside Dreamland's slot", []slotCopy{
|
||||
{Title: "Dreamland", Artist: "Fox Stevenson", DurationMs: 167000},
|
||||
{Title: "Killjoy", Artist: "Fox Stevenson", DurationMs: 167000},
|
||||
{Title: "Killjoy", Artist: "Fox Stevenson", DurationMs: 166000},
|
||||
{Title: "Dreamland", Artist: "Lynx Morrison", DurationMs: 167000},
|
||||
{Title: "Killjoy", Artist: "Lynx Morrison", DurationMs: 167000},
|
||||
{Title: "Killjoy", Artist: "Lynx Morrison", DurationMs: 166000},
|
||||
}, []dbq.MbReleaseTrack{track("Killjoy", 166500), track("Dreamland", 214000)}, 1, []int{0}, true},
|
||||
{"two slots fit the file", copies("Void", "Reach"), []dbq.MbReleaseTrack{track("Void", 220000), track("Reach", 221500)}, -1, nil, false},
|
||||
{"a slot near but not within the fit", copies("Void", "Reach"), []dbq.MbReleaseTrack{track("Void", 220000), track("Reach", 226000)}, -1, nil, false},
|
||||
{"no slot fits, and every slot is clearly another song's", copies("Reach", "Slimewar (into the void)"), void, -1, []int{0, 1}, true},
|
||||
{"no slot fits, and every slot is clearly another song's", copies("Reach", "Slimeworld (into the void)"), void, -1, []int{0, 1}, true},
|
||||
{"no slot fits, but one is near", copies("Void", "Reach"), []dbq.MbReleaseTrack{track("Void", 226000), track("Reach", 281000)}, -1, nil, false},
|
||||
{"an unknown length counts for nothing", copies("Void", "Reach"), []dbq.MbReleaseTrack{track("Void", 220000), track("Reach", 0)}, -1, nil, false},
|
||||
}
|
||||
@@ -149,15 +149,15 @@ func TestWrongSlots(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// The lengths cannot place a recording filed as several songs (Savant's
|
||||
// Mortals, cut to each slot's length); what AcoustID calls it can.
|
||||
// The lengths cannot place a recording filed as several songs (Savanta's
|
||||
// Immortals, cut to each slot's length); what AcoustID calls it can.
|
||||
func TestNamedCopies(t *testing.T) {
|
||||
track := func(title string, ms int32, rec string) dbq.MbReleaseTrack {
|
||||
return dbq.MbReleaseTrack{Title: title, LengthMs: ms, RecordingMbid: rec}
|
||||
}
|
||||
copies := []slotCopy{
|
||||
{Title: "Tormentor", Artist: "The Wombats", DurationMs: 220000},
|
||||
{Title: "Record Shop", Artist: "The Wombats", DurationMs: 181000},
|
||||
{Title: "Tormentor", Artist: "The Wallabies", DurationMs: 220000},
|
||||
{Title: "Record Shop", Artist: "The Wallabies", DurationMs: 181000},
|
||||
}
|
||||
album := []dbq.MbReleaseTrack{
|
||||
track("Tormentor", 221000, "rec-tormentor"), track("Record Shop", 180000, "rec-record-shop"), track("Ice Cream", 200000, "rec-ice"),
|
||||
|
||||
Reference in New Issue
Block a user