-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrun-all-tests.sh
More file actions
executable file
·86 lines (75 loc) · 2.23 KB
/
run-all-tests.sh
File metadata and controls
executable file
·86 lines (75 loc) · 2.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/usr/bin/env bash
set -uo pipefail
# set test
JAVA_TEST_CMD=(mvn -Dtest=IntegrationTests test)
SWIFT_TEST_CMD=(swift test --filter SignalRClientIntegrationTests)
DOTNET_TEST_CMD=(dotnet test --logger:"console;verbosity=normal")
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
export SIGNALR_INTEGRATION_TEST_URL="http://localhost:8080/test"
# Check E2E_CONNECTION_STRING
if [ -z "$E2E_CONNECTION_STRING" ]; then
# Print an error message to standard error (stderr)
echo "❌ ERROR: The E2E_CONNECTION_STRING environment variable is not set or is empty." >&2
# Exit with a non-zero status code (indicating failure)
exit 1
fi
# Print Configuration
echo "==> Test Configuration:"
echo "SIGNALR_INTEGRATION_TEST_URL=${SIGNALR_INTEGRATION_TEST_URL}"
echo "JAVA_TEST_CMD: ${JAVA_TEST_CMD[*]}"
echo "SWIFT_TEST_CMD: ${SWIFT_TEST_CMD[*]}"
echo "DOTNET_TEST_CMD: ${DOTNET_TEST_CMD[*]}"
echo "E2E_CONNECTION_STRING=\"${E2E_CONNECTION_STRING:0:20}...${E2E_CONNECTION_STRING: -20}\""
# Run Server
echo "==> Running Test Server..."
(
cd "$REPO_ROOT/server"
export Azure__SignalR__ConnectionString="${E2E_CONNECTION_STRING}"
dotnet run -p:DefineConstants="USE_AZURE_SIGNALR" > test-server.log 2>&1 &
sleep 5
)
failures=0
# Run different language tests
echo "==> Running Java tests..."
(
cd "$REPO_ROOT/java"
"${JAVA_TEST_CMD[@]}"
)
java_status=$?
if [[ $java_status -ne 0 ]]; then
echo "Java tests failed with exit code ${java_status}"
failures=1
else
echo "Java tests passed"
fi
echo "==> Running Swift tests..."
(
cd "$REPO_ROOT/swift"
"${SWIFT_TEST_CMD[@]}"
)
swift_status=$?
if [[ $swift_status -ne 0 ]]; then
echo "Swift tests failed with exit code ${swift_status}"
failures=1
else
echo "Swift tests passed"
fi
echo "==> Running .NET tests..."
(
cd "$REPO_ROOT/dotnet/test/Microsoft.Azure.SignalR.E2ETests"
export Azure__SignalR__ConnectionString="${E2E_CONNECTION_STRING}"
"${DOTNET_TEST_CMD[@]}"
)
dotnet_status=$?
if [[ $dotnet_status -ne 0 ]]; then
echo ".NET tests failed with exit code ${dotnet_status}"
failures=1
else
echo ".NET tests passed"
fi
if [[ $failures -ne 0 ]]; then
echo "==> Summary: at least one test suite failed. See logs above."
exit -1
fi
echo "==> Summary: all test suites passed."
exit 0