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:
parent
38961a4236
commit
ff91e70e42
@ -63,6 +63,7 @@ if [ -d ".testrepository" ] ; then
|
|||||||
gzip -9 ./subunit_log.txt
|
gzip -9 ./subunit_log.txt
|
||||||
gzip -9 ./testr_results.html
|
gzip -9 ./testr_results.html
|
||||||
|
|
||||||
|
set -e
|
||||||
foundcount=$(.tox/$venv/bin/python .tox/$venv/bin/testr list-tests | sed -e '1d' | wc -l)
|
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')
|
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
|
if [ "$rancount" -lt "$foundcount" ] ; then
|
||||||
@ -74,6 +75,7 @@ if [ -d ".testrepository" ] ; then
|
|||||||
echo
|
echo
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
set +e
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sudo /usr/local/jenkins/slave_scripts/jenkins-sudo-grep.sh post
|
sudo /usr/local/jenkins/slave_scripts/jenkins-sudo-grep.sh post
|
||||||
|
Loading…
Reference in New Issue
Block a user