arbret/scripts/e2e.sh

32 lines
439 B
Bash
Raw Normal View History

2025-12-18 21:48:41 +01:00
#!/bin/bash
set -e
cd "$(dirname "$0")/.."
# Kill any existing backend
pkill -f "uvicorn main:app" 2>/dev/null || true
sleep 1
# Start db
docker compose up -d db
2025-12-18 22:24:46 +01:00
# Start backend (SECRET_KEY should be set via .envrc or environment)
2025-12-18 21:48:41 +01:00
cd backend
uv run uvicorn main:app --port 8000 &
PID=$!
cd ..
# Wait for backend
sleep 2
# Run tests
cd frontend
npm run test:e2e
EXIT_CODE=$?
# Cleanup
kill $PID 2>/dev/null || true
exit $EXIT_CODE