From ba0e891348a5e2961e8b24def5dc6f31a0fda2b0 Mon Sep 17 00:00:00 2001 From: kami Date: Fri, 28 Aug 2026 14:37:09 +0400 Subject: [PATCH] orchestra: pre-release WIP snapshot (orchestra-06g4ft0mb733h2zcz237wfhfd8-b318f8b5) --- scripts/orchestra_e2e_selftest.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/scripts/orchestra_e2e_selftest.sh b/scripts/orchestra_e2e_selftest.sh index 10c4687..f99d410 100755 --- a/scripts/orchestra_e2e_selftest.sh +++ b/scripts/orchestra_e2e_selftest.sh @@ -4,8 +4,11 @@ here=$(cd "$(dirname "$0")" && pwd) healthcheck="$here/orchestra_e2e_healthcheck.sh" +# fail : always echo what the healthcheck printed, +# so a red run is diagnosable without rerunning it by hand. fail() { printf 'selftest: FAILED %s\n' "$1" >&2 + printf 'selftest: healthcheck stdout was:\n%s\n' "$2" >&2 exit 1 } @@ -13,22 +16,22 @@ fail() { out=$(bash "$healthcheck") status=$? -[ "$status" -eq 0 ] || fail "plain run exit status: want 0, got $status" +[ "$status" -eq 0 ] || fail "plain run exit status: want 0, got $status" "$out" case "$out" in *OK*) ;; - *) fail "plain run stdout contains OK: got '$out'" ;; + *) fail "plain run stdout contains OK" "$out" ;; esac # --json run jout=$(bash "$healthcheck" --json) jstatus=$? -[ "$jstatus" -eq 0 ] || fail "--json run exit status: want 0, got $jstatus" +[ "$jstatus" -eq 0 ] || fail "--json run exit status: want 0, got $jstatus" "$jout" jlines=$(printf '%s\n' "$jout" | wc -l) -[ "$jlines" -eq 1 ] || fail "--json run line count: want 1, got $jlines" +[ "$jlines" -eq 1 ] || fail "--json run line count: want 1, got $jlines" "$jout" case "$jout" in '{"status":'*) ;; - *) fail "--json run stdout prefix: want {\"status\": got '$jout'" ;; + *) fail '--json run stdout prefix: want {"status":' "$jout" ;; esac printf 'selftest: ok\n'