Skip to content

Commit 72ba54b

Browse files
committed
Modify retry mechanism for NV/FV online tests.
Retry will run only for return code 1. Means will run only in gtest failure. Crashes will not be retried. Also changed order FV test groups running. Relates-to: OLPEDGE-1144 Signed-off-by: Yaroslav Stefinko <[email protected]>
1 parent dd20ec0 commit 72ba54b

File tree

3 files changed

+26
-21
lines changed

3 files changed

+26
-21
lines changed

scripts/linux/fv/gitlab-olp-cpp-sdk-functional-test.sh

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,26 +33,28 @@ do
3333
sleep 0.15
3434
set -e
3535
done
36-
3736
result=0
3837
echo ">>> Functional Test ... >>>"
3938
source $FV_HOME/olp-cpp-sdk-functional-test.variables
4039
$REPO_HOME/build/tests/functional/olp-cpp-sdk-functional-tests \
4140
--gtest_output="xml:$REPO_HOME/reports/olp-functional-test-report.xml" \
42-
--gtest_filter="-ArcGisAuthenticationTest.SignInArcGis":"FacebookAuthenticationTest.SignInFacebook" || result=1
43-
44-
# Add retry to functional/online tests. Some online tests are flaky due to third party reason.
41+
--gtest_filter="-ArcGisAuthenticationTest.SignInArcGis":"FacebookAuthenticationTest.SignInFacebook"
42+
result=$?
4543
echo "Last return code in $result"
46-
count=0
47-
while [[ ${result} -ne 0 ]];
44+
45+
# Add retry to functional/online tests. Some online tests are flaky due to third party reason
46+
# Test failure should return code 1
47+
retry_count=0
48+
while [[ ${result} = 1 ]];
4849
do
49-
count=$((count+1)) && echo "This is ${count} time retry ..."
50+
retry_count=$((retry_count+1)) && echo "This is ${retry_count} time retry ..."
5051
$REPO_HOME/build/tests/functional/olp-cpp-sdk-functional-tests \
5152
--gtest_output="xml:$REPO_HOME/reports/olp-functional-test-report.xml" \
52-
--gtest_filter="-ArcGisAuthenticationTest.SignInArcGis":"FacebookAuthenticationTest.SignInFacebook" || result=1
53+
--gtest_filter="-ArcGisAuthenticationTest.SignInArcGis":"FacebookAuthenticationTest.SignInFacebook"
54+
result=$?
5355

5456
# Stop after 3 retry
55-
if [[ ${count} = 3 ]]; then
57+
if [[ ${retry_count} = 3 ]]; then
5658
break
5759
fi
5860
done

scripts/linux/fv/gitlab_test_fv.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ ${FV_HOME}/gitlab-olp-cpp-sdk-core-test.sh 2>> errors.txt || TEST_FAILURE=1
4141
${FV_HOME}/gitlab-olp-cpp-sdk-dataservice-read-test.sh 2>> errors.txt || TEST_FAILURE=1
4242
${FV_HOME}/gitlab-olp-cpp-sdk-dataservice-write-test.sh 2>> errors.txt || TEST_FAILURE=1
4343

44-
# Run integration tests
45-
${FV_HOME}/gitlab-olp-cpp-sdk-integration-test.sh 2>> errors.txt || TEST_FAILURE=1
46-
4744
# Run functional tests
4845
${FV_HOME}/gitlab-olp-cpp-sdk-functional-test.sh 2>> errors.txt || TEST_FAILURE=1
4946

47+
# Run integration tests
48+
${FV_HOME}/gitlab-olp-cpp-sdk-integration-test.sh 2>> errors.txt || TEST_FAILURE=1
49+
5050
# Lines below are added for pretty data sum-up and finalize results of this script is case of FAILURE
5151
if [[ ${TEST_FAILURE} == 1 ]]; then
5252
export REPORT_COUNT=$(ls ${REPO_HOME}/reports | wc -l)

scripts/linux/nv/gitlab_test_valgrind.sh

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ do
5656
set -e
5757
done
5858
echo ">>> Local Server started for further functional test ... >>>"
59-
result=0
6059

6160
### Running two auto-test groups
6261
for test_group_name in integration functional
@@ -81,20 +80,23 @@ do
8180
test_command="export GLIBCXX_FORCE_NEW=; ${valgrind_command} ${test_command}"
8281

8382
echo "-----> Calling \"${test_command}\" for ${test_group_name} : "
84-
eval "${test_command}" || result=1
83+
eval "${test_command}"
84+
result=$?
8585
echo "-----> Finished ${test_group_name} - Result=${result}"
8686

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" ]];
87+
# Add retry to functional/online tests. Some online tests are flaky due to third party reason
88+
# Test failure should return code 1
89+
retry_count=0
90+
while [[ ${result} = 1 && ${test_group_name} == "functional" ]];
9091
do
91-
count=$((count+1)) && echo "This is ${count} time retry ..."
92+
retry_count=$((retry_count+1)) && echo "This is ${retry_count} time retry ..."
9293
echo "-----> Calling \"${test_command}\" for ${test_group_name} : "
93-
eval "${test_command}" || result=1
94+
eval "${test_command}"
95+
result=$?
9496
echo "-----> Finished ${test_group_name} - Result=${result}"
9597

9698
# Stop after 3 retry
97-
if [[ ${count} = 3 ]]; then
99+
if [[ ${retry_count} = 3 ]]; then
98100
break
99101
fi
100102
done
@@ -124,7 +126,8 @@ do
124126
test_command="export GLIBCXX_FORCE_NEW=; $valgrind_command $test_command"
125127

126128
echo "-----> Calling $test_command for $test_name : "
127-
eval "${test_command}" || result=1
129+
eval "${test_command}"
130+
result=$?
128131
echo "-----> Finished $test_name - Result=$result"
129132
}
130133
done

0 commit comments

Comments
 (0)