From 060a5f036f0e3047f474c540e866185baefa6df0 Mon Sep 17 00:00:00 2001 From: austinried <4966622+austinried@users.noreply.github.com> Date: Sun, 1 Nov 2026 03:19:17 +0000 Subject: [PATCH] ci: key the test music cache by the demo album ids The album id is the server id, so use it for the download, the local folder and the prune fixture instead of maintaining a separate remoteId mapping. The cache key moves to v3 because v2 may already hold folders named after the old local ids. --- .github/workflows/ci.yml | 2 +- .../data/sync/PruneSyncIntegrationTest.kt | 2 +- tools/integration/servers.nu | 15 ++++++++------- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 535f63b7..db86caff 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-v2 + key: integration-music-v3 - run: nix develop .#integration --command nu tools/integration-test.nu 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 d640662f..524432ea 100644 --- a/app/src/integrationTest/kotlin/com/subtracks/data/sync/PruneSyncIntegrationTest.kt +++ b/app/src/integrationTest/kotlin/com/subtracks/data/sync/PruneSyncIntegrationTest.kt @@ -93,7 +93,7 @@ class PruneSyncIntegrationTest { ?: error("$name is not set; run the integration harness (tools/integration-test.nu)") private companion object { - const val REMOVED_ALBUM_DIR = "197" + const val REMOVED_ALBUM_DIR = "7GZYpfn8wypaTR00LWeNI4" const val REMOVED_ALBUM_NAME = "Retroconnaissance" } } diff --git a/tools/integration/servers.nu b/tools/integration/servers.nu index 2b9f9508..b653989a 100644 --- a/tools/integration/servers.nu +++ b/tools/integration/servers.nu @@ -12,9 +12,9 @@ export const LIB = ".integration/music" export const ports = [$NAV_PORT $GONIC_PORT $LMS_PORT $NC_PORT $PRUNE_PORT] const MUSIC = [ - { 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 } + { id: "7GZYpfn8wypaTR00LWeNI4", name: "Ugress - Retroconnaissance", songs: 4 } + { id: "5gMe1SlZZzuOMkRVWJaodV", name: "Ugress - Kosmonaut", songs: 4 } + { id: "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=" @@ -46,9 +46,9 @@ export def ensure-music [] { let tmp = (^mktemp -d | str trim) for m in $MUSIC { print $"($m.name)..." - ^curl -fsS -o $"($tmp)/($m.id).zip" $"($MUSIC_DOWNLOAD)($m.remoteId)" + ^curl -fsS -o $"($tmp)/($m.id).zip" $"($MUSIC_DOWNLOAD)($m.id)" ^unzip -j -q -o $"($tmp)/($m.id).zip" -d $"($LIB)/($m.id)" - ^curl -fsS -o $"($LIB)/($m.id)/folder.jpg" $"($MUSIC_ART)($m.remoteId)" + ^curl -fsS -o $"($LIB)/($m.id)/folder.jpg" $"($MUSIC_ART)($m.id)" } rm -rf $tmp } @@ -168,8 +168,9 @@ export def start-prune [work: string] { let music = ($dir | path join "music") mkdir ($dir | path join "data") mkdir $music - ^cp -r $"((pwd) | path join $LIB)/197" $music - ^cp -r $"((pwd) | path join $LIB)/199" $music + for m in ($MUSIC | first 2) { + ^cp -r $"((pwd) | path join $LIB)/($m.id)" $music + } let daemon = (job spawn { ^navidrome --address 127.0.0.1 --port $PRUNE_PORT --musicfolder $music --datafolder ($dir | path join "data") --loglevel warn out+err> ($dir | path join "navidrome.log") }) let ready = (try {