🧪 test: fix BDD test script to use portable directory navigation and proper database configuration
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user