payfrit-qa/scripts/run-all.sh
Luna (QA) e6153ac4b7 Add QA test framework — API tests, infra health, test data seeding
Payfrit:
- Tab API contract tests (bash + python) — all 13 endpoints
- Param validation, response time, cross-env parity checks

Grubflip:
- API endpoint test stubs — menu, restaurant, order, auth
- Ready to activate as Mike deploys endpoints

Shared:
- test_helpers.sh + test_helpers.py — HTTP helpers, pass/fail/skip, JSON output mode
- Master test runner (scripts/run-all.sh)
- Infrastructure health checker (disk, RAM, services, SSL certs)

Test data:
- Grubflip seed SQL (QA test restaurants, menus, orders)
- Payfrit tab seeder script

All Payfrit tab tests confirmed passing against dev + prod.
2026-03-26 05:57:37 +00:00

64 lines
2.4 KiB
Bash
Executable file

#!/usr/bin/env bash
# ============================================================
# run-all.sh — Master test runner
# Usage: ./scripts/run-all.sh [payfrit|grubflip|all] [dev|prod] [--json]
# Author: Luna (@luna) — QA
# ============================================================
set -uo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
REPORTS_DIR="$REPO_ROOT/reports"
PROJECT="${1:-all}"
ENV="${2:-dev}"
JSON_FLAG=""
for arg in "$@"; do [ "$arg" = "--json" ] && JSON_FLAG="--json"; done
TIMESTAMP=$(date -u '+%Y%m%d-%H%M%S')
REPORT_FILE="$REPORTS_DIR/${PROJECT}-${ENV}-${TIMESTAMP}.txt"
mkdir -p "$REPORTS_DIR"
echo "╔══════════════════════════════════════════════╗"
echo "║ PAYFRIT QA — TEST RUNNER ║"
echo "║ Project: $PROJECT | Env: $ENV "
echo "$(date -u '+%Y-%m-%d %H:%M:%S UTC')"
echo "╚══════════════════════════════════════════════╝"
echo ""
EXIT_CODE=0
run_suite() {
local name="$1"
local cmd="$2"
echo "─── Running: $name ───"
if eval "$cmd"; then
echo "$name: ALL PASSED"
else
echo "$name: FAILURES DETECTED"
EXIT_CODE=1
fi
echo ""
}
if [ "$PROJECT" = "payfrit" ] || [ "$PROJECT" = "all" ]; then
run_suite "Payfrit Tab API (bash)" "bash $REPO_ROOT/payfrit/api/test_tabs.sh $ENV $JSON_FLAG"
run_suite "Payfrit Tab API (python)" "python3 $REPO_ROOT/payfrit/api/test_tabs.py $ENV $JSON_FLAG"
fi
if [ "$PROJECT" = "grubflip" ] || [ "$PROJECT" = "all" ]; then
run_suite "Grubflip API (bash)" "bash $REPO_ROOT/grubflip/api/test_endpoints.sh $ENV $JSON_FLAG"
run_suite "Grubflip API (python)" "python3 $REPO_ROOT/grubflip/api/test_endpoints.py $ENV $JSON_FLAG"
fi
echo "════════════════════════════════════════════════"
if [ "$EXIT_CODE" -eq 0 ]; then
echo " ALL SUITES PASSED ✅"
else
echo " SOME SUITES HAD FAILURES ❌"
fi
echo "════════════════════════════════════════════════"
exit $EXIT_CODE