Fix headless Chrome debug UI CI test

This commit is contained in:
Bryan Helmkamp 2026-04-12 14:54:28 -04:00
parent 879a830b46
commit 81547af5c6
No known key found for this signature in database
2 changed files with 18 additions and 8 deletions

View file

@ -5,18 +5,22 @@ on:
branches: [main]
paths:
- "lib/crates/**"
- "test/**"
- "Cargo.toml"
- "Cargo.lock"
- ".cargo/**"
- ".config/**"
- "openapi/**"
- ".github/workflows/rust.yml"
pull_request:
branches: [main]
paths:
- "lib/crates/**"
- "test/**"
- "Cargo.toml"
- "Cargo.lock"
- ".cargo/**"
- ".config/**"
- "openapi/**"
- ".github/workflows/rust.yml"
workflow_dispatch:

View file

@ -300,14 +300,20 @@ async fn debug_page_renders_in_headless_chrome() {
"/tmp/twin-openai-debug-screenshot-{}.png",
std::process::id()
);
let output = std::process::Command::new(chrome_binary)
.args([
"--headless",
"--disable-gpu",
&format!("--screenshot={screenshot_path}"),
"--window-size=1280,900",
&format!("{}/__debug", server.base_url),
])
let mut command = std::process::Command::new(chrome_binary);
command.args([
"--headless",
"--disable-gpu",
&format!("--screenshot={screenshot_path}"),
"--window-size=1280,900",
]);
if cfg!(target_os = "linux") {
// Ubuntu 24.04 GitHub runners block Chrome's default sandbox unless it
// is launched with a compatible user namespace or disabled explicitly.
command.arg("--no-sandbox");
}
let output = command
.arg(format!("{}/__debug", server.base_url))
.output()
.expect("Chrome should run");