Pass testr and subunit2html.py a PYTHON envvar.

* modules/jenkins/files/slave_scripts/run-tox.sh: Some subprocesses
of testr get invoked from the calling environment's configured
interpreter regardless of what interpreter was used to invoke the
parent process. Put that in a PYTHON envvar instead of on the
command line.

* modules/jenkins/files/slave_scripts/subunit2html.py: Fix this
script to invoke the interpreter specified by the calling
environment instead of using an explicit executable path in its
shebang.

Change-Id: Id27e4a280e88b2ce386af6e9f248b1c4e004583a
This commit is contained in:
Jeremy Stanley 2013-07-31 20:54:46 +00:00
parent a16059c112
commit 983ca1106c
2 changed files with 5 additions and 4 deletions

View File

@ -59,13 +59,14 @@ if [ -d ".testrepository" ] ; then
elif [ -f ".testrepository/0" ] ; then elif [ -f ".testrepository/0" ] ; then
cp .testrepository/0 ./subunit_log.txt cp .testrepository/0 ./subunit_log.txt
fi fi
.tox/$venv/bin/python /usr/local/jenkins/slave_scripts/subunit2html.py ./subunit_log.txt testr_results.html export PYTHON=.tox/$venv/bin/python
/usr/local/jenkins/slave_scripts/subunit2html.py ./subunit_log.txt testr_results.html
gzip -9 ./subunit_log.txt gzip -9 ./subunit_log.txt
gzip -9 ./testr_results.html gzip -9 ./testr_results.html
set -e set -e
foundcount=$(.tox/$venv/bin/python .tox/$venv/bin/testr list-tests | sed -e '1d' | wc -l) foundcount=$(.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/testr last | sed -ne 's/Ran \([0-9]\+\).*tests in.*/\1/p')
if [ "$rancount" -lt "$foundcount" ] ; then if [ "$rancount" -lt "$foundcount" ] ; then
echo echo
echo "The number of tests found was greater than the number of tests" echo "The number of tests found was greater than the number of tests"

View File

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/env python
""" """
Utility to convert a subunit stream to an html results file. Utility to convert a subunit stream to an html results file.
Code is adapted from the pyunit Html test runner at Code is adapted from the pyunit Html test runner at