#!/bin/bash # BDD Test Runner and Validator # Runs all BDD tests and validates there are no undefined, pending, or skipped steps set -e echo "๐Ÿงช Running BDD tests for dance-lessons-coach..." echo "============================================" # Run tests with verbose output TEST_OUTPUT=$(go test ./features/... -v 2>&1) TEST_EXIT_CODE=$? echo "$TEST_OUTPUT" echo "" # Check for failures echo "๐Ÿ” Validating test results..." echo "============================================" FAILED=false # Check for undefined steps if echo "$TEST_OUTPUT" | grep -q "undefined"; then echo "โŒ ERROR: Found undefined steps" echo "$TEST_OUTPUT" | grep -E "undefined" | sed 's/^/ /' FAILED=true fi # Check for pending steps if echo "$TEST_OUTPUT" | grep -q "pending"; then echo "โŒ ERROR: Found pending steps" echo "$TEST_OUTPUT" | grep -E "pending" | sed 's/^/ /' FAILED=true fi # Check for skipped steps if echo "$TEST_OUTPUT" | grep -q "skipped"; then echo "โŒ ERROR: Found skipped steps" echo "$TEST_OUTPUT" | grep -E "skipped" | sed 's/^/ /' FAILED=true fi # Check for test failures if [ $TEST_EXIT_CODE -ne 0 ]; then echo "โŒ ERROR: Some tests failed" FAILED=true fi # Check for no test files if echo "$TEST_OUTPUT" | grep -q "no test files"; then echo "โŒ ERROR: No test files found" FAILED=true fi # Success case if [ "$FAILED" = false ]; then echo "โœ… All BDD tests passed successfully" echo "โœ… No undefined steps found" echo "โœ… No pending steps found" echo "โœ… No skipped steps found" echo "โœ… All scenarios executed successfully" echo "" echo "๐ŸŽ‰ BDD tests are healthy!" exit 0 else echo "" echo "๐Ÿ’ฅ BDD tests have issues that need to be fixed" echo "" echo "Debugging tips:" echo " 1. Run: godog --format=progress --show-step-definitions" echo " 2. Check: .vibe/skills/bdd_testing/references/DEBUGGING.md" echo " 3. Verify: Step patterns match Godog's exact suggestions" echo " 4. Test manually: curl http://localhost:9191/api/ready" exit 1 fi