mirror of
https://github.com/pbakaus/impeccable.git
synced 2026-09-16 08:06:24 +03:00
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 <noreply@anthropic.com>
This commit is contained in:
committed by
Abdul Wahab
co-authored by
Claude Fable 5
parent
df4740bad9
commit
3f95a12aa8
@@ -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"]);
|
||||
|
||||
Reference in New Issue
Block a user