#!/usr/bin/env bash # # verify_game_detail.sh — end-to-end check for the TSSBOT game-detail parity work. # # Spins up a SELF-CONTAINED fixture (temp SQLite DBs, vehicle caches, icons) and # exercises the whole stack: the Python log builder, the Rust backend (dedup fix, # vehicle translation, logs endpoint), and the Node prod server (icon serving + # API proxy allowlist). Touches NO production data. Exits non-zero on any failure. # # Usage: # bash scripts/verify_game_detail.sh # # Env overrides: # BOTS_REPO path to the BOTS repo (default: ~/GitHub/BOTS, fallback ~/BOTS, /home/deploy/BOTS) # PYTHON python interpreter (default: BOTS venv if present, else python3) # BE_PORT backend port (default 6071) # WEB_PORT node server port (default 3071) set -uo pipefail WEB_REPO="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" BE_PORT="${BE_PORT:-6071}" WEB_PORT="${WEB_PORT:-3071}" # ---- locate BOTS repo + python -------------------------------------------- if [[ -z "${BOTS_REPO:-}" ]]; then for c in "$HOME/GitHub/BOTS" "$HOME/BOTS" "/home/deploy/BOTS"; do [[ -d "$c" ]] && BOTS_REPO="$c" && break done fi if [[ -z "${BOTS_REPO:-}" || ! -d "$BOTS_REPO" ]]; then echo "FAIL: could not find BOTS repo; set BOTS_REPO=..." >&2 exit 1 fi if [[ -z "${PYTHON:-}" ]]; then if [[ -x "$BOTS_REPO/SHARED/.venv/bin/python" ]]; then PYTHON="$BOTS_REPO/SHARED/.venv/bin/python" else PYTHON="python3" fi fi PASS=0 FAIL=0 ok() { echo " PASS: $1"; PASS=$((PASS+1)); } bad() { echo " FAIL: $1" >&2; FAIL=$((FAIL+1)); } # assert_eq