🧪 test: fix BDD test script to use portable directory navigation and proper database configuration
All checks were successful
CI/CD Pipeline / Build Docker Cache (push) Successful in 10s
CI/CD Pipeline / CI Pipeline (push) Successful in 4m41s

This commit is contained in:
2026-04-08 12:45:56 +02:00
parent fe4a8e118e
commit 43c9dbcd55

View File

@@ -80,6 +80,20 @@ else
fi
# Run the BDD tests
# For local environment, set database environment variables to use localhost
# For CI environment, the database is already configured as a service
if [ -z "$GITHUB_ACTIONS" ] && [ -z "$GITEA_ACTIONS" ]; then
echo "🔧 Setting database environment variables for local environment..."
export DLC_DATABASE_HOST="localhost"
export DLC_DATABASE_PORT="5432"
export DLC_DATABASE_USER="postgres"
export DLC_DATABASE_PASSWORD="postgres"
export DLC_DATABASE_NAME="dance_lessons_coach_bdd_test"
export DLC_DATABASE_SSL_MODE="disable"
else
echo "🏗️ CI environment detected, using service configuration"
fi
test_output=$(go test ./features/... -v 2>&1)
test_exit_code=$?
@@ -109,5 +123,6 @@ if [ $test_exit_code -eq 0 ]; then
exit 0
else
echo "❌ BDD tests failed"
echo echo 'DLC_DATABASE_HOST=localhost DLC_DATABASE_PORT=5432 DLC_DATABASE_USER=postgres DLC_DATABASE_PASSWORD=postgres DLC_DATABASE_NAME=dance_lessons_coach_bdd_test DLC_DATABASE_SSL_MODE=disable go test ./features/... -v'
exit 1
fi