paper-dynasty-discord/tests/refractor-preflight.sh
Cal Corum 8e5242a6b7
All checks were successful
Ruff Lint / lint (pull_request) Successful in 18s
fix: move health server from port 8080 to 8081 (#130)
Adminer is exposed on host port 8080, shadowing the bot health endpoint.
Change health server default to 8081 to avoid the conflict.

Closes #130

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-07 15:53:33 +00: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:8081/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)"