set -e when checking testr test counts.

* modules/jenkins/files/slave_scripts/run-tox.sh: set -e when checking
test counts so that the case when no tests are found and test complains
about a missing integer expression we fail the Jenkins job.

Change-Id: I2b416637d02d0b87fd3f9ece323e168c039da38b
Reviewed-on: https://review.openstack.org/30818
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Approved: Monty Taylor <mordred@inaugust.com>
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Tested-by: Jenkins
This commit is contained in:
Clark Boylan 2013-05-28 18:57:24 -07:00 committed by Jenkins
parent 38961a4236
commit ff91e70e42

View File

@ -63,6 +63,7 @@ if [ -d ".testrepository" ] ; then
gzip -9 ./subunit_log.txt
gzip -9 ./testr_results.html
set -e
foundcount=$(.tox/$venv/bin/python .tox/$venv/bin/testr list-tests | sed -e '1d' | wc -l)
rancount=$(.tox/$venv/bin/python .tox/$venv/bin/testr last | sed -ne 's/Ran \([0-9]\+\).*tests in.*/\1/p')
if [ "$rancount" -lt "$foundcount" ] ; then
@ -74,6 +75,7 @@ if [ -d ".testrepository" ] ; then
echo
exit 1
fi
set +e
fi
sudo /usr/local/jenkins/slave_scripts/jenkins-sudo-grep.sh post