File tree Expand file tree Collapse file tree 2 files changed +43
-5
lines changed
Expand file tree Collapse file tree 2 files changed +43
-5
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ node $REPO_HOME/tests/utils/mock_server/server.js & export SERVER_PID=$!
2525# Add waiter for server to be started. No other way to solve that.
2626# Curl returns code 1 - means server still down. Curl returns 0 when server is up
2727RC=1
28- while [ $RC -ne 0 ];
28+ while [[ ${RC} -ne 0 ] ];
2929do
3030 set +e
3131 curl -s http://localhost:3000
@@ -40,6 +40,26 @@ $REPO_HOME/build/tests/functional/olp-cpp-sdk-functional-tests \
4040 --gtest_output=" xml:$REPO_HOME /reports/olp-functional-test-report.xml" \
4141 --gtest_filter=" -ArcGisAuthenticationTest.SignInArcGis" :" FacebookAuthenticationTest.SignInFacebook"
4242
43- # Kill local server
44- kill -15 $SERVER_PID
45- wait $SERVER_PID # Waiter for server process to be exited correctly
43+ # Add retry to functional/online tests. Some online tests are flaky due to third party reason.
44+ result=$?
45+ count=0
46+ while [[ ${result} -ne 0 ]];
47+ do
48+ count=count+1
49+ echo " This is ${count} time retry ..."
50+ $REPO_HOME /build/tests/functional/olp-cpp-sdk-functional-tests \
51+ --gtest_output=" xml:$REPO_HOME /reports/olp-functional-test-report.xml" \
52+ --gtest_filter=" -ArcGisAuthenticationTest.SignInArcGis" :" FacebookAuthenticationTest.SignInFacebook"
53+ result=$?
54+
55+ # Stop after 3 retry
56+ if [[ ${count} = 3 ]]; then
57+ break
58+ fi
59+ done
60+ # End of retry part. This part can be removed anytime.
61+
62+ # Kill local server
63+ kill -15 ${SERVER_PID}
64+ # Waiter for server process to be exited correctly
65+ wait ${SERVER_PID}
Original file line number Diff line number Diff line change 8383 eval " ${test_command} "
8484 result=$?
8585 echo " -----> Finished ${test_group_name} - Result=${result} "
86+
87+ # Add retry to functional/online tests. Some online tests are flaky due to third party reason.
88+ count=0
89+ while [[ ${result} -ne 0 && ${test_group_name} == " functional" ]];
90+ do
91+ count=count+1
92+ echo " This is ${count} time retry ..."
93+ echo " -----> Calling \" ${test_command} \" for ${test_group_name} : "
94+ eval " ${test_command} "
95+ result=$?
96+ echo " -----> Finished ${test_group_name} - Result=${result} "
97+
98+ # Stop after 3 retry
99+ if [[ ${count} = 3 ]]; then
100+ break
101+ fi
102+ done
103+ # End of retry part. This part can be removed anytime.
86104}
87105done
88106
@@ -139,4 +157,4 @@ echo "Artifacts download URL: ${CI_PROJECT_URL}-/jobs/${CI_JOB_ID}/artifacts/dow
139157
140158if [[ ${result} -ne 0 ]]; then
141159 exit ${result}
142- fi
160+ fi
You can’t perform that action at this time.
0 commit comments