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
This commit is contained in:
ddidderr committed 2026-10-12 22:10:19 +02:00
1 parent 9f203f375f
commit 62e1209b37
2 files changed
+8 -1

No files matched your search

+3 -1
View File
@@ -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 - `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), 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 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`. - Parser unit tests for the new steps in `debug_input.rs`.
## Notes ## Notes
+5
View File
@@ -8,6 +8,8 @@
//! //!
//! Skipped (passes) when there is no display or `GHOSTTY_SKIP_GTK_REPLAY` is //! 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. //! 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::{ use std::{
path::{Path, PathBuf}, path::{Path, PathBuf},
@@ -72,6 +74,9 @@ fn run(script: &str, extra: &[&str], child: &str) -> Run {
.args(extra) .args(extra)
.args(["-e", "sh", "-c", child]) .args(["-e", "sh", "-c", child])
.env("GHOSTTY_DEBUG_INPUT_SCRIPT", &script_path) .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()) .stdin(Stdio::null())
.stdout(Stdio::null()) .stdout(Stdio::null())
.stderr(Stdio::piped()) .stderr(Stdio::piped())