From 3f95a12aa8c2255b41e29b103550becd9d704e5a Mon Sep 17 00:00:00 2001 From: Abdul Wahab Date: Fri, 11 Sep 2026 01:49:57 +0500 Subject: [PATCH] tests: keep the sh-scripted lane tests off Windows The cold-project test boots through the CLI, whose detached helper inherits the test's stdout pipe on Windows and keeps output() from ever returning; it and the opener-guard section also stand a sh script in for the browser. Both run on unix only now; the verdict checks that need no script stay on every platform. Written with AI assistance (Claude). Co-Authored-By: Claude Fable 5 --- crates/cli/tests/agent_target.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/crates/cli/tests/agent_target.rs b/crates/cli/tests/agent_target.rs index 280fbf6c5..7ef4da99f 100644 --- a/crates/cli/tests/agent_target.rs +++ b/crates/cli/tests/agent_target.rs @@ -779,6 +779,10 @@ fn live_generate_collects_its_own_generate_event_and_reply_then_poll_returns_the assert!(event["_instructions"].as_str().unwrap().contains("steer_done"), "{event}"); } +/// Unix only: the boot spawns the helper detached, and on Windows that +/// grandchild inherits this test's stdout pipe, so `output()` never returns; +/// the stand-in browser is also a `sh` script. +#[cfg(unix)] #[test] fn live_generate_boot_and_open_run_the_lane_from_a_cold_project() { // No helper running: --boot starts one (the lane's flags), --open hands the @@ -892,7 +896,10 @@ fn live_generate_asks_the_harness_to_open_the_page_instead_of_a_second_browser() assert_eq!(none["error"], serde_json::json!("no_dev_server"), "{none}"); assert!(none["_instructions"].as_str().unwrap().contains("preview_start"), "{none}"); // `--open` on a harness with its own browser launches nothing: BROWSER - // names a script that would record the launch, and it never runs. + // names a script that would record the launch, and it never runs. The + // stand-in opener is a `sh` script, so this part is unix only. + #[cfg(unix)] + { let opener = s.dir.join("opener-guard.sh"); std::fs::write(&opener, format!("#!/bin/sh\necho \"$1\" > {}\n", s.dir.join("guard-opened.txt").display())).unwrap(); #[cfg(unix)] @@ -928,6 +935,7 @@ fn live_generate_asks_the_harness_to_open_the_page_instead_of_a_second_browser() let explicit: serde_json::Value = serde_json::from_str(String::from_utf8_lossy(&out.stdout).trim()).unwrap(); assert_eq!(explicit["opened"]["url"], serde_json::json!(hint), "{explicit}"); assert_eq!(std::fs::read_to_string(s.dir.join("guard-opened.txt")).unwrap().trim(), hint); + } // A wait budget means the caller is opening the page in parallel: the // verb waits instead of handing the URL back. let waited = run("cursor", &["--dev-url", &hint, "--wait-for-browser", "700"]);