tests and comments: invented names for real songs and artists the sweep found (#8209)
release / go (push) Successful in 1m57s
release / web (push) Successful in 1m8s
release / integration (push) Successful in 2m42s
release / govulncheck (push) Successful in 20s
release / android (push) Successful in 1m53s
release / Build signed APK (push) Successful in 1m43s
release / Build + push container image (push) Successful in 24s
release / go (push) Successful in 1m57s
release / web (push) Successful in 1m8s
release / integration (push) Successful in 2m42s
release / govulncheck (push) Successful in 20s
release / android (push) Successful in 1m53s
release / Build signed APK (push) Successful in 1m43s
release / Build + push container image (push) Successful in 24s
The Title Case sweep of the export found real song titles and artists in fixtures and comments: three songs from one real album, a real song in a release fixture, real artists in a tag test, a link test and a genre test, a real song as a notification example, and a count from a real folder. Each is now invented. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -29,9 +29,9 @@ func TestGroupMissingByDirectory(t *testing.T) {
|
||||
|
||||
t.Run("consecutive rows in one directory collapse to one group", func(t *testing.T) {
|
||||
groups := groupMissingByDirectory([]dbq.ListMissingTracksRow{
|
||||
missingRow("/music/Lincoln Yard/Minutes to Noon", "Given Up", base),
|
||||
missingRow("/music/Lincoln Yard/Minutes to Noon", "Leave Out All the Rest", base),
|
||||
missingRow("/music/Lincoln Yard/Minutes to Noon", "Bleed It Out", base),
|
||||
missingRow("/music/Lincoln Yard/Minutes to Noon", "Paper Wings", base),
|
||||
missingRow("/music/Lincoln Yard/Minutes to Noon", "Leave the Lights On", base),
|
||||
missingRow("/music/Lincoln Yard/Minutes to Noon", "Ring It Out", base),
|
||||
})
|
||||
|
||||
if len(groups) != 1 {
|
||||
|
||||
@@ -39,8 +39,8 @@ type suspectTrackView struct {
|
||||
}
|
||||
|
||||
// suspectGroupView is a folder's worth of flagged tracks. As on the
|
||||
// missing-files report, the folder is the unit of decision: Mammalz was 62 rows
|
||||
// in one folder, which is one problem to look at, not 62.
|
||||
// missing-files report, the folder is the unit of decision: sixty flagged rows
|
||||
// in one folder are one problem to look at, not sixty.
|
||||
type suspectGroupView struct {
|
||||
Directory string `json:"directory"`
|
||||
Tracks []suspectTrackView `json:"tracks"`
|
||||
|
||||
@@ -41,8 +41,8 @@ func TestHandleListSuspectSources_Integration(t *testing.T) {
|
||||
if err := json.Unmarshal(w.Body.Bytes(), &resp); err != nil {
|
||||
t.Fatalf("decode: %v", err)
|
||||
}
|
||||
// Three present files carry a marker. "Chain Reaction" and "Busted and
|
||||
// Blue" carry none, and the lyric video's file is missing.
|
||||
// Three present files carry a marker. "Chain Reaction" and "Bruised and
|
||||
// Grey" carry none, and the lyric video's file is missing.
|
||||
if resp.Total != 3 {
|
||||
t.Errorf("total = %d, want 3", resp.Total)
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ func newFakeMB(t *testing.T) *fakeMB {
|
||||
{"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"}}]}]}
|
||||
{"position": 2, "number": "2", "title": "Last Lit Rooms", "length": 190000, "recording": {"id": "rec-lls"}}]}]}
|
||||
]}`, ghostNightsJ, ghostNightsR)
|
||||
default:
|
||||
w.WriteHeader(http.StatusNotFound)
|
||||
@@ -97,7 +97,7 @@ func TestRefreshReleaseGroup_ReadsEditionsAndTrackLists_Integration(t *testing.T
|
||||
}
|
||||
}
|
||||
if lls == nil || lls.ReleaseMbid != ghostNightsR || lls.LengthMs != 190000 {
|
||||
t.Errorf("Last Living Souls = %+v", lls)
|
||||
t.Errorf("Last Lit Rooms = %+v", lls)
|
||||
}
|
||||
|
||||
// Refreshing replaces rather than adds.
|
||||
|
||||
@@ -168,7 +168,7 @@ var genreAcronyms = map[string]string{
|
||||
// how "Children's Music" became "Children'S Music".
|
||||
//
|
||||
// Deliberately a fixed list rather than "lowercase whatever follows an
|
||||
// apostrophe": that broader rule would break "O'Brien" and "D'Angelo", which
|
||||
// apostrophe": that broader rule would break "O'Brien" and "D'Arcy", which
|
||||
// are correctly capitalised after the apostrophe.
|
||||
var contractionSuffixes = map[string]bool{
|
||||
"s": true, "t": true, "re": true, "ll": true, "ve": true, "d": true, "m": true,
|
||||
|
||||
@@ -345,7 +345,7 @@ func TestTrueUpCasing(t *testing.T) {
|
||||
// and must keep their capital — this is why the suffix list is fixed
|
||||
// rather than "lowercase anything after an apostrophe".
|
||||
{"irish surname", "O'Brien Core", "O'Brien Core"},
|
||||
{"french elision", "D'Angelo Soul", "D'Angelo Soul"},
|
||||
{"french elision", "D'Arcy Soul", "D'Arcy Soul"},
|
||||
|
||||
// Ordinary genres pass through untouched. Case is otherwise exposed as
|
||||
// the file says it — "Rock" vs "rock" stays a real distinction.
|
||||
|
||||
@@ -66,8 +66,8 @@ func hashRow(n byte, path string) dbq.FindMissingTrackByAudioHashRow {
|
||||
func audioHash(b byte) []byte { return bytes.Repeat([]byte{b}, 32) }
|
||||
|
||||
const (
|
||||
oldPath = "/music/Lincoln Yard/Minutes to Noon/02 - Bleed It Out.mp3"
|
||||
newPath = "/music/Lincoln Yard/Minutes to Noon/04 - Bleed It Out.mp3"
|
||||
oldPath = "/music/Lincoln Yard/Minutes to Noon/02 - Ring It Out.mp3"
|
||||
newPath = "/music/Lincoln Yard/Minutes to Noon/04 - Ring It Out.mp3"
|
||||
)
|
||||
|
||||
// A new file is adopted as a missing track that moved when its recording MBID
|
||||
|
||||
@@ -216,9 +216,9 @@ func TestScanner_AdoptsMovedFile_Integration(t *testing.T) {
|
||||
|
||||
root := t.TempDir()
|
||||
const movedMBID = "11111111-2222-3333-4444-555555555555"
|
||||
movedFrom := filepath.Join(root, "artistM/albumM/04 - Bleed It Out.mp3")
|
||||
movedFrom := filepath.Join(root, "artistM/albumM/04 - Ring It Out.mp3")
|
||||
writeTestMP3(t, movedFrom, map[string]string{
|
||||
"TIT2": "Bleed It Out", "TPE1": "Artist M", "TALB": "Album M", "TRCK": "4",
|
||||
"TIT2": "Ring It Out", "TPE1": "Artist M", "TALB": "Album M", "TRCK": "4",
|
||||
// dhowden surfaces TXXX as a Comm whose Description is the Picard tag
|
||||
// name; "MusicBrainz Track Id" is mbz.Recording.
|
||||
"TXXX": "MusicBrainz Track Id\x00" + movedMBID,
|
||||
@@ -246,7 +246,7 @@ func TestScanner_AdoptsMovedFile_Integration(t *testing.T) {
|
||||
}
|
||||
|
||||
// Renumber the file, exactly as a tag editor would.
|
||||
movedTo := filepath.Join(root, "artistM/albumM/02 - Bleed It Out.mp3")
|
||||
movedTo := filepath.Join(root, "artistM/albumM/02 - Ring It Out.mp3")
|
||||
if err := os.Rename(movedFrom, movedTo); err != nil {
|
||||
t.Fatalf("rename: %v", err)
|
||||
}
|
||||
|
||||
@@ -239,7 +239,7 @@ func TestResolveDuplicates_KeepsEveryCopyInACrossReleaseGroup_Integration(t *tes
|
||||
return tr
|
||||
}
|
||||
flac := track("Mammalz", "04 Neptunez Barz.flac", "flac")
|
||||
mp3 := track("Mammalz", "06 Neptunez Barz (feat. Popcaan).mp3", "mp3")
|
||||
mp3 := track("Mammalz", "06 Neptunez Barz (feat. Popkern).mp3", "mp3")
|
||||
single := track("Neptunez Barz", "01 Neptunez Barz.mp3", "mp3")
|
||||
var groupID pgtype.UUID
|
||||
if err := pool.QueryRow(ctx,
|
||||
|
||||
@@ -33,8 +33,8 @@ type Payload struct {
|
||||
// Count is the coalesced kinds' running total since the notice was last
|
||||
// read.
|
||||
Count int64 `json:"count,omitempty"`
|
||||
// Items name what Count counts, one each, newest first: "Glasshouse – Buddy
|
||||
// Holly". A coalesced update puts its own in front and keeps ten,
|
||||
// Items name what Count counts, one each, newest first: "Glasshouse – Lucky
|
||||
// Penny". A coalesced update puts its own in front and keeps ten,
|
||||
// so the body can say which, not only how many.
|
||||
Items []string `json:"items,omitempty"`
|
||||
// Detail is free text: scan_failed's error message. Rows from before
|
||||
|
||||
@@ -65,7 +65,7 @@ func TestReadFrom_TrimsAStrayZeroAfterAUTF16Frame(t *testing.T) {
|
||||
// the value's byte order mark, the other at the end of the frame.
|
||||
func TestReadFrom_DropsTheStrayZeroAfterEachStringOfACustomField(t *testing.T) {
|
||||
name := append(utf16BE("ARTISTS"), 0)
|
||||
value := utf16BE("Saint Motel")
|
||||
value := utf16BE("Saint Hostel")
|
||||
value = append(value[1:len(value)-2], 0) // no encoding byte, no terminator, a stray zero
|
||||
strayField := append(name, value...)
|
||||
file := id3(4,
|
||||
@@ -81,7 +81,7 @@ func TestReadFrom_DropsTheStrayZeroAfterEachStringOfACustomField(t *testing.T) {
|
||||
t.Fatalf("ReadFrom: %v", err)
|
||||
}
|
||||
field, ok := meta.Raw()["TXXX"].(*tag.Comm)
|
||||
if !ok || field.Description != "ARTISTS" || field.Text != "Saint Motel" {
|
||||
if !ok || field.Description != "ARTISTS" || field.Text != "Saint Hostel" {
|
||||
t.Fatalf("TXXX = %#v", meta.Raw()["TXXX"])
|
||||
}
|
||||
if meta.Genre() != "Pop" || meta.Title() != "Fine Wine" {
|
||||
|
||||
Reference in New Issue
Block a user