🐛 fix: BDD tests PostgreSQL connection for native execution

- Enhance getPostgresHost() to detect Docker vs native execution
- Use localhost for native execution (PostgreSQL port mapping)
- Use container name for Docker execution
- Fix local CI/CD script to set correct DLC_DATABASE_HOST
- Ensure BDD tests can connect in both Docker and native modes

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
2026-04-07 23:40:08 +02:00
parent 9528b7d288
commit 18213f365d
2 changed files with 14 additions and 4 deletions

View File

@@ -75,7 +75,12 @@ if [ "$HAS_DOCKER" = true ]; then
done
# Set PostgreSQL environment variables for BDD tests
export DLC_DATABASE_HOST="dance-lessons-coach-postgres"
# Use container name for Docker, localhost for native (port mapping)
if [ "$HAS_DOCKER" = true ]; then
export DLC_DATABASE_HOST="dance-lessons-coach-postgres"
else
export DLC_DATABASE_HOST="localhost"
fi
export DLC_DATABASE_PORT=5432
export DLC_DATABASE_USER=postgres
export DLC_DATABASE_PASSWORD=postgres