27 lines
728 B
Bash
Executable File
27 lines
728 B
Bash
Executable File
#!/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 |