From 62e1209b376bb0c7c75df2aa94b252cd18a6bc9c Mon Sep 17 00:00:00 2001 From: ddidderr Date: Mon, 12 Oct 2026 22:10:19 +0200 Subject: [PATCH] fix(tests): enable logs required by GTK replay assertions The error-only logging default suppressed replay output, causing five GTK tests to fail and two layer-shell tests to skip their assertions. Set RUST_LOG=debug and GHOSTTY_LOG=stderr for the child app so both replay output and capability detection are independent of inherited settings. Document the harness logging contract without changing application defaults. Test plan: - cargo test -p ghostty-rs --all-features --test gtk_replay (7 passed) - cargo clippy, cargo clippy --benches, cargo clippy --tests - cargo +nightly fmt and repeat the clippy checks Related-commit: 4fb9faa --- docs/rewrite/notes/verification-VR.md | 4 +++- tests/gtk_replay.rs | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/rewrite/notes/verification-VR.md b/docs/rewrite/notes/verification-VR.md index 157bcf1..61c1f75 100644 --- a/docs/rewrite/notes/verification-VR.md +++ b/docs/rewrite/notes/verification-VR.md @@ -65,7 +65,9 @@ grep NEEDED` has no `libwayland-client`. Regression: `quick_terminal_layer_surfa - `tests/gtk_replay.rs` (root package, runs the real binary on the current Wayland/X11 session; skips without a display or with `GHOSTTY_SKIP_GTK_REPLAY`): IME flow, paste deny/confirm, OSC 52 write/read ask (+remember), quick terminal layer surface/toggle/autohide/no-autohide, horizontal scroll tab switching. ~45 s total, serialized - (they share the session clipboard). + (they share the session clipboard). The harness sets `RUST_LOG=debug` and + `GHOSTTY_LOG=stderr` for the app so replay assertions and Wayland layer-shell + detection work independently of the default log level and inherited logging settings. - Parser unit tests for the new steps in `debug_input.rs`. ## Notes diff --git a/tests/gtk_replay.rs b/tests/gtk_replay.rs index 26b84ff..41d13d4 100644 --- a/tests/gtk_replay.rs +++ b/tests/gtk_replay.rs @@ -8,6 +8,8 @@ //! //! Skipped (passes) when there is no display or `GHOSTTY_SKIP_GTK_REPLAY` is //! set. The tests share the session clipboard, so they run one at a time. +//! Child processes explicitly enable debug logs on stderr: replay assertions +//! and layer-shell detection must not depend on the user's logging settings. use std::{ path::{Path, PathBuf}, @@ -72,6 +74,9 @@ fn run(script: &str, extra: &[&str], child: &str) -> Run { .args(extra) .args(["-e", "sh", "-c", child]) .env("GHOSTTY_DEBUG_INPUT_SCRIPT", &script_path) + // Replay output is warn-level; Wayland capability detection is debug-level. + .env("RUST_LOG", "debug") + .env("GHOSTTY_LOG", "stderr") .stdin(Stdio::null()) .stdout(Stdio::null()) .stderr(Stdio::piped())