paper-dynasty-discord/tests/refractor-preflight.sh
Cal Corum 190aa88d43
All checks were successful
Ruff Lint / lint (pull_request) Successful in 21s
test: add refractor integration test plan and preflight script
82-case in-app test plan for Playwright automation covering /refractor status,
tier badges, post-game hooks, tier-up notifications, and edge cases.
Preflight script for quick deploy verification via curl.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 01:16:21 -05:00

23 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
# refractor-preflight.sh — run from workstation after dev deploy
# Verifies the Refractor system endpoints and bot health
echo "=== Dev API ==="
# Refractor endpoint exists (expect 401 = auth required)
STATUS=$(curl -s -o /dev/null -w "%{http_code}" "https://pddev.manticorum.com/api/v2/refractor/cards/1")
[ "$STATUS" = "401" ] && echo "PASS: refractor/cards responds (401)" || echo "FAIL: refractor/cards ($STATUS, expected 401)"
# Old evolution endpoint removed (expect 404)
STATUS=$(curl -s -o /dev/null -w "%{http_code}" "https://pddev.manticorum.com/api/v2/evolution/cards/1")
[ "$STATUS" = "404" ] && echo "PASS: evolution/cards removed (404)" || echo "FAIL: evolution/cards ($STATUS, expected 404)"
echo ""
echo "=== Discord Bot ==="
# Health check
curl -sf http://sba-bots:8080/health >/dev/null 2>&1 && echo "PASS: bot health OK" || echo "FAIL: bot health endpoint"
# Recent refractor activity in logs
echo ""
echo "=== Recent Bot Logs (refractor) ==="
ssh sba-bots "docker logs --since 10m paper-dynasty_discord-app_1 2>&1 | grep -i refract" || echo "(no recent refractor activity)"