Smoke test: a failed check is also an annotation on the run
llembas-tty / linux (push) Failing after 34s

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
HomerandClaude Fable 5.2 committed 2026-12-02 07:38:19 +00:00
1 parent 4357c7efa5
commit 9435f4810d
1 file changed
+4 -2
+4 -2
View File
@@ -29,7 +29,9 @@ chmod 700 "$work/run"
clean() { env -i PATH=/usr/bin:/bin HOME="$work/home" XDG_RUNTIME_DIR="$work/run" XDG_CONFIG_HOME="$work/cfg" "$@"; }
ok() { echo "ok $1"; }
bad() { echo "FAIL $1"; failed=1; }
# On GitHub a failure is also an annotation on the run: a line, with newlines made visible.
note() { [ -z "${GITHUB_ACTIONS:-}" ] || printf '::error title=smoke::%s\n' "$(printf '%s' "$1" | head -c 900 | tr '\n\r' ' ' | sed 's/%/%25/g')"; }
bad() { echo "FAIL $1"; note "$1"; failed=1; }
expect() { # name, text, pattern
if printf '%s' "$2" | grep -Eq -- "$3"; then ok "$1"; else bad "$1: wanted /$3/ in: $2"; fi
}
@@ -54,7 +56,7 @@ for _ in $(seq 40); do
kill -0 "$pid" 2>/dev/null || break
sleep 0.25
done
if [ -S "$sock" ]; then ok "the server listens in its own runtime directory ($APPDIR)"; else bad "no socket at $sock"; cat "$work/server.txt"; exit 1; fi
if [ -S "$sock" ]; then ok "the server listens in its own runtime directory ($APPDIR)"; else bad "no socket at $sock; the server said: $(tail -c 600 "$work/server.txt"); in the runtime directory: $(cd "$work/run" && find . | head -20 | tr '\n' ' ')"; cat "$work/server.txt"; exit 1; fi
cli() { clean "$TTY" cli --no-auto-start "$@"; }
# shellcheck disable=SC2016 # the pane's shell expands these, not this one