🐛 fix: ensure clean BDD database creation between test runs
Some checks failed
CI/CD Pipeline / Build Docker Cache (push) Successful in 3m26s
CI/CD Pipeline / CI Pipeline (push) Failing after 1m32s

- Add DROP DATABASE IF EXISTS before creating BDD test database

- Prevents errors when database already exists from previous runs

- Ensures clean test environment for each run

Generated by Mistral Vibe.

Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
2026-04-07 18:22:26 +02:00
parent a98656445f
commit 7f32a113db

View File

@@ -34,6 +34,8 @@ if ! docker ps --format '{{.Names}}' | grep -q "^dance-lessons-coach-postgres$";
# Create BDD test database (separate from development database) # Create BDD test database (separate from development database)
echo "📦 Creating BDD test database..." echo "📦 Creating BDD test database..."
# Drop database if it exists, then create fresh
docker exec dance-lessons-coach-postgres psql -U postgres -c "DROP DATABASE IF EXISTS dance_lessons_coach_bdd_test;"
if docker exec dance-lessons-coach-postgres createdb -U postgres dance_lessons_coach_bdd_test; then if docker exec dance-lessons-coach-postgres createdb -U postgres dance_lessons_coach_bdd_test; then
echo "✅ BDD test database created successfully!" echo "✅ BDD test database created successfully!"
else else