#!/usr/bin/env bash # Curl-based smoke test against a running stack (docker compose up -d). # Grows with the system; later phases add register→login→board coverage. set -euo pipefail BASE_URL="${BASE_URL:-http://localhost:8787}" fail() { echo "SMOKE FAIL: $*" >&2; exit 1; } echo "smoke: $BASE_URL" # healthz must always be 200 while the process is up code=$(curl -fsS -o /tmp/smoke-healthz.json -w '%{http_code}' "$BASE_URL/healthz") \ || fail "healthz unreachable" [ "$code" = "200" ] || fail "healthz returned $code" grep -q '"ok"' /tmp/smoke-healthz.json || fail "healthz body unexpected: $(cat /tmp/smoke-healthz.json)" echo " healthz ok" # readyz reflects dependency state; required deps must be up for the smoke run code=$(curl -sS -o /tmp/smoke-readyz.json -w '%{http_code}' "$BASE_URL/readyz") \ || fail "readyz unreachable" [ "$code" = "200" ] || fail "readyz returned $code: $(cat /tmp/smoke-readyz.json)" echo " readyz ok" # metricsz exposes counters curl -fsS "$BASE_URL/metricsz" | grep -q '"counters"' || fail "metricsz body unexpected" echo " metricsz ok" echo "SMOKE PASS"