#!/usr/bin/env bash # Browser checks of the React UI against the fake model (no real key, no real model calls). Needs a built frontend # (cd web && npm ci && npm run build) and puppeteer-core on NODE_PATH. set -euo pipefail cd "$(dirname "$0")/.." [ -f static/dist/index.html ] || { echo "build the frontend first (cd web && npm run build)"; exit 1; } D=$(mktemp -d); KEYF=$D/key; printf 'test-dummy-key' > $KEYF; chmod 600 $KEYF python3 tests/mock_llm.py 18803 & M=$! start() { # port models rpm burst AGENT_MARKET_PORT=$1 AGENT_MARKET_DATA=$D/d$1 AGENT_MARKET_LLM_API_KEY_FILE=$KEYF AGENT_MARKET_CHAT_RPM=$3 AGENT_MARKET_CHAT_BURST=$4 \ AGENT_MARKET_LLM_BASE_URL=http://127.0.0.1:18803/v1 AGENT_MARKET_LLM_MODELS=$2 python3 server.py >/dev/null 2>&1 & echo $!; } S1=$(start 18804 mock-model 0 6); S2=$(start 18805 busy-model,busy-model-2 0 6); S3=$(start 18806 daily-model 0 6); S4=$(start 18807 mock-model 1 1) trap 'kill $M $S1 $S2 $S3 $S4 2>/dev/null; rm -rf $D' EXIT sleep 1.5 node tests/fake_model_browser.js http://127.0.0.1:18804 http://127.0.0.1:18805 http://127.0.0.1:18806 http://127.0.0.1:18807