Skip to content

Commit aed7106

Browse files
author
Konstantinacc
committed
Removed unecessary variable NO_LOGS from seleniumbender bash script.
Tests that send emails when their execution fails (RETVAL!=0), but no logs or reports are attached, used NO_LOGS flag in order for the script to exit. The control is simplified and we check RETVAL variable in order for the script to exit.
1 parent ffe30b3 commit aed7106

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

bin/seleniumbender

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ URL="https://codebender.cc"
6868
email_date=$(date +"%Y-%m-%d %H:%M:%S")
6969

7070
RETVAL=0
71-
NO_LOGS=0 # flag for tests that do not send any logs on their email
7271

7372
if [ "${target}" -eq 1 ]; then
7473
IDENTIFIER="test_target_libraries"
@@ -86,12 +85,10 @@ elif [ "${common}" -eq 1 ]; then
8685
IDENTIFIER="common"
8786
tox tests/common -- --url=${URL} --plugin
8887
RETVAL=$?
89-
NO_LOGS=1
9088
elif [ "${noplugin}" -eq 1 ]; then
9189
IDENTIFIER="noplugin"
9290
tox tests/noplugin -- --url=${URL}
9391
RETVAL=$?
94-
NO_LOGS=1
9592
elif [ "${walkthrough}" -eq 1 ]; then
9693
IDENTIFIER="walkthrough"
9794
RETVALS=()
@@ -117,25 +114,24 @@ elif [ "${walkthrough}" -eq 1 ]; then
117114
RETVAL=${i}
118115
fi
119116
done
120-
NO_LOGS=1
117+
121118
elif [ "${staging}" -eq 1 ]; then
122119
IDENTIFIER="cb_compile_tester_staging"
123120
URL="https://staging.codebender.cc"
124121
tox tests/compile_tester -- --url=${URL} -F --plugin
125-
# No need to send email for tests in staging
122+
# No need to send email for tests in staging.
126123
exit $?
127124
fi
128125

129-
# email notification without attaching any logs
126+
# Email notification without attaching any logs (options: common, noplugin, walkthrough).
130127
if [ ${RETVAL} -ne 0 ]; then
131128
mail -s "Selenium Tests: ${IDENTIFIER} Failed To Run" ${EMAIL} <<< "Something went wrong with ${IDENTIFIER} tests. Please check the logs."
132-
fi
133-
134-
if [ ${NO_LOGS} -eq 1 ]; then
129+
exit ${RETVAL}
130+
elif [ ${RETVAL} -eq 0 ]; then
135131
exit ${RETVAL}
136132
fi
137133

138-
# email notification with attaching the produced reports
134+
# Email notification attaching the produced logs/reports(options: target, examples, libraries, sketches).
139135
LOGS="${ROOTDIR}/logs"
140136
REPORTS="${ROOTDIR}/reports"
141137

0 commit comments

Comments
 (0)