diff --git a/tools/pretty_tox.sh b/tools/pretty_tox.sh new file mode 100755 index 000000000..799ac1848 --- /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 0ea5da95b..11492c8ae 100644 --- a/tox.ini +++ b/tox.ini @@ -8,6 +8,7 @@ skipsdist = True usedevelop = True # tox is silly... these need to be separated by a newline.... whitelist_externals = find + bash install_command = pip install -U {opts} {packages} setenv = VIRTUAL_ENV={envdir} @@ -15,7 +16,9 @@ deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands = find . -type f -name "*.pyc" -delete - python setup.py testr --testr-args='{posargs}' + bash tools/pretty_tox.sh '{posargs}' + # there is also secret magic in pretty_tox.sh which lets you run in a fail only + # mode. To do this define the TRACE_FAILONLY environmental variable. [testenv:pep8] commands = flake8 {posargs}