test: smoke scripts fail when they stop before their last check
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -20,6 +20,20 @@ INIT_RESPONSE=""
|
||||
REQUEST_ID=100
|
||||
|
||||
fail() { echo "FAIL: $*"; exit 1; }
|
||||
|
||||
# A smoke script must reach its last line: finish() marks that and prints the verdict.
|
||||
# guard_exit (called first in every EXIT trap) turns any other exit – including a silent
|
||||
# stop that still returns 0 – into a failure, so a run can never pass without all checks.
|
||||
SMOKE_FINISHED=0
|
||||
finish() { SMOKE_FINISHED=1; echo "ALL CHECKS PASSED"; }
|
||||
guard_exit() {
|
||||
local rc=$1
|
||||
if [ "$rc" -eq 0 ] && [ "$SMOKE_FINISHED" != 1 ]; then
|
||||
echo "FAIL: script stopped before its last check (exit 0 without finish)"
|
||||
return 1
|
||||
fi
|
||||
return "$rc"
|
||||
}
|
||||
pass() { echo "ok - $*"; }
|
||||
|
||||
# Removes every "lit-mcp-integration-test" application password of a user.
|
||||
|
||||
Reference in New Issue
Block a user