ci: add E2E test job to PR workflow and update test scripts

This commit is contained in:
2026-04-26 16:37:19 -07:00
parent 2b38fbb0f2
commit 8664d330bc
3 changed files with 59 additions and 4 deletions
+29
View File
@@ -83,6 +83,35 @@ test-acceptance-postgres:
@echo "Stopping Docker containers..."
docker compose down
# Run Cucumber e2e tests with SQLite
test-cucumber-sqlite:
@echo "Running Cucumber e2e tests with SQLite..."
DATABASE_PROVIDER=sqlite DATABASE_URL=file:./prisma/ci.db npm run test:acceptance:cucumber
# Run Cucumber e2e tests with PostgreSQL (uses .env.development)
test-cucumber-postgres:
@echo "Running Cucumber e2e tests with PostgreSQL..."
npm run test:acceptance:cucumber
# Run Cucumber e2e tests with PostgreSQL against production build
# This is more reliable than dev server (no HMR, faster API responses)
test-cucumber-postgres-prod:
@echo "Building application for production..."
bun run build
@echo "Starting production server in background..."
bun run start > /tmp/next-prod.log 2>&1 &
SERVER_PID=$$!
@echo "Waiting for server to be ready..."
sleep 15
@echo "Running Cucumber e2e tests against production build..."
npm run test:acceptance:cucumber || true
@echo "Stopping production server..."
kill $$SERVER_PID 2>/dev/null || true
@echo "Tests completed."
# Run all e2e tests (both Playwright and Cucumber)
test-e2e: test-acceptance-sqlite test-cucumber-sqlite
# Run database migrations (Prisma)
migrate:
npx prisma migrate dev