diff --git a/tests/functional/iam/dry_run.rs b/tests/functional/iam/dry_run.rs index bd4dbdb..3a43a96 100644 --- a/tests/functional/iam/dry_run.rs +++ b/tests/functional/iam/dry_run.rs @@ -1,10 +1,10 @@ -use crate::common::cli_helpers::ags; +use crate::common::cli_helpers::ags_isolated; use predicates::prelude::*; /// --dry-run prints the HTTP method, path, and auth header without making a real request #[test] fn test_dry_run_shows_request() { - ags() + ags_isolated() .args([ "--dry-run", "--namespace", @@ -23,7 +23,7 @@ fn test_dry_run_shows_request() { /// --dry-run produces no stderr output so stdout can be cleanly piped for inspection #[test] fn test_dry_run_no_status_on_stderr() { - ags() + ags_isolated() .args([ "--dry-run", "--namespace", diff --git a/tests/scope_version.rs b/tests/scope_version.rs index aeaad68..c8e2d3c 100644 --- a/tests/scope_version.rs +++ b/tests/scope_version.rs @@ -25,11 +25,18 @@ impl CmdOutput { } /// Spawn the `ags` binary with the given args and return its output. +/// +/// Uses a unique `AGS_HOME` per call so tests don't share profile state +/// with each other or with the host machine's real config. fn cli(args: &[&str]) -> CmdOutput { + let unique_dir = std::env::temp_dir() + .join(format!("ags-test-{}", std::process::id())) + .join(format!("{:?}", std::thread::current().id())); let inner = Command::cargo_bin("ags") .unwrap() .args(args) .env("AGS_NO_KEYCHAIN", "1") + .env("AGS_HOME", unique_dir) .output() .expect("failed to execute ags binary"); CmdOutput { inner } diff --git a/tests/security/config_permissions.rs b/tests/security/config_permissions.rs index dc39f5a..18ae23a 100644 --- a/tests/security/config_permissions.rs +++ b/tests/security/config_permissions.rs @@ -1,3 +1,4 @@ +#[cfg(unix)] use ags::runtime::config::ProfileConfig; // ── Config file permissions (Unix only) ──