🚀 feat: implement random port selection for BDD tests to prevent conflicts
This commit is contained in:
27
scripts/run-tests-with-random-ports.sh
Executable file
27
scripts/run-tests-with-random-ports.sh
Executable 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
|
||||
Reference in New Issue
Block a user