🎯 refactor: implement comprehensive BDD test suite with modular architecture
✨ 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>
This commit is contained in:
64
scripts/test-by-tag.sh
Executable file
64
scripts/test-by-tag.sh
Executable file
@@ -0,0 +1,64 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Tag-Based Test Runner Script
|
||||
# Runs BDD tests with specific tags
|
||||
|
||||
set -e
|
||||
|
||||
# Check if tag is provided
|
||||
if [ $# -eq 0 ]; then
|
||||
echo "❌ Usage: $0 <tag> [feature]"
|
||||
echo "Examples:"
|
||||
echo " $0 @smoke # Run all smoke tests"
|
||||
echo " $0 @critical auth # Run critical auth tests"
|
||||
echo " $0 @v2 greet # Run v2 greet tests"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
TAG=$1
|
||||
FEATURE=""
|
||||
|
||||
# Check if feature is also provided
|
||||
if [ $# -ge 2 ]; then
|
||||
FEATURE=$2
|
||||
fi
|
||||
|
||||
SCRIPTS_DIR=$(dirname `realpath ${BASH_SOURCE[0]}`)
|
||||
cd $SCRIPTS_DIR/..
|
||||
|
||||
echo "🧪 Running tests with tag: $TAG"
|
||||
|
||||
if [ -n "$FEATURE" ]; then
|
||||
echo "📁 Feature: $FEATURE"
|
||||
|
||||
# Set feature-specific environment variables
|
||||
DATABASE="dance_lessons_coach_${FEATURE}_test"
|
||||
CONFIG="features/${FEATURE}/${FEATURE}-test-config.yaml"
|
||||
|
||||
export DLC_DATABASE_HOST="localhost"
|
||||
export DLC_DATABASE_PORT="5432"
|
||||
export DLC_DATABASE_USER="postgres"
|
||||
export DLC_DATABASE_PASSWORD="postgres"
|
||||
export DLC_DATABASE_NAME="${DATABASE}"
|
||||
export DLC_DATABASE_SSL_MODE="disable"
|
||||
export DLC_CONFIG_FILE="${CONFIG}"
|
||||
|
||||
# Run feature-specific tests with tag filtering
|
||||
echo "🚀 Running tagged tests for ${FEATURE} feature..."
|
||||
cd "features/${FEATURE}"
|
||||
FEATURE=${FEATURE} go test -v -tags="$TAG" .
|
||||
else
|
||||
echo "🚀 Running tagged tests for all features..."
|
||||
|
||||
# Run all tests with tag filtering
|
||||
# Note: Godog tag filtering is done through the godog command line
|
||||
# For Go test integration, we need to use a different approach
|
||||
echo "⚠️ Tag filtering for all features requires godog command directly"
|
||||
echo "📝 Running: godog --tags=$TAG features/"
|
||||
|
||||
# This would require setting up the test server manually
|
||||
# For now, we'll show how it would work
|
||||
echo "⏳ This functionality would require additional implementation"
|
||||
echo "💡 Consider using: godog --tags=$TAG features/"
|
||||
echo " after starting the test server manually"
|
||||
fi
|
||||
Reference in New Issue
Block a user