🚀 feat: implement random port selection for BDD tests to prevent conflicts
Some checks failed
CI/CD Pipeline / Build Docker Cache (push) Successful in 9s
CI/CD Pipeline / CI Pipeline (push) Failing after 4m47s

This commit is contained in:
2026-04-10 14:29:04 +02:00
parent 9467fd942c
commit 7b0135c537
3 changed files with 57 additions and 3 deletions

View File

@@ -0,0 +1,27 @@
#!/bin/bash
# Script to run BDD tests with random ports to avoid port conflicts
# Usage: ./scripts/run-tests-with-random-ports.sh [feature]
echo "🚀 Running BDD tests with random ports..."
echo " This prevents port conflicts in parallel test execution"
# Set environment variable for random port selection
export RANDOM_TEST_PORT="true"
# Run the specified feature tests, or all tests if no feature specified
if [ $# -eq 0 ]; then
echo "📋 Running all BDD tests..."
go test ./features/... -v
else
echo "📋 Running tests for feature: $1"
go test ./features/$1/... -v
fi
# Check the exit status
if [ $? -eq 0 ]; then
echo "✅ All tests passed!"
else
echo "❌ Some tests failed"
exit 1
fi