C++ / fmt (pull_request) Failing after 5s
C++ / build (pull_request) Failing after 9s
C++ / clang-tidy (pull_request) Failing after 10s
JS/TS / fmt (pull_request) Failing after 11s
JS/TS / lint (pull_request) Successful in 9s
Python / static (pull_request) Failing after 31s
Rust / build (pull_request) Successful in 49s
Python / verify (pull_request) Successful in 1m37s
Rust / fmt (pull_request) Successful in 27s
Rust / clippy (pull_request) Successful in 58s
65 lines
1.6 KiB
Bash
Executable File
65 lines
1.6 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -u
|
|
|
|
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
DURATION="${1:-${QS_SMOKE_DURATION:-10}}"
|
|
QML_IMPORT_PATH="${QML_IMPORT_PATH:-$ROOT/build/qml}"
|
|
|
|
if [ ! -d "$QML_IMPORT_PATH/ZShell" ]; then
|
|
echo "error: no ZShell plugin at $QML_IMPORT_PATH/ZShell"
|
|
echo "build the project first: cmake --build build"
|
|
exit 2
|
|
fi
|
|
|
|
OUT="$(mktemp /tmp/zshell-smoke.XXXXXX)"
|
|
trap 'rm -f "$OUT"' EXIT
|
|
|
|
echo "booting shell for ${DURATION}s (a second bar will be visible)"
|
|
env QT_QPA_PLATFORM=wayland QML_IMPORT_PATH="$QML_IMPORT_PATH" \
|
|
qs --no-color -p "$ROOT/shell.qml" >"$OUT" 2>&1 &
|
|
CLI_PID=$!
|
|
|
|
IID=""
|
|
for _ in $(seq 1 100); do
|
|
IID="$(sed -nE 's|.*by-id/([a-z0-9]+)/log\.qslog.*|\1|p' "$OUT" | head -1)"
|
|
[ -n "$IID" ] && break
|
|
kill -0 "$CLI_PID" 2>/dev/null || break
|
|
sleep 0.2
|
|
done
|
|
|
|
if [ -z "$IID" ]; then
|
|
echo "FAIL: shell did not start"
|
|
cat "$OUT"
|
|
exit 2
|
|
fi
|
|
|
|
sleep "$DURATION"
|
|
|
|
qs kill -i "$IID" >/dev/null 2>&1
|
|
if qs list --all 2>/dev/null | grep -q "Instance $IID"; then
|
|
PID="$(qs list --all 2>/dev/null | awk -v id="$IID" '
|
|
/^Instance /{cur = $2}
|
|
cur == id && /Process ID:/{print $3}')"
|
|
[ -n "$PID" ] && kill "$PID" 2>/dev/null
|
|
fi
|
|
wait "$CLI_PID" 2>/dev/null
|
|
|
|
ERRORS="$(grep -aE '^[[:space:]]*ERROR' "$OUT" || true)"
|
|
if [ -n "$ERRORS" ]; then
|
|
echo
|
|
echo "FAIL: QML errors detected"
|
|
echo "$ERRORS"
|
|
exit 1
|
|
fi
|
|
|
|
WARNINGS="$(grep -aE '^[[:space:]]*WARN' "$OUT" | sed -E 's/^[[:space:]]*WARN[[:space:]]*//' | sort | uniq -c | sort -rn || true)"
|
|
echo
|
|
if [ -n "$WARNINGS" ]; then
|
|
echo "PASS: no errors (${DURATION}s boot). Non-fatal warnings:"
|
|
echo "$WARNINGS"
|
|
else
|
|
echo "PASS: no errors or warnings (${DURATION}s boot)."
|
|
fi
|
|
exit 0
|