✨ feat: add feature-based test organization per ADR 0024 🐛 fix: resolve compilation errors in suite_feature.go 📝 docs: add comprehensive BDD framework documentation ♻️ refactor: split monolithic tests into modular features 🧪 test: implement synchronization helpers and context management ⚡ perf: add parallel test execution capability 🔧 chore: add feature-specific test scripts and validation 📚 docs: move BDD_TAGS.md to features/ for better organization Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
111 lines
3.7 KiB
Bash
Executable File
111 lines
3.7 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Isolation Validation Script
|
|
# Validates that feature isolation is working correctly
|
|
|
|
set -e
|
|
|
|
echo "🔍 Validating BDD test isolation..."
|
|
|
|
# Check feature directories exist
|
|
echo "📁 Checking feature directory structure..."
|
|
for feature in auth config greet health jwt; do
|
|
if [ ! -d "features/${feature}" ]; then
|
|
echo "❌ Missing features/${feature} directory"
|
|
exit 1
|
|
fi
|
|
|
|
# Check for feature files
|
|
if [ -z "$(find features/${feature} -name "*.feature" -type f)" ]; then
|
|
echo "❌ No feature files found in features/${feature}"
|
|
exit 1
|
|
fi
|
|
|
|
# Check for config files
|
|
if [ ! -f "features/${feature}/${feature}-test-config.yaml" ]; then
|
|
echo "❌ Missing config file for ${feature} feature"
|
|
exit 1
|
|
fi
|
|
|
|
echo "✅ ${feature} feature structure validated"
|
|
done
|
|
|
|
# Check for unique ports
|
|
echo "🔌 Checking for unique port assignments..."
|
|
port_auth=$(grep "port:" "features/auth/auth-test-config.yaml" | awk '{print $2}')
|
|
port_config=$(grep "port:" "features/config/config-test-config.yaml" | awk '{print $2}')
|
|
port_greet=$(grep "port:" "features/greet/greet-test-config.yaml" | awk '{print $2}')
|
|
port_health=$(grep "port:" "features/health/health-test-config.yaml" | awk '{print $2}')
|
|
port_jwt=$(grep "port:" "features/jwt/jwt-test-config.yaml" | awk '{print $2}')
|
|
|
|
# Check for port conflicts
|
|
if [ "$port_auth" = "$port_config" ] || [ "$port_auth" = "$port_greet" ] || [ "$port_auth" = "$port_health" ] || [ "$port_auth" = "$port_jwt" ]; then
|
|
echo "❌ Port conflict detected with auth port $port_auth"
|
|
exit 1
|
|
fi
|
|
|
|
if [ "$port_config" = "$port_greet" ] || [ "$port_config" = "$port_health" ] || [ "$port_config" = "$port_jwt" ]; then
|
|
echo "❌ Port conflict detected with config port $port_config"
|
|
exit 1
|
|
fi
|
|
|
|
if [ "$port_greet" = "$port_health" ] || [ "$port_greet" = "$port_jwt" ]; then
|
|
echo "❌ Port conflict detected with greet port $port_greet"
|
|
exit 1
|
|
fi
|
|
|
|
if [ "$port_health" = "$port_jwt" ]; then
|
|
echo "❌ Port conflict detected with health port $port_health"
|
|
exit 1
|
|
fi
|
|
|
|
echo "✅ All features have unique ports"
|
|
|
|
# Check for unique database names
|
|
echo "🗃️ Checking for unique database names..."
|
|
db_auth="dance_lessons_coach_auth_test"
|
|
db_config="dance_lessons_coach_config_test"
|
|
db_greet="dance_lessons_coach_greet_test"
|
|
db_health="dance_lessons_coach_health_test"
|
|
db_jwt="dance_lessons_coach_jwt_test"
|
|
|
|
# Check for database name conflicts
|
|
if [ "$db_auth" = "$db_config" ] || [ "$db_auth" = "$db_greet" ] || [ "$db_auth" = "$db_health" ] || [ "$db_auth" = "$db_jwt" ]; then
|
|
echo "❌ Database conflict detected with auth database"
|
|
exit 1
|
|
fi
|
|
|
|
if [ "$db_config" = "$db_greet" ] || [ "$db_config" = "$db_health" ] || [ "$db_config" = "$db_jwt" ]; then
|
|
echo "❌ Database conflict detected with config database"
|
|
exit 1
|
|
fi
|
|
|
|
if [ "$db_greet" = "$db_health" ] || [ "$db_greet" = "$db_jwt" ]; then
|
|
echo "❌ Database conflict detected with greet database"
|
|
exit 1
|
|
fi
|
|
|
|
if [ "$db_health" = "$db_jwt" ]; then
|
|
echo "❌ Database conflict detected with health database"
|
|
exit 1
|
|
fi
|
|
|
|
echo "✅ All features have unique database names"
|
|
|
|
# Test that each feature can be run independently
|
|
echo "🧪 Testing feature independence..."
|
|
for feature in auth config greet health jwt; do
|
|
echo "Testing ${feature} feature..."
|
|
|
|
# Try to run the feature test script with setup only
|
|
if ! bash scripts/test-feature.sh $feature 2>&1 | grep -q "Setting up ${feature} feature tests"; then
|
|
echo "❌ Failed to setup ${feature} feature tests"
|
|
exit 1
|
|
fi
|
|
|
|
echo "✅ ${feature} feature can be set up independently"
|
|
done
|
|
|
|
echo "✅ All isolation validations passed!"
|
|
echo "🎉 BDD test isolation is working correctly"
|