Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions debian/control.top.in
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ Build-Depends:
python3-dbus <!nocheck>,
python3-dbus.mainloop.pyqt5 <!nocheck>,
python3-qtpy <!nocheck>,
python3-zmq <!nocheck>,
python3-cairo <!nocheck>,
python3-gi <!nocheck>,
python3-gi-cairo <!nocheck>,
Expand Down
25 changes: 25 additions & 0 deletions tests/ui-smoke/_lib/checkresult-quit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash
# Shared result check for UI smoke quit-path tests.
#
# Pass if the quit launcher printed UI_SMOKE_QUIT_OK (the GUI exited on
# its own SIGTERM within the grace) and did not print UI_SMOKE_QUIT_FAIL.
set -u

if [ $# -lt 1 ]; then
echo "FAIL: checkresult-quit requires the result-log path as argument" >&2
exit 1
fi

LOG="$1"

if grep -q '^UI_SMOKE_QUIT_FAIL' "$LOG"; then
echo "FAIL: $(grep -m1 '^UI_SMOKE_QUIT_FAIL' "$LOG")" >&2
exit 1
fi

if ! grep -q '^UI_SMOKE_QUIT_OK' "$LOG"; then
echo "FAIL: GUI did not report a clean SIGTERM exit (no UI_SMOKE_QUIT_OK)" >&2
exit 1
fi

exit 0
41 changes: 41 additions & 0 deletions tests/ui-smoke/_lib/crashdump.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash
# Native crash capture for the UI smoke launchers. A GUI segfault is the
# failure these tests most need to explain, and it lands in C/C++ (Qt,
# dbus, GL) where PYTHONFAULTHANDLER stops at the event-loop frame. Arm a
# core dump before launch; after the run, if the GUI left a core, print a
# native backtrace into the log so CI shows the faulting frame directly.
# Source with LIB_DIR set; runs only on the failure path, so green runs
# pay nothing.

crashdump_arm() {
CORE_DIR="$(mktemp -d -t ui-smoke-cores.XXXXXX)"
export CORE_DIR
ulimit -c unlimited 2>/dev/null || true
# core_pattern is global and needs root; best-effort (CI has sudo).
# If it does not take, crashdump_report still finds a cwd "core".
sudo sysctl -w "kernel.core_pattern=$CORE_DIR/core.%e.%p" >/dev/null 2>&1 || true
}

crashdump_report() {
[ -n "${CORE_DIR:-}" ] || return 0
local core
# shellcheck disable=SC2012 # mktemp dir, no odd filenames
core=$(ls -t "$CORE_DIR"/core* ./core* /tmp/core* 2>/dev/null | head -1)
if [ -n "$core" ]; then
echo "=== crash: native backtrace ($core) ==="
# gdb is not on the CI runner by default; pull it in to read the core.
command -v gdb >/dev/null 2>&1 || sudo apt-get install -y -q gdb >/dev/null 2>&1 || true
if command -v gdb >/dev/null 2>&1; then
# "bt" first: gdb auto-selects the faulting thread on a SIGSEGV
# core. "thread apply all bt" after gives the rest.
gdb -batch -nx \
-ex "bt" \
-ex "echo \n=== all threads ===\n" \
-ex "thread apply all bt" \
"$(command -v python3)" "$core" 2>&1 | head -400
else
echo "(gdb unavailable; core left at $core)"
fi
fi
rm -rf "$CORE_DIR"
}
Loading
Loading