From 3a17633f352e26bce99d70d8258d972cdc8d5b86 Mon Sep 17 00:00:00 2001 From: Douwe Osinga Date: Fri, 9 Oct 2026 14:03:08 +0000 Subject: [PATCH] Use GOOSE_DISABLE_KEYRING when running tests (#12783) Co-authored-by: Claude Opus 5.5 --- .github/workflows/ci.yml | 13 +++++++------ AGENTS.md | 3 ++- crates/goose/src/providers/muse_code_def.rs | 3 ++- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 88f376c159..103dcdec76 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -99,16 +99,16 @@ jobs: - name: Install Dependencies run: | sudo apt update -y - sudo apt install -y libdbus-1-dev gnome-keyring libxcb1-dev + sudo apt install -y libdbus-1-dev libxcb1-dev - name: Build and Test run: | - gnome-keyring-daemon --components=secrets --daemonize --unlock <<< 'foobar' export CARGO_INCREMENTAL=0 cargo test --locked working-directory: crates env: RUST_MIN_STACK: 8388608 + GOOSE_DISABLE_KEYRING: 1 rust-build-lean: name: Build Lean ACP Binary @@ -187,6 +187,7 @@ jobs: cargo test -p goose-sdk --features uniffi --locked env: RUST_MIN_STACK: 8388608 + GOOSE_DISABLE_KEYRING: 1 kotlin-gdk-smoke-test: name: Test Kotlin GDK package @@ -219,7 +220,7 @@ jobs: - name: Install Dependencies run: | sudo apt update -y - sudo apt install -y libdbus-1-dev gnome-keyring libxcb1-dev + sudo apt install -y libdbus-1-dev libxcb1-dev - name: Cache Cargo artifacts uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 @@ -228,13 +229,13 @@ jobs: - name: Build and Test with ${{ matrix.tls-feature }} run: | - gnome-keyring-daemon --components=secrets --daemonize --unlock <<< 'foobar' export CARGO_INCREMENTAL=0 cargo test -p goose --no-default-features --features ${{ matrix.tls-feature }},code-mode,tree-sitter,live-voice,scheduler,platform-apps,chat-recall,acp-http cargo test -p goose-providers --no-default-features --features ${{ matrix.tls-feature }},live-websocket cargo test -p goose-cli --no-default-features --features ${{ matrix.tls-feature }},code-mode,tree-sitter,live-voice,scheduler,platform-apps,chat-recall,acp-http env: RUST_MIN_STACK: 8388608 + GOOSE_DISABLE_KEYRING: 1 rust-build-and-test-roaming: @@ -251,7 +252,7 @@ jobs: - name: Install Dependencies run: | sudo apt update -y - sudo apt install -y libdbus-1-dev gnome-keyring libxcb1-dev + sudo apt install -y libdbus-1-dev libxcb1-dev - name: Cache Cargo artifacts uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 @@ -260,13 +261,13 @@ jobs: - name: Build and Test with roaming run: | - gnome-keyring-daemon --components=secrets --daemonize --unlock <<< 'foobar' export CARGO_INCREMENTAL=0 cargo test -p goose-roaming cargo build -p goose-cli --features roaming cargo test -p goose-cli --features roaming --test roam_acp_client env: RUST_MIN_STACK: 8388608 + GOOSE_DISABLE_KEYRING: 1 rust-build-windows: name: Build Rust Project on Windows diff --git a/AGENTS.md b/AGENTS.md index 0c458a912d..53f778eb54 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -53,6 +53,7 @@ just release-binary # release binary ### Test ```bash +export GOOSE_DISABLE_KEYRING=1 # avoid system keyring prompts cargo test # all tests cargo test -p goose # specific crate cargo test --package goose --test mcp_integration_test @@ -91,7 +92,7 @@ Some workspace crates, including those that make up the GDK, are published to cr ### Run these only if the user has asked you to build/test your changes: ``` # 1. cargo build -# 2. cargo test -p +# 2. GOOSE_DISABLE_KEYRING=1 cargo test -p # 3. cargo clippy --all-targets -- -D warnings ``` diff --git a/crates/goose/src/providers/muse_code_def.rs b/crates/goose/src/providers/muse_code_def.rs index 84c8b03b59..ad84a4ee1e 100644 --- a/crates/goose/src/providers/muse_code_def.rs +++ b/crates/goose/src/providers/muse_code_def.rs @@ -162,7 +162,8 @@ fn muse_cli_auth_path() -> PathBuf { fn muse_cli_keychain_token() -> Option { #[cfg(feature = "system-keyring")] { - if std::env::var("MUSE_AUTH_PATH").is_ok() { + if std::env::var("MUSE_AUTH_PATH").is_ok() || std::env::var("GOOSE_DISABLE_KEYRING").is_ok() + { return None; }