From a4fd847f7d3d8e0ef92c66ea1061fd31b4006549 Mon Sep 17 00:00:00 2001 From: Ragnor Comerford Date: Fri, 5 Jun 2026 12:46:24 +0200 Subject: [PATCH] test(cli): isolate OMNIGRAPH_CONFIG/XDG_CONFIG_HOME in the spawn helpers cli()/cli_process() set OMNIGRAPH_HOME but inherited OMNIGRAPH_CONFIG (which wins over HOME) and XDG_CONFIG_HOME, so a developer/CI with those exported got non-hermetic tests. env_remove both so the harness fully owns the config-resolution env; tests that exercise global-first still set OMNIGRAPH_CONFIG explicitly per-invocation. --- crates/omnigraph-cli/tests/support/mod.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/crates/omnigraph-cli/tests/support/mod.rs b/crates/omnigraph-cli/tests/support/mod.rs index 9c4d029..5e2e98d 100644 --- a/crates/omnigraph-cli/tests/support/mod.rs +++ b/crates/omnigraph-cli/tests/support/mod.rs @@ -25,13 +25,19 @@ fn isolated_omnigraph_home() -> &'static Path { pub fn cli() -> Command { let mut command = Command::cargo_bin("omnigraph").unwrap(); - command.env("OMNIGRAPH_HOME", isolated_omnigraph_home()); + command + .env("OMNIGRAPH_HOME", isolated_omnigraph_home()) + .env_remove("OMNIGRAPH_CONFIG") + .env_remove("XDG_CONFIG_HOME"); command } pub fn cli_process() -> StdCommand { let mut command = StdCommand::new(assert_cmd::cargo::cargo_bin("omnigraph")); - command.env("OMNIGRAPH_HOME", isolated_omnigraph_home()); + command + .env("OMNIGRAPH_HOME", isolated_omnigraph_home()) + .env_remove("OMNIGRAPH_CONFIG") + .env_remove("XDG_CONFIG_HOME"); command }