test: add reproducible 720p visual capture

This commit is contained in:
goose
2026-10-08 22:33:52 -04:00
parent cf102e1e95
commit 23acd47495
6 changed files with 166 additions and 16 deletions
+9 -2
View File
@@ -18,7 +18,8 @@ mkdir -p artifacts
log_path="artifacts/visual-check.log"
initial_capture_path="artifacts/visual-check.png"
exit_capture_path="artifacts/visual-check-exit.png"
rm -f "$initial_capture_path" "$exit_capture_path"
compact_capture_path="artifacts/visual-check-compact.png"
rm -f "$initial_capture_path" "$exit_capture_path" "$compact_capture_path"
: > "$log_path"
runner=()
@@ -34,8 +35,9 @@ fi
run_capture() {
local label="$1"
local capture_argument="$2"
shift 2
set +e
timeout --foreground 20s "${runner[@]}" "$GODOT_BIN" --path . -- --"$capture_argument" >>"$log_path" 2>&1
timeout --foreground 20s "${runner[@]}" "$GODOT_BIN" --path . "$@" -- --"$capture_argument" >>"$log_path" 2>&1
local status=$?
set -e
if (( status != 0 )); then
@@ -46,6 +48,10 @@ run_capture() {
run_capture "initial" "capture"
run_capture "exit" "capture-exit"
# This is a real 1280×720 window capture, not a unit-level HUD relayout call.
# The fixed window size makes the compact artboard and PNG reproducible under
# Xvfb as well as an interactive DISPLAY.
run_capture "compact" "visual-check-compact" --windowed --resolution 1280x720
# Godot's SCRIPT ERROR / Parse Error diagnostics are actionable application
# failures. Do not treat unrelated backend diagnostics (for example the
# expected xkbcommon Compose warnings emitted by some Snap/Xvfb setups) as an
@@ -65,3 +71,4 @@ measure_capture() {
measure_capture "$initial_capture_path"
measure_capture "$exit_capture_path"
measure_capture "$compact_capture_path"