Files
dance-lessons-coach/.vibe/skills/bdd-testing/scripts/run-bdd-tests.sh
Gabriel Radureau 52065c9cf3
Some checks failed
CI/CD Pipeline / Build Docker Cache (push) Successful in 10s
CI/CD Pipeline / CI Pipeline (push) Failing after 13s
refactor: convert all DanceLessonsCoach mentions to kebab-case
2026-04-07 19:11:39 +02:00

77 lines
2.0 KiB
Bash
Executable File

#!/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