From ff91e70e4251ec2740fa000f3ada250f83b87dab Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Tue, 28 May 2013 18:57:24 -0700 Subject: [PATCH] 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 Reviewed-by: James E. Blair Approved: Monty Taylor Reviewed-by: Monty Taylor Tested-by: Jenkins --- modules/jenkins/files/slave_scripts/run-tox.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/jenkins/files/slave_scripts/run-tox.sh b/modules/jenkins/files/slave_scripts/run-tox.sh index 7bff4a5c49..b9df7a2f60 100755 --- a/modules/jenkins/files/slave_scripts/run-tox.sh +++ b/modules/jenkins/files/slave_scripts/run-tox.sh @@ -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