🐛 fix: BDD tests PostgreSQL connection for native execution
- Simplify getPostgresHost() to always use localhost by default - Use DLC_DATABASE_HOST=localhost for all local execution - Container name only needed when running INSIDE Docker containers - Fix native execution PostgreSQL connection issues - Ensure BDD tests connect to localhost:5432 (mapped port) Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
@@ -24,11 +24,8 @@ func getPostgresHost() string {
|
||||
return host
|
||||
}
|
||||
// Default to localhost for native execution, container name for Docker
|
||||
// Check if we're running in a container by looking for Docker-specific env vars
|
||||
if os.Getenv("DOCKER_CONTAINER") != "" || os.Getenv("KUBERNETES_SERVICE_HOST") != "" {
|
||||
return "dance-lessons-coach-postgres"
|
||||
}
|
||||
// Native execution - use localhost with container port mapping
|
||||
// When running natively but PostgreSQL is in Docker, use localhost (port mapping)
|
||||
// When running in Docker containers, use container name
|
||||
return "localhost"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user