From c169549ef4b47aa607aed6d102b54b4d3058dbbd Mon Sep 17 00:00:00 2001 From: austinried <4966622+austinried@users.noreply.github.com> Date: Sun, 1 Nov 2026 03:12:01 +0000 Subject: [PATCH] ci: take integration test music from the Navidrome demo demo.subsonic.org no longer accepts the guest1 account, so the harness downloaded an XML error page and unzip failed before Gradle ran. Download the same three albums from demo.navidrome.org with the demo account, fetch each album's cover art into folder.jpg, and match the album title the files actually carry (Retroconnaissance, without the EP suffix). Bump the music cache key so stale copies from the old source are not reused. --- .github/workflows/ci.yml | 2 +- .../subsonic/SubsonicSourceIntegrationTest.kt | 4 ++-- .../subsonic/SubsonicWriteIntegrationTest.kt | 4 ++-- .../data/sync/PruneSyncIntegrationTest.kt | 2 +- tools/integration/servers.nu | 23 +++++++++++-------- 5 files changed, 20 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4896e9c5..535f63b7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,5 +50,5 @@ jobs: - uses: actions/cache@v6 with: path: .integration/music - key: integration-music-v1 + key: integration-music-v2 - run: nix develop .#integration --command nu tools/integration-test.nu diff --git a/app/src/integrationTest/kotlin/com/subtracks/data/source/subsonic/SubsonicSourceIntegrationTest.kt b/app/src/integrationTest/kotlin/com/subtracks/data/source/subsonic/SubsonicSourceIntegrationTest.kt index ec349229..554d7321 100644 --- a/app/src/integrationTest/kotlin/com/subtracks/data/source/subsonic/SubsonicSourceIntegrationTest.kt +++ b/app/src/integrationTest/kotlin/com/subtracks/data/source/subsonic/SubsonicSourceIntegrationTest.kt @@ -56,7 +56,7 @@ class SubsonicSourceIntegrationTest( assertNotNull(kosmo.starred) assertTrue(kosmo.created <= System.currentTimeMillis() / 1000) - assertNull(albums.first { it.name == "Retroconnaissance EP" }.starred) + assertNull(albums.first { it.name == "Retroconnaissance" }.starred) assertNull(albums.first { it.name == "I Don't Know What I'm Doing" }.starred) } @@ -92,7 +92,7 @@ class SubsonicSourceIntegrationTest( .filter { it.artistId == artists.first { a -> a.name == "Ugress" }.id } .map { it.name } .sorted() - assertEquals(listOf("Kosmonaut", "Retroconnaissance EP"), ugressAlbums) + assertEquals(listOf("Kosmonaut", "Retroconnaissance"), ugressAlbums) val bradAlbums = albums diff --git a/app/src/integrationTest/kotlin/com/subtracks/data/source/subsonic/SubsonicWriteIntegrationTest.kt b/app/src/integrationTest/kotlin/com/subtracks/data/source/subsonic/SubsonicWriteIntegrationTest.kt index aaf88689..9896fd20 100644 --- a/app/src/integrationTest/kotlin/com/subtracks/data/source/subsonic/SubsonicWriteIntegrationTest.kt +++ b/app/src/integrationTest/kotlin/com/subtracks/data/source/subsonic/SubsonicWriteIntegrationTest.kt @@ -22,7 +22,7 @@ class SubsonicWriteIntegrationTest( .albums() .toList() .flatten() - .first { it.name == "Retroconnaissance EP" } + .first { it.name == "Retroconnaissance" } source.setStar(StarType.Album, album.id, true) try { @@ -94,7 +94,7 @@ class SubsonicWriteIntegrationTest( .songs() .toList() .flatten() - .first { it.album == "Retroconnaissance EP" } + .first { it.album == "Retroconnaissance" } source.setStar(StarType.Song, song.id, true) try { diff --git a/app/src/integrationTest/kotlin/com/subtracks/data/sync/PruneSyncIntegrationTest.kt b/app/src/integrationTest/kotlin/com/subtracks/data/sync/PruneSyncIntegrationTest.kt index cd012390..d640662f 100644 --- a/app/src/integrationTest/kotlin/com/subtracks/data/sync/PruneSyncIntegrationTest.kt +++ b/app/src/integrationTest/kotlin/com/subtracks/data/sync/PruneSyncIntegrationTest.kt @@ -94,6 +94,6 @@ class PruneSyncIntegrationTest { private companion object { const val REMOVED_ALBUM_DIR = "197" - const val REMOVED_ALBUM_NAME = "Retroconnaissance EP" + const val REMOVED_ALBUM_NAME = "Retroconnaissance" } } diff --git a/tools/integration/servers.nu b/tools/integration/servers.nu index 482b8a8d..2b9f9508 100644 --- a/tools/integration/servers.nu +++ b/tools/integration/servers.nu @@ -12,11 +12,15 @@ export const LIB = ".integration/music" export const ports = [$NAV_PORT $GONIC_PORT $LMS_PORT $NC_PORT $PRUNE_PORT] const MUSIC = [ - { id: 197, name: "Ugress - Retroconnaissance EP", songs: 4 } - { id: 199, name: "Ugress - Kosmonaut", songs: 4 } - { id: 321, name: "Brad Sucks - I Don't Know What I'm Doing", songs: 12 } + { id: 197, remoteId: "7GZYpfn8wypaTR00LWeNI4", name: "Ugress - Retroconnaissance", songs: 4 } + { id: 199, remoteId: "5gMe1SlZZzuOMkRVWJaodV", name: "Ugress - Kosmonaut", songs: 4 } + { id: 321, remoteId: "0JnRLI5lo4eNU1pOePqfcG", name: "Brad Sucks - I Don't Know What I'm Doing", songs: 12 } ] +const MUSIC_DOWNLOAD = "https://demo.navidrome.org/rest/download.view?u=demo&p=demo&v=1.16.1&c=subtracks-test&id=" + +const MUSIC_ART = "https://demo.navidrome.org/rest/getCoverArt.view?u=demo&p=demo&v=1.16.1&c=subtracks-test&id=" + # Keep in step with TestServers.kt. export def test-servers [] { [ @@ -33,17 +37,18 @@ def song-count [dir: string] { } export def ensure-music [] { - if ($MUSIC | all {|m| (song-count $"($LIB)/($m.id)") == $m.songs }) { + if ($MUSIC | all {|m| (song-count $"($LIB)/($m.id)") == $m.songs and ($"($LIB)/($m.id)/folder.jpg" | path exists) }) { print $"using test music in ($LIB)" return } - print "downloading test music from demo.subsonic.org (one-time)" + print "downloading test music from demo.navidrome.org (one-time)" mkdir $LIB let tmp = (^mktemp -d | str trim) for m in $MUSIC { print $"($m.name)..." - ^curl -fsS -o $"($tmp)/($m.id).zip" $"http://demo.subsonic.org/rest/download.view?u=guest1&p=guest&v=1.13.0&c=subtracks-test&id=($m.id)" - ^unzip -q -o $"($tmp)/($m.id).zip" -d $"($LIB)/($m.id)" + ^curl -fsS -o $"($tmp)/($m.id).zip" $"($MUSIC_DOWNLOAD)($m.remoteId)" + ^unzip -j -q -o $"($tmp)/($m.id).zip" -d $"($LIB)/($m.id)" + ^curl -fsS -o $"($LIB)/($m.id)/folder.jpg" $"($MUSIC_ART)($m.remoteId)" } rm -rf $tmp } @@ -198,12 +203,12 @@ export def prepare-fixtures [server: record] { let albums = (poll "albums" {|| let items = (sub-get $base $user $pass "getAlbumList2" [["type" "newest"]] | get albumList2.album) - if (["Kosmonaut" "Retroconnaissance EP" "I Don't Know What I'm Doing"] | all {|name| $items | any {|i| $i.name == $name } }) { $items } else { null } + if (["Kosmonaut" "Retroconnaissance" "I Don't Know What I'm Doing"] | all {|name| $items | any {|i| $i.name == $name } }) { $items } else { null } }) let ugress = (named-id $artists "Ugress") let kosmo = (named-id $albums "Kosmonaut") - let retro = (named-id $albums "Retroconnaissance EP") + let retro = (named-id $albums "Retroconnaissance") let dunno = (named-id $albums "I Don't Know What I'm Doing") poll "album songs" {||