diff --git a/test-requirements.txt b/test-requirements.txt index fa150f7c..db1748a7 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -8,6 +8,7 @@ python-subunit sphinx>=1.1.2,!=1.2.0,!=1.3b1,<1.3 oslosphinx>=2.5.0 # Apache-2.0 oslotest>=1.5.1 # Apache-2.0 +os-testr>=0.4.1 # Apache-2.0 testrepository>=0.0.18 testscenarios>=0.4 testtools>=1.4.0 diff --git a/tools/pretty_tox.sh b/tools/pretty_tox.sh new file mode 100755 index 00000000..799ac184 --- /dev/null +++ b/tools/pretty_tox.sh @@ -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 diff --git a/tox.ini b/tox.ini index 6ee93c9b..6ce4b829 100644 --- a/tox.ini +++ b/tox.ini @@ -12,7 +12,8 @@ deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt -egit+https://github.com/openstack/nova#egg=nova -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}' [testenv:pep8] commands = flake8