Skip compositor tests without recording a failure

Two problems made a missing Wayland compositor look like broken tests.

The cleanup traps ended on a bare conditional, so when a test skipped
before creating its TMPDIR the trap's last command returned 1 and, under
set -e, that overrode the explicit exit 0.

Six tests that launch quickshell had no compositor guard at all, so they
ran anyway and failed on the Qt platform plugin.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
David Heinemeier Hansson
2026-08-09 04:29:26 -07:00
co-authored by Claude Opus 5
parent 0795ede770
commit 19572a13c7
13 changed files with 60 additions and 10 deletions
+8 -1
View File
@@ -17,6 +17,11 @@ assert(
)
JS
if [[ -z ${WAYLAND_DISPLAY:-} ]]; then
pass "no Wayland compositor; skipping Button hover geometry runtime test"
exit 0
fi
if ! command -v quickshell >/dev/null 2>&1; then
pass "quickshell not installed; skipping Button hover geometry runtime test"
exit 0
@@ -24,7 +29,9 @@ fi
TMPDIR=$(mktemp -d)
cleanup() {
[[ -d $TMPDIR ]] && rm -rf "$TMPDIR"
if [[ -d $TMPDIR ]]; then
rm -rf "$TMPDIR"
fi
}
trap cleanup EXIT