-
Notifications
You must be signed in to change notification settings - Fork 128
/
test-suite-aot.sh
executable file
·73 lines (50 loc) · 1.49 KB
/
test-suite-aot.sh
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
#!/usr/bin/env bash
set -e
EXIT_STATUS=0
attempt_counter=0
max_attempts=5
# generate Auth server ShadowJAR
./gradlew test-suite-aot-authserver:shadowJar > /dev/null
# run this in the background
java -jar test-suite-aot-authserver/build/libs/authserver.jar > /dev/null &
AUTH_PID=$!
until $(curl --output /dev/null --silent --head --fail http://localhost:8081/health); do
if [ ${attempt_counter} -eq ${max_attempts} ];then
echo "Max attempts reached"
killall -9 java
exit 1
fi
attempt_counter=$(($attempt_counter+1))
sleep 5
done
# run this to avoid any gradle caching of the optimizations
./gradlew :test-suite-aot:clean > /dev/null || EXIT_STATUS=$?
if [ $EXIT_STATUS -ne 0 ]; then
killall -9 java
exit $EXIT_STATUS
fi
./gradlew :test-suite-aot:optimizedJitJarAll > /dev/null || EXIT_STATUS=$?
if [ $EXIT_STATUS -ne 0 ]; then
killall -9 java
exit $EXIT_STATUS
fi
# kill auth server. Optimized JAR will work even if auth server is down
killall -9 java
java -jar test-suite-aot/build/libs/test-suite-aot-0.1-all-optimized.jar > /dev/null &
OPTIMIZED_RUN_PID=$!
until $(curl --output /dev/null --silent --head --fail http://localhost:8080); do
if [ ${attempt_counter} -eq ${max_attempts} ];then
echo "Max attempts reached"
killall -9 java
exit 1
fi
attempt_counter=$(($attempt_counter+1))
sleep 5
done
killall -9 java
if [ $EXIT_STATUS -ne 0 ]; then
echo "TEST AOT Failure"
else
echo "TEST AOT Success"
fi
exit $EXIT_STATUS