From d375388514df8849c49c705b164feb07dff14f81 Mon Sep 17 00:00:00 2001 From: Ryan Duguid Date: Sat, 31 Oct 2026 01:05:13 +1100 Subject: [PATCH 1/2] Stop two tests depending on Chrome being installed bridge doctor and MCP browser admission both refuse when the host has no Chrome, so these tests failed on any machine without it. Give them a stand-in executable through CHROME_PATH; their assertions do not change. --- tests/cli_parity_contracts.rs | 13 +++++++++++-- tests/stdio_and_cli.rs | 5 +++++ 2 files changed, 16 insertions(+), 2 deletions(-) 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..a20140d 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. Admission +// only checks for an executable file, so any one stands in; no test here launches it. +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()) From f85983aac08eb6d31ddd09efc859c8bd05dd19be Mon Sep 17 00:00:00 2001 From: Ryan Duguid Date: Sat, 31 Oct 2026 01:16:15 +1100 Subject: [PATCH 2/2] Say what the MCP gate checks in the stand-in comment --- tests/stdio_and_cli.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/stdio_and_cli.rs b/tests/stdio_and_cli.rs index a20140d..fae3dd6 100644 --- a/tests/stdio_and_cli.rs +++ b/tests/stdio_and_cli.rs @@ -10,8 +10,8 @@ use tokio::{ process::{Child, ChildStdin, ChildStdout}, }; -// MCP refuses a browser consult before creating a session when the host has no Chrome. Admission -// only checks for an executable file, so any one stands in; no test here launches it. +// 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 {