From 7b0c885abc7ce53c54efb4c19645f135cd277e3c Mon Sep 17 00:00:00 2001 From: Yannick Seeger Date: Thu, 5 Nov 2026 14:32:07 +0100 Subject: [PATCH] ci: the nightly checks YouTube Music's catalog, not its streams From GitHub's addresses, YouTube asks yt-dlp to sign in ("confirm you're not a bot"), so the stream test failed on the first nightly whatever cloofy does, and cargo stopped there before the catalog tests ran. The nightly runs tests/live.rs alone now. The stream test stays for runs from home; CONTRIBUTING.md says so. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/nightly.yml | 13 +++++-------- CONTRIBUTING.md | 4 +++- crates/cloofy-ytmusic/src/player/stream.rs | 3 ++- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index d9b8988..d292a69 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -1,8 +1,9 @@ name: Nightly -# YouTube Music as it answers today: the tests of cloofy-ytmusic that go online, which ordinary -# runs leave out. A failure here means InnerTube or YouTube's streams changed, and the parsers or -# the player need to catch up before people notice. +# YouTube Music as it answers today: cloofy-ytmusic's tests against the live catalog, which +# ordinary runs leave out. A failure here means InnerTube changed, and the parsers need to catch up +# before people notice. Streams aren't tested here: YouTube asks yt-dlp to sign in from GitHub's +# addresses, so that test only runs from home (see CONTRIBUTING.md). on: schedule: - cron: "17 4 * * *" @@ -27,11 +28,7 @@ jobs: - uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable with: toolchain: stable - # The latest yt-dlp, as people install it, and no JavaScript runtime: streams must resolve - # without one. - - name: Install yt-dlp - run: pipx install yt-dlp && yt-dlp --version - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2 with: key: nightly - - run: cargo test -p cloofy-ytmusic --locked -- --ignored + - run: cargo test -p cloofy-ytmusic --locked --test live -- --ignored diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1e277ac..ed32124 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -27,12 +27,14 @@ Some tests need a program and skip themselves without it. CI has them all and se | mpv | YouTube Music's player | `CLOOFY_REQUIRE_MPV=1` | | a D-Bus session bus (Linux) | the media controls over MPRIS | `CLOOFY_REQUIRE_DBUS=1`, under `dbus-run-session` | -Tests that go online are `#[ignore = "online"]`. The nightly workflow runs YouTube Music's against the live service, with the latest yt-dlp: +Tests that go online are `#[ignore = "online"]`. Run them with: ```sh cargo test -p cloofy-ytmusic -- --ignored ``` +The nightly workflow runs the catalog's (`--test live`) against the live service. The stream test, which asks yt-dlp for a song's audio, only works from a home connection: from GitHub's servers, YouTube asks yt-dlp to sign in. Run it before a release, ideally without deno on `PATH`, since cloofy should need no JavaScript runtime. + ## Fixes A fix comes with a test that fails without it: a scenario when it shows on screen, a unit test otherwise. diff --git a/crates/cloofy-ytmusic/src/player/stream.rs b/crates/cloofy-ytmusic/src/player/stream.rs index 2db7a2e..57d12a5 100644 --- a/crates/cloofy-ytmusic/src/player/stream.rs +++ b/crates/cloofy-ytmusic/src/player/stream.rs @@ -94,7 +94,8 @@ mod tests { assert!(valid_until("https://example.com/a.webm") > Instant::now() + Duration::from_secs(4 * 3600)); } - /// With yt-dlp as people install it; the nightly workflow has it without a JavaScript runtime. + /// With yt-dlp as people install it. Only from a home connection: YouTube asks yt-dlp to sign + /// in from datacenters, GitHub's included. #[tokio::test] #[ignore = "online"] async fn yt_dlp_finds_a_stream() {