test(likes): seed the second copy at its own path (#8126)
release / web (push) Successful in 1m39s
release / go (push) Successful in 2m3s
release / govulncheck (push) Successful in 19s
release / integration (push) Successful in 4m22s
release / android (push) Successful in 4m43s
release / Build signed APK (push) Successful in 5m41s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 40s
release / Verify release artifacts (tag releases only) (push) Skipped
release / web (push) Successful in 1m39s
release / go (push) Successful in 2m3s
release / govulncheck (push) Successful in 19s
release / integration (push) Successful in 4m22s
release / android (push) Successful in 4m43s
release / Build signed APK (push) Successful in 5m41s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 40s
release / Verify release artifacts (tag releases only) (push) Skipped
seedTrack derives the file path from the title, so two copies titled alike upserted into one row and the test compared a track with itself. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -105,7 +105,9 @@ func TestLikeTrack_AnswersEveryCopyOfTheSong(t *testing.T) {
|
|||||||
album := seedAlbum(t, pool, artist.ID, "Harbour Street", 1969)
|
album := seedAlbum(t, pool, artist.ID, "Harbour Street", 1969)
|
||||||
best := seedAlbum(t, pool, artist.ID, "Best Of", 1975)
|
best := seedAlbum(t, pool, artist.ID, "Best Of", 1975)
|
||||||
first := seedTrack(t, pool, album.ID, artist.ID, "Something", 3, 183_000)
|
first := seedTrack(t, pool, album.ID, artist.ID, "Something", 3, 183_000)
|
||||||
copied := seedTrack(t, pool, best.ID, artist.ID, "Something", 1, 183_000)
|
// seedTrack files each title at its own path, so the compilation copy
|
||||||
|
// gets a title of its own; song_id is what makes it the same song.
|
||||||
|
copied := seedTrack(t, pool, best.ID, artist.ID, "Something (Best Of)", 1, 183_000)
|
||||||
if _, err := pool.Exec(context.Background(), "UPDATE tracks SET song_id = $1 WHERE id = $2", first.ID, copied.ID); err != nil {
|
if _, err := pool.Exec(context.Background(), "UPDATE tracks SET song_id = $1 WHERE id = $2", first.ID, copied.ID); err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user