Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions tests/cli_parity_contracts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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:?}");
Expand Down
5 changes: 5 additions & 0 deletions tests/stdio_and_cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<ChildStdin>,
Expand Down Expand Up @@ -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())
Expand Down
Loading