✨ merge: implement JWT secret rotation with BDD scenario isolation - Implement JWT secret rotation mechanism (closes #8) - Add per-scenario state isolation for BDD tests (closes #14) - Validate password reset workflow via BDD tests (closes #7) - Fix port conflicts in test validation - Add state tracer for debugging test execution - Document BDD isolation strategies in ADR 0025 - Fix PostgreSQL configuration environment variables Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai> Co-authored-by: Gabriel Radureau <arcodange@gmail.com> Co-committed-by: Gabriel Radureau <arcodange@gmail.com>
65 lines
1.9 KiB
Bash
Executable File
65 lines
1.9 KiB
Bash
Executable File
#!/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
|