forked from joshlong-attic/bootiful-reactive-microservices
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscenario_finchley_tester.sh
executable file
·92 lines (69 loc) · 2.64 KB
/
scenario_finchley_tester.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/usr/bin/env bash
source common.sh || source scripts/common.sh || echo "No common.sh script found..."
set -o errexit
set -o errtrace
set -o pipefail
export BOM_VERSION="Finchley.BUILD-SNAPSHOT"
export PROFILE="finchley"
export EXTERNAL_IP
EXTERNAL_IP="$( "${ROOT_FOLDER}"/scripts/whats_my_ip.sh )"
echo "External IP equals [${EXTERNAL_IP}]"
echo "Ensure that apps are not running"
kill_all_apps
echo -e "Ensure that all the apps are built with $BOM_VERSION!\n"
build_all_apps
cat <<EOF
This Bash file will run all the apps required for Edgware tests.
NOTE:
- you need internet connection for the apps to download configuration from Github.
- you need docker-compose for RabbitMQ to start
- you need python to calculate current millis
We will do it in the following way:
01) Run config-server
02) Wait for the app (config-server) to boot (port: 8888)
03) Run eureka-service
04) Wait for the app (eureka-service) to boot (port: 8761)
05) Run reservation-client
06) Wait for the app (reservation-client) to boot (port: 9999)
07) Wait for the app (reservation-client) to register in Eureka Server
08) Run reservation-service
09) Wait for the app (reservation-service) to boot (port: 8000)
10) Wait for the app (reservation-service) to register in Eureka Server
11) Run zipkin-service
12) Wait for the app (zipkin-server) to boot (port: 9411)
13) Send a test request to populate some entries in Zipkin
14) Check if Zipkin has stored the trace for the aforementioned request
EOF
# Runs tests for a given language (java / kotlin)
function run_tests() {
setup_infra
cd ${ROOT_FOLDER}/${PROFILE}
echo "Running tests for ${1}"
pushd "${ROOT_FOLDER}/${PROFILE}/${1}"
java_jar config-service "-Dserver.port=8888"
wait_for_app_to_boot_on_port 8888
java_jar eureka-service "-Dserver.port=8761"
wait_for_app_to_boot_on_port 8761
clientPort="9999"
java_jar reservation-client "-Dserver.port=${clientPort}"
wait_for_app_to_boot_on_port "${clientPort}"
check_app_presence_in_discovery RESERVATION-CLIENT
serverPort="8000"
java_jar reservation-service "-Dserver.port=${serverPort}"
wait_for_app_to_boot_on_port "${serverPort}"
check_app_presence_in_discovery RESERVATION-SERVICE
#download_zipkin
#java_jar_zipkin
#wait_for_legacy_app_to_boot_on_port 9411
#send_test_request 9999 "reservations/names/"
#echo -e "\n\nThe ${BOM_VERSION} Reservation client successfully responded to the call"
#check_trace
#check_span_names
echo -e "\n\nWill not check Zipkin since rsocket is used\n\n"
popd
}
cd ${ROOT_FOLDER}
run_tests "java"
kill_all
run_tests "kotlin"
echo "Leaving apps running to click around"