-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.sh
54 lines (46 loc) · 1.29 KB
/
test.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
#!/bin/bash
# Init local environment
docker-compose up -d
if [ $? -ne 0 ]; then
echo "Failure on local environment initialisation. Aborting..."
docker-compose down
exit 1
fi
# Wait until Logistics is up and running
until [ $(curl -w '%{http_code}' -o /dev/null -s http://localhost:8080/logistics/) -eq 200 ]; do
echo "Still waiting Logistics - sleeping 2s..."
sleep 2
done
# Init submodules
git submodule update --init --recursive
# Run the Integration test
mvn -f test-arquillian test
if [ $? -ne 0 ]; then
echo "Failure on Integration test. Aborting..."
docker-compose down
exit 1
fi
# Run the API test
mvn -f test-restassured test -Dserver.host=http://localhost -Dserver.port=8080
if [ $? -ne 0 ]; then
echo "Failure on API test. Aborting..."
docker-compose down
exit 1
fi
# Run the UI test
docker run --rm --network host -e LOGISTICS_URL=http://localhost:8080/logistics esignbr/logistics-test-selenium
if [ $? -ne 0 ]; then
echo "Failure on UI test. Aborting..."
docker-compose down
exit 1
fi
# Run the Load test
mvn -f test-jmeter clean verify -Dserver.host=localhost -Dserver.port=8080
if [ $? -ne 0 ]; then
echo "Failure on Load test. Aborting..."
docker-compose down
exit 1
fi
# Shutdown local environment
docker-compose down
exit 0