ci: add acceptance tests job with CI database and sync-dev recipe
This commit is contained in:
@@ -239,3 +239,28 @@ workflow-status:
|
||||
@echo "PR Workflow: Runs unit + acceptance tests on pull requests"
|
||||
@echo "Test Workflow: Runs unit tests on all branch pushes"
|
||||
@echo "Release Workflow: Runs on main branch pushes (version bump + Docker build)"
|
||||
|
||||
# --- SDLC Database Operations ---
|
||||
|
||||
# Sync production data to development database (manual operation)
|
||||
sync-dev:
|
||||
@echo "Syncing production data to development database..."
|
||||
node scripts/sync-prod-to-dev.js
|
||||
|
||||
# Run acceptance tests against production database (opt-in, manual)
|
||||
test-prod:
|
||||
@echo "⚠️ WARNING: This will run tests against the PRODUCTION database!"
|
||||
@echo " All test records will be cleaned up after the run."
|
||||
@echo ""
|
||||
@read -p "Are you sure you want to continue? (y/N) " confirm; \
|
||||
if [ "$$confirm" != "y" ]; then \
|
||||
echo "Cancelled."; \
|
||||
else \
|
||||
DATABASE_URL="$$PROD_DATABASE_URL" bun test:acceptance; \
|
||||
fi
|
||||
|
||||
# Reset CI database (for local CI testing)
|
||||
reset-ci-db:
|
||||
@echo "Resetting CI database..."
|
||||
psql "$CI_DATABASE_URL" -c "DROP SCHEMA public CASCADE; CREATE SCHEMA public;"
|
||||
bunx prisma migrate deploy
|
||||
|
||||
Reference in New Issue
Block a user