paavohtl Claude Opus 4.6 (1M context) commited on
Commit
e0fca67
Β·
1 Parent(s): 353700e

fix: suppress windows during headless test execution

Browse files

- Launcher: use SW_HIDE for WA.exe window when OPENWA_HEADLESS=1 is set
- Test runner: use CREATE_NO_WINDOW when spawning launcher processes

Eliminates console windows and most WA windows during test runs.
The brief "Loading" dialog still flashes β€” hooking ShowWindow causes
WA to throttle (minimized) or hang (hidden), so it's left as-is.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

crates/openwa-launcher/src/main.rs CHANGED
@@ -53,6 +53,7 @@ struct PROCESS_INFORMATION {
53
 
54
  const CREATE_SUSPENDED: DWORD = 0x0000_0004;
55
  const STARTF_USESHOWWINDOW: DWORD = 0x0000_0001;
 
56
  const SW_SHOWMINIMIZED: u16 = 2;
57
  const INFINITE: DWORD = 0xFFFF_FFFF;
58
 
 
53
 
54
  const CREATE_SUSPENDED: DWORD = 0x0000_0004;
55
  const STARTF_USESHOWWINDOW: DWORD = 0x0000_0001;
56
+ const SW_HIDE: u16 = 0;
57
  const SW_SHOWMINIMIZED: u16 = 2;
58
  const INFINITE: DWORD = 0xFFFF_FFFF;
59
 
crates/openwa-test-runner/src/main.rs CHANGED
@@ -7,12 +7,15 @@
7
  use std::env;
8
  use std::fmt::Write as FmtWrite;
9
  use std::fs;
 
10
  use std::path::{Path, PathBuf};
11
  use std::process::Command;
12
  use std::sync::mpsc;
13
  use std::thread;
14
  use std::time::{Duration, Instant};
15
 
 
 
16
  // ─── Configuration ──────────────────────────────────────────────────────────
17
 
18
  const DEFAULT_JOBS: usize = 4;
@@ -223,6 +226,7 @@ fn run_test(test: &TestCase, launcher: &Path, wa_exe: &Path, run_dir: &Path) ->
223
  .env("OPENWA_LOG_PATH", &openwa_log)
224
  .stdout(std::process::Stdio::null())
225
  .stderr(std::process::Stdio::null())
 
226
  .status();
227
 
228
 
 
7
  use std::env;
8
  use std::fmt::Write as FmtWrite;
9
  use std::fs;
10
+ use std::os::windows::process::CommandExt;
11
  use std::path::{Path, PathBuf};
12
  use std::process::Command;
13
  use std::sync::mpsc;
14
  use std::thread;
15
  use std::time::{Duration, Instant};
16
 
17
+ const CREATE_NO_WINDOW: u32 = 0x0800_0000;
18
+
19
  // ─── Configuration ──────────────────────────────────────────────────────────
20
 
21
  const DEFAULT_JOBS: usize = 4;
 
226
  .env("OPENWA_LOG_PATH", &openwa_log)
227
  .stdout(std::process::Stdio::null())
228
  .stderr(std::process::Stdio::null())
229
+ .creation_flags(CREATE_NO_WINDOW)
230
  .status();
231
 
232