Skip to content

Commit abf5284

Browse files
authored
Fix bug in script,catch crashes too (#1056)
Add verification of exitcode is not-zero after gtest run of functional test. Relates-To: OLPEDGE-2297 Signed-off-by: Yaroslav Stefinko <ext-yaroslav.stefinko@here.com>
1 parent 482d553 commit abf5284

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

scripts/linux/fv/gitlab_test_fv.sh

+15-11
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ ulimit -c unlimited
4646
# Stop after 2nd retry.
4747
source ${FV_HOME}/olp-cpp-sdk-functional-test.variables
4848
set +e
49-
for RETRY_COUNT in 1 2
49+
for RETRY_COUNT in 1 2 3
5050
do
5151
echo "This is (${RETRY_COUNT}) time run ..."
5252

@@ -55,15 +55,20 @@ do
5555

5656
if [[ $? -eq 1 ]]; then
5757
# Functional test failed with exit code 1 means some tests failed
58+
# But we handle flacky test and repeat up to 3 times
5859
TEST_FAILURE=1
5960
sleep 10
61+
elif [[ $? -gt 1 ]]; then
62+
# Functional test crashed
63+
result=$?
64+
set -e
65+
exit $result
6066
else
6167
# Return to success
6268
TEST_FAILURE=0
6369
break
6470
fi
6571
done
66-
set -e
6772
# End of retry part. This part can be removed any time later or after all online tests are stable.
6873

6974
# Run functional tests with Mock Server
@@ -88,19 +93,18 @@ ${FV_HOME}/gitlab-olp-cpp-sdk-dataservice-write-test.sh || TEST_FAILURE=1
8893

8994

9095
# Lines below are added for pretty data sum-up and finalize results of this script is case of FAILURE
91-
set +x # to avoid dirty output at the end on logs
92-
if [[ ${TEST_FAILURE} == 1 ]]; then
93-
export REPORT_COUNT=$(ls ${REPO_HOME}/reports | wc -l)
94-
if [[ ${REPORT_COUNT} -ne ${EXPECTED_REPORT_COUNT} || ${REPORT_COUNT} == 0 ]]; then
95-
echo "##################################################################################################"
96-
echo "CRASH ERROR. One of test groups contains crash. Report was not generated for that group ! "
97-
echo "##################################################################################################"
98-
fi
96+
# set +x to avoid dirty output at the end on logs
97+
set +x
98+
export REPORT_COUNT=$(ls ${REPO_HOME}/reports | wc -l)
99+
if [[ ${REPORT_COUNT} -ne ${EXPECTED_REPORT_COUNT} || ${REPORT_COUNT} == 0 ]]; then
100+
echo "##################################################################################################"
101+
echo "CRASH ERROR. One of test groups contains crash. Report was not generated for that group ! "
102+
echo "##################################################################################################"
103+
TEST_FAILURE=1
99104
else
100105
echo "OK. Full list of test reports was generated. "
101106
fi
102107

103-
104108
for failreport in $(ls ${REPO_HOME}/reports/*.xml)
105109
do
106110
echo "Parsing ${failreport} ..."

0 commit comments

Comments
 (0)