#!/usr/bin/env bash

set -e

cd "$(dirname "$0")/.."

GREEN='\033[0;32m'
NC='\033[0m' # No Color

# The suite mocks every HTTP call in-process (respx), so no mock server is needed.
# Point TEST_API_BASE_URL at a live SovereignEG deployment to run the smoke tests
# in tests/smoke against it (requires SEG_API_KEY).
if [ -n "${TEST_API_BASE_URL:-}" ]; then
  echo -e "${GREEN}✔ Smoke tests will run against ${TEST_API_BASE_URL}${NC}"
  echo
fi

export DEFER_PYDANTIC_BUILD=false

echo "==> Running tests"
uv run --locked --all-extras pytest "$@"

echo "==> Running Pydantic v1 tests"
./scripts/test-pydantic-v1 "$@"
