Files
rootnode-academy/infra/scripts/staging-smoke-test.sh
T
ced4568 51a09241ad feat(loadtest): load-test tooling + capacity model
boot-labs.js drives the real admin Prepare-Labs endpoint (reusing the
existing session-helper.js from Phase 3A) and records boot time/failure
rate; sample-resources.sh samples real docker stats for running Labs.
capacity-model.js turns measured per-Lab CPU/memory into a recommended/
warning/hard-admission-control concurrency threshold - no concurrency
number is hardcoded as a marketing figure, every input is explicitly
placeholder data until measured against the real host.

Plus deploy/rollback/smoke-test scripts used by the CI/CD and deployment
runbooks. All syntax-checked; validate-compose.sh and capacity-model.js
actually run against real inputs.
2026-08-18 17:13:32 -05:00

25 lines
1.3 KiB
Bash
Executable File

#!/usr/bin/env bash
# Staging acceptance test (Phase 4 §23/§18) — the four things a human needs before promoting a
# build: app deploys, migrations ran clean, the Gateway/Platform API/Provisioner are reachable,
# and (if OWNER_EMAIL/OWNER_PASSWORD are provided) a real assessment can be started end to end.
# Reuses platform/test/e2e-phase3b.js against the staging Gateway URL rather than re-inventing
# a parallel smoke-test harness — that suite already IS the full acceptance chain.
set -euo pipefail
STAGING_URL="${STAGING_GATEWAY_URL:?set STAGING_GATEWAY_URL, e.g. https://staging.academy.example.com}"
echo "==> Health checks"
curl -sf "$STAGING_URL/healthz" > /dev/null && echo "OK: Gateway /healthz"
if [ -n "${OWNER_EMAIL:-}" ] && [ -n "${OWNER_PASSWORD:-}" ]; then
echo "==> Full acceptance run (platform/test/e2e-phase3b.js against staging)"
cd "$(dirname "$0")/../../platform"
GATEWAY_URL="$STAGING_URL" OWNER_EMAIL="$OWNER_EMAIL" OWNER_PASSWORD="$OWNER_PASSWORD" \
SKIP_RESTART_TEST=1 node test/e2e-phase3b.js
else
echo "==> Skipping full e2e run — set OWNER_EMAIL/OWNER_PASSWORD for a real classroom-workflow"
echo " smoke test (bootstrap one first against staging: platform/api/bootstrap-owner.js)."
fi
echo "OK: staging smoke test passed"