From f72096526c52e05a7059ce7244292572dbffa770 Mon Sep 17 00:00:00 2001 From: jasonpatrickellykrause Date: Mon, 16 Nov 2026 15:18:33 -0700 Subject: [PATCH 1/2] Run the live Deezer tests on demand and weekly Tests tagged Live call Deezer and are skipped by the build workflow. This runs them from the Actions tab, weekly, and on pull requests that change this workflow, so they can be checked without a local .NET SDK. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/live-tests.yml | 39 ++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/live-tests.yml diff --git a/.github/workflows/live-tests.yml b/.github/workflows/live-tests.yml new file mode 100644 index 0000000..9e35232 --- /dev/null +++ b/.github/workflows/live-tests.yml @@ -0,0 +1,39 @@ +name: Live Tests +on: + # run by hand from the Actions tab + workflow_dispatch: + schedule: + # weekly, to catch Deezer changing an endpoint or data these tests depend on + - cron: '41 6 * * 1' + pull_request: + # only when this workflow changes; the build workflow covers everything else + paths: + - .github/workflows/live-tests.yml + +permissions: + contents: read + +env: + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true + DOTNET_CLI_TELEMETRY_OPTOUT: true + DOTNET_NOLOGO: true + DOTNET_VERSION: 8.0.405 + +jobs: + live: + runs-on: ubuntu-24.04 + steps: + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - name: Setup .NET + uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0 + with: + dotnet-version: ${{ env.DOTNET_VERSION }} + - name: Pin the SDK + run: | + echo '{"sdk":{"version": "${{ env.DOTNET_VERSION }}"}}' > ./global.json + - name: Run live tests + # these call Deezer's public API without an ARL; each failing case is listed in the log + run: dotnet test DeezNET.Tests -c Release --filter "Category=Live" --logger "console;verbosity=normal" From 9cd070c634c0f680b9e1da0afb0512fb39fb66b2 Mon Sep 17 00:00:00 2001 From: jasonpatrickellykrause Date: Mon, 16 Nov 2026 15:21:24 -0700 Subject: [PATCH 2/2] Check artist live tests by inclusion instead of exact match The test artist now has 33 tracks and 8 top tracks instead of 11 and 1. All originally expected IDs are still present, so the artist cases now check that known tracks are included. Track, album, and playlist cases still match exactly. Live tests also run on PRs that change DeezerURL. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/live-tests.yml | 4 +++- DeezNET.Tests/DeezerURLTests.cs | 21 ++++++++++++++++++--- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/.github/workflows/live-tests.yml b/.github/workflows/live-tests.yml index 9e35232..a221f57 100644 --- a/.github/workflows/live-tests.yml +++ b/.github/workflows/live-tests.yml @@ -6,9 +6,11 @@ on: # weekly, to catch Deezer changing an endpoint or data these tests depend on - cron: '41 6 * * 1' pull_request: - # only when this workflow changes; the build workflow covers everything else + # only when this workflow or the code the live tests cover changes; the build workflow covers everything else paths: - .github/workflows/live-tests.yml + - DeezNET/DeezerURL.cs + - DeezNET.Tests/DeezerURLTests.cs permissions: contents: read diff --git a/DeezNET.Tests/DeezerURLTests.cs b/DeezNET.Tests/DeezerURLTests.cs index 00d585a..bdba409 100644 --- a/DeezNET.Tests/DeezerURLTests.cs +++ b/DeezNET.Tests/DeezerURLTests.cs @@ -58,15 +58,12 @@ public void UnshortenURLTest(string shortened, string expected) unshort.ShouldBe(expected); } - // it's very possible for the Artist and ArtistTop values to change later // calls Deezer, so CI skips it with --filter "Category!=Live" [Trait("Category", "Live")] [Theory] [InlineData("https://www.deezer.com/en/track/13787884", new long[] { 13787884 })] [InlineData("https://www.deezer.com/en/album/509603971", new long[] { 2531592621, 2531592631, 2531592641, 2531592651, 2531592661 })] [InlineData("https://www.deezer.com/en/playlist/12668949561", new long[] { 2664944792, 856599752, 134784964 })] - [InlineData("https://www.deezer.com/en/artist/11696461", new long[] { 938758732, 938758742, 938758752, 938758762, 938758772, 938758782, 938758792, 938758802, 938758812, 938758822, 140025373 })] - [InlineData("https://www.deezer.com/en/artist/11696461/top_track", new long[] { 140025373 })] public async Task GetAssociatedTracksTest(string url, long[] associatedTracks) { DeezerClient cli = new(); @@ -76,5 +73,23 @@ public async Task GetAssociatedTracksTest(string url, long[] associatedTracks) actualTracks.ShouldBeEquivalentTo(associatedTracks); } + + // an artist's catalogue and top tracks grow as they release more, so only check that known tracks are still included + // calls Deezer, so CI skips it with --filter "Category!=Live" + [Trait("Category", "Live")] + [Theory] + [InlineData("https://www.deezer.com/en/artist/11696461", new long[] { 938758732, 938758742, 938758752, 938758762, 938758772, 938758782, 938758792, 938758802, 938758812, 938758822, 140025373 })] + [InlineData("https://www.deezer.com/en/artist/11696461/top_track", new long[] { 140025373 })] + public async Task GetAssociatedArtistTracksTest(string url, long[] includedTracks) + { + DeezerClient cli = new(); + var data = DeezerURL.Parse(url); + + long[] actualTracks = await data.GetAssociatedTracks(cli); + + actualTracks.ShouldBeUnique(); + foreach (long track in includedTracks) + actualTracks.ShouldContain(track); + } } } \ No newline at end of file