-
-
Notifications
You must be signed in to change notification settings - Fork 468
Expand file tree
/
Copy pathsystem-test-run.sh
More file actions
executable file
·31 lines (23 loc) · 1.05 KB
/
system-test-run.sh
File metadata and controls
executable file
·31 lines (23 loc) · 1.05 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
#!/usr/bin/env bash
readonly SAMPLE_MODULE=$1
readonly JAVA_AGENT=$2
readonly JAVA_AGENT_AUTO_INIT=$3
readonly BUILD_BEFORE_RUN=$4
if [[ "$BUILD_BEFORE_RUN" == "1" ]]; then
echo "Building before Test run"
./gradlew :sentry-samples:${SAMPLE_MODULE}:assemble
fi
test/system-test-sentry-server-start.sh
MOCK_SERVER_PID=$(cat sentry-mock-server.pid)
echo "started mock server ${SAMPLE_MODULE}-${JAVA_AGENT}-${JAVA_AGENT_AUTO_INIT} with PID ${MOCK_SERVER_PID}"
test/system-test-spring-server-start.sh "${SAMPLE_MODULE}" "${JAVA_AGENT}" "${JAVA_AGENT_AUTO_INIT}"
SUT_PID=$(cat spring-server.pid)
echo "started spring server ${SAMPLE_MODULE}-${JAVA_AGENT}-${JAVA_AGENT_AUTO_INIT} with PID ${SUT_PID}"
test/wait-for-spring.sh
./gradlew :sentry-samples:${SAMPLE_MODULE}:systemTest
TESTRUN_RETVAL=$?
echo "killing mock server ${SAMPLE_MODULE}-${JAVA_AGENT}-${JAVA_AGENT_AUTO_INIT} with PID ${MOCK_SERVER_PID}"
kill $SUT_PID
echo "killing spring server ${SAMPLE_MODULE}-${JAVA_AGENT}-${JAVA_AGENT_AUTO_INIT} with PID ${SUT_PID}"
kill $MOCK_SERVER_PID
exit $TESTRUN_RETVAL