Files
dahyeon 8d741ef9a7 test(auction): add two-node Docker failure integration suite
Exercise Nginx routing, Mongo transaction ordering, history backfills, Undo, Pub/Sub TCP loss, safety polling, resync, and reconnection. Keep fixtures and results isolated from production and git.
2026-11-12 01:49:35 +09:00

27 lines
1.2 KiB
Bash

#!/bin/sh
# From the repository root: sh apps/api/test/auction-cluster/run.sh
# Requires Docker Compose. No host ports or production credentials are used.
# Results and container logs remain in this directory's ignored results/ folder.
# Authentication uses a fixture admin; client recovery uses the production
# helpers and QueryObserver without rendering React. MongoDB 7 is the default
# for the test host's kernel; set MONGO_TEST_IMAGE on a compatible host to match
# the production database version.
set -eu
cd "$(dirname "$0")"
export COMPOSE_PROJECT_NAME="${COMPOSE_PROJECT_NAME:-lolympus-auction-cluster-$(date +%s)}"
case "$COMPOSE_PROJECT_NAME" in
lolympus-auction-cluster-*) ;;
*) echo 'Refusing to use a Compose project outside the auction-cluster test prefix.' >&2; exit 1 ;;
esac
mkdir -p results
cleanup() {
docker compose logs --no-color api-a api-b redis-proxy > results/containers.log 2>&1 || true
docker compose down --volumes --remove-orphans
}
trap cleanup EXIT INT TERM
docker compose build runner
docker compose up -d redis mongo redis-proxy
docker compose run --rm runner node test/auction-cluster/run.mjs init
docker compose up -d api-a api-b lb
docker compose run --rm runner node test/auction-cluster/run.mjs verify