TT#56376 Restore exit code propogation in t/selenium/testrunner

Jenkins uses wrapper jenkins_docker_run which will mask exit code
anyway and this is what we want currently:
we need always zero exit code here on Jenkins.

Jenkins will detect errors in produced artifacts (XML files) if any
as a result the Jenkins job will be "yellow" instead of "red".

Change-Id: I249fcde9103ee25e6798fcb835ee4a408f8f0f57
changes/68/28768/3
Alexander Lutay 7 years ago
parent 7282fa65b5
commit f0e1f74fc6

@ -1,4 +1,12 @@
#!/bin/bash
# This script is used for running the tests with
# proper arguments from Jenkins under user 'selenium'
su - selenium -c "cd /code && ./t/selenium/testrunner $*"
set -e
su - selenium -c "cd /code && ./t/selenium/testrunner $*" || RC=$?
## Jenkins will detect errors in produced artifacts if any
## as a result the Jenkins job will be "yellow" instead of "red".
[ -n "${RC}" ] && echo "Masking non-zero exit code '${RC}'"
exit 0 # ${RC:-0}

@ -56,6 +56,7 @@ echo "Selenium server log file available at /home/selenium/selenium.log"
echo "Watch at test runs by connecting via VNC (password: '${PASSWORD}'):"
echo "echo -e '$PASSWORD_ENCODED' >/tmp/vncpasswd ; vncviewer geometry=1280x1024x16 passwd=/tmp/vncpasswd localhost:5999"
RC=0
export CATALYST_SERVER="https://${SERVER}:1443"
if [ "${OUTPUT_TYPE:-}" = "junit" ] ; then
prove -ofvm --formatter TAP::Formatter::JUnit -l -It/lib "${TEST_PLAN[@]}" | \
@ -65,13 +66,11 @@ else
prove -ofv --color -l -It/lib "${TEST_PLAN[@]}" || RC=$?
fi
echo "Finished test execution, test execution returned with exit code ${RC:-0}."
echo "Finished test execution, test execution returned with exit code ${RC}."
if [ -f "${OUTPUT_DIRECTORY}/selenium.xml" ] ; then
echo "Test results available at '${OUTPUT_DIRECTORY}/selenium.xml'"
fi
echo "################################################################################"
## exit cleanly here, Jenkins will detect errors in produced artifacts if any
## as a result the Jenkins job will be "yellow" instead of "red".
# exit "${RC}"
exit "${RC}"

Loading…
Cancel
Save