Port over pretty_tox.sh from nova-powervm

nova-powervm has a bash script that uses the ostestr package to
format the output from tox in a 'pretty' format. It makes it
much more readable. pretty_tox.sh is pulled from Nova and
nova-powervm as-is and enabled in tox.ini.

Change-Id: I9e90c4d595b95ae02be244163f27d87409e3a078
This commit is contained in:
kairoaraujo 2016-02-10 12:41:38 -02:00
parent 1d895f4b6f
commit 2bb305dd39
3 changed files with 19 additions and 1 deletions

View File

@ -9,6 +9,7 @@ testrepository>=0.0.18
testscenarios>=0.4
testtools>=1.4.0 # MIT
oslotest>=1.10.0 # Apache-2.0
os-testr>=0.4.1 # Apache-2.0
sphinx>=1.1.2,!=1.2.0,!=1.3b1,<1.3
oslosphinx>=2.5.0,!=3.4.0 # Apache-2.0
mock>=1.2 # BSD

16
tools/pretty_tox.sh Normal file
View File

@ -0,0 +1,16 @@
#!/usr/bin/env bash
set -o pipefail
TESTRARGS=$1
# --until-failure is not compatible with --subunit see:
#
# https://bugs.launchpad.net/testrepository/+bug/1411804
#
# this work around exists until that is addressed
if [[ "$TESTARGS" =~ "until-failure" ]]; then
python setup.py testr --slowest --testr-args="$TESTRARGS"
else
python setup.py testr --slowest --testr-args="--subunit $TESTRARGS" | subunit-trace -f
fi

View File

@ -12,7 +12,8 @@ deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
-egit+https://github.com/openstack/ceilometer#egg=ceilometer
-egit+https://github.com/powervm/pypowervm@develop#egg=pypowervm
commands = python setup.py testr --slowest --testr-args="{posargs}"
whitelist_externals = bash
commands = bash tools/pretty_tox.sh '{posargs}'
downloadcache = {toxworkdir}/_download
[testenv:pep8]