mirror of
https://github.com/ModernRelay/omnigraph.git
synced 2026-07-03 02:51:04 +02:00
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.
This commit is contained in:
parent
922666fc70
commit
a4fd847f7d
1 changed files with 8 additions and 2 deletions
|
|
@ -25,13 +25,19 @@ fn isolated_omnigraph_home() -> &'static Path {
|
||||||
|
|
||||||
pub fn cli() -> Command {
|
pub fn cli() -> Command {
|
||||||
let mut command = Command::cargo_bin("omnigraph").unwrap();
|
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
|
command
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn cli_process() -> StdCommand {
|
pub fn cli_process() -> StdCommand {
|
||||||
let mut command = StdCommand::new(assert_cmd::cargo::cargo_bin("omnigraph"));
|
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
|
command
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue