diff --git a/tests/cli_parity_contracts.rs b/tests/cli_parity_contracts.rs index 5764b2b..770f9fa 100644 --- a/tests/cli_parity_contracts.rs +++ b/tests/cli_parity_contracts.rs @@ -964,14 +964,23 @@ fn program_options_after_a_command_apply_or_ignore_like_commander() { // the command's own --verbose is never set, and runBridgeDoctor ignores its options anyway. fn bridge_doctor_accepts_and_ignores_verbose_like_commander() { let home = tempfile::tempdir().unwrap(); - let plain = cli(home.path(), &["bridge", "doctor"]); + // Doctor exits 1 on a host without Chrome. It only checks for an executable file, so any one + // stands in, and the test no longer depends on what the host has installed. + let cli = |args: &[&str]| { + command(home.path()) + .env("CHROME_PATH", env!("CARGO_BIN_EXE_industrious")) + .args(args) + .output() + .unwrap() + }; + let plain = cli(&["bridge", "doctor"]); assert_eq!(plain.status.code(), Some(0), "{}", stderr(&plain)); for args in [ &["bridge", "doctor", "--verbose"][..], &["bridge", "doctor", "-v"], &["--verbose", "bridge", "doctor"], ] { - let output = cli(home.path(), args); + let output = cli(args); assert_eq!(output.status.code(), plain.status.code(), "{args:?}"); assert_eq!(stdout(&output), stdout(&plain), "{args:?}"); assert_eq!(stderr(&output), stderr(&plain), "{args:?}"); diff --git a/tests/stdio_and_cli.rs b/tests/stdio_and_cli.rs index b46881c..fae3dd6 100644 --- a/tests/stdio_and_cli.rs +++ b/tests/stdio_and_cli.rs @@ -10,6 +10,10 @@ use tokio::{ process::{Child, ChildStdin, ChildStdout}, }; +// MCP refuses a browser consult before creating a session when the host has no Chrome, unless +// CHROME_PATH is nonempty. No test in this file launches the stand-in. +const CHROME_STAND_IN: &str = env!("CARGO_BIN_EXE_industrious"); + struct McpChild { child: Child, input: Option, @@ -583,6 +587,7 @@ impl McpChild { .env("HOME", home) .env("USERPROFILE", home) .env("ORACLE_HOME_DIR", home) + .env("CHROME_PATH", CHROME_STAND_IN) .current_dir(home) .stdin(Stdio::piped()) .stdout(Stdio::piped())