diff --git a/setup.cfg b/setup.cfg index 07ef37db..0746fc55 100644 --- a/setup.cfg +++ b/setup.cfg @@ -64,6 +64,7 @@ test = coverage>=3.6 # Apache-2.0 fixtures>=3.0.0 # Apache-2.0/BSD pifpaf>=0.10.0 # Apache-2.0 + os-testr>=0.8.0 # Apache-2.0 doc = sphinx!=1.3b1,<1.3,>=1.2.1 # BSD oslosphinx!=3.4.0,>=2.5.0 # Apache-2.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 e6829294..2d04bf19 100644 --- a/tox.ini +++ b/tox.ini @@ -14,7 +14,7 @@ deps = .[test,zake,ipc,memcached,mysql,etcd] mysql: .[mysql] etcd: .[etcd] consul: .[consul] -commands = python setup.py testr --slowest --testr-args="{posargs}" +commands = {toxinidir}/tools/pretty_tox.sh "{posargs}" [testenv:venv] # This target is used by the gate go run Sphinx to build the doc @@ -22,58 +22,58 @@ deps = .[doc] commands = {posargs} [testenv:py27] -commands = python setup.py testr --slowest --testr-args="{posargs}" +commands = {toxinidir}/tools/pretty_tox.sh "{posargs}" {toxinidir}/run-examples.sh [testenv:py27-zookeeper] -commands = pifpaf -e TOOZ_TEST run zookeeper -- python setup.py testr --slowest --testr-args="{posargs}" +commands = pifpaf -e TOOZ_TEST run zookeeper -- {toxinidir}/tools/pretty_tox.sh "{posargs}" [testenv:py35-zookeeper] -commands = pifpaf -e TOOZ_TEST run zookeeper -- python setup.py testr --slowest --testr-args="{posargs}" +commands = pifpaf -e TOOZ_TEST run zookeeper -- {toxinidir}/tools/pretty_tox.sh "{posargs}" [testenv:py27-redis] -commands = pifpaf -e TOOZ_TEST run redis -- python setup.py testr --slowest --testr-args="{posargs}" +commands = pifpaf -e TOOZ_TEST run redis -- {toxinidir}/tools/pretty_tox.sh "{posargs}" [testenv:py35-redis] -commands = pifpaf -e TOOZ_TEST run redis -- python setup.py testr --slowest --testr-args="{posargs}" +commands = pifpaf -e TOOZ_TEST run redis -- {toxinidir}/tools/pretty_tox.sh "{posargs}" [testenv:py27-sentinel] -commands = pifpaf -e TOOZ_TEST run redis --sentinel -- python setup.py testr --slowest --testr-args="{posargs}" +commands = pifpaf -e TOOZ_TEST run redis --sentinel -- {toxinidir}/tools/pretty_tox.sh "{posargs}" [testenv:py35-sentinel] -commands = pifpaf -e TOOZ_TEST run redis --sentinel -- python setup.py testr --slowest --testr-args="{posargs}" +commands = pifpaf -e TOOZ_TEST run redis --sentinel -- {toxinidir}/tools/pretty_tox.sh "{posargs}" [testenv:py27-memcached] -commands = pifpaf -e TOOZ_TEST run memcached -- python setup.py testr --slowest --testr-args="{posargs}" +commands = pifpaf -e TOOZ_TEST run memcached -- {toxinidir}/tools/pretty_tox.sh "{posargs}" [testenv:py35-memcached] -commands = pifpaf -e TOOZ_TEST run memcached -- python setup.py testr --slowest --testr-args="{posargs}" +commands = pifpaf -e TOOZ_TEST run memcached -- {toxinidir}/tools/pretty_tox.sh "{posargs}" [testenv:py27-postgresql] -commands = pifpaf -e TOOZ_TEST run postgresql -- python setup.py testr --slowest --testr-args="{posargs}" +commands = pifpaf -e TOOZ_TEST run postgresql -- {toxinidir}/tools/pretty_tox.sh "{posargs}" [testenv:py35-postgresql] -commands = pifpaf -e TOOZ_TEST run postgresql -- python setup.py testr --slowest --testr-args="{posargs}" +commands = pifpaf -e TOOZ_TEST run postgresql -- {toxinidir}/tools/pretty_tox.sh "{posargs}" [testenv:py27-mysql] -commands = pifpaf -e TOOZ_TEST run mysql -- python setup.py testr --slowest --testr-args="{posargs}" +commands = pifpaf -e TOOZ_TEST run mysql -- {toxinidir}/tools/pretty_tox.sh "{posargs}" [testenv:py35-mysql] -commands = pifpaf -e TOOZ_TEST run mysql -- python setup.py testr --slowest --testr-args="{posargs}" +commands = pifpaf -e TOOZ_TEST run mysql -- {toxinidir}/tools/pretty_tox.sh "{posargs}" [testenv:py27-etcd] -commands = {toxinidir}/setup-etcd-env.sh pifpaf -g TOOZ_TEST run etcd -- python setup.py testr --slowest --testr-args="{posargs}" - {toxinidir}/setup-etcd-env.sh pifpaf -g TOOZ_TEST run etcd --cluster -- python setup.py testr --slowest --testr-args="{posargs}" +commands = {toxinidir}/setup-etcd-env.sh pifpaf -g TOOZ_TEST run etcd -- {toxinidir}/tools/pretty_tox.sh "{posargs}" + {toxinidir}/setup-etcd-env.sh pifpaf -g TOOZ_TEST run etcd --cluster -- {toxinidir}/tools/pretty_tox.sh "{posargs}" [testenv:py35-etcd] -commands = {toxinidir}/setup-etcd-env.sh pifpaf -g TOOZ_TEST run etcd -- python setup.py testr --slowest --testr-args="{posargs}" - {toxinidir}/setup-etcd-env.sh pifpaf -g TOOZ_TEST run etcd --cluster -- python setup.py testr --slowest --testr-args="{posargs}" +commands = {toxinidir}/setup-etcd-env.sh pifpaf -g TOOZ_TEST run etcd -- {toxinidir}/tools/pretty_tox.sh "{posargs}" + {toxinidir}/setup-etcd-env.sh pifpaf -g TOOZ_TEST run etcd --cluster -- {toxinidir}/tools/pretty_tox.sh "{posargs}" [testenv:py27-consul] -commands = {toxinidir}/setup-consul-env.sh pifpaf -g TOOZ_TEST run consul -- python setup.py testr --slowest --testr-args="{posargs}" +commands = {toxinidir}/setup-consul-env.sh pifpaf -g TOOZ_TEST run consul -- {toxinidir}/tools/pretty_tox.sh "{posargs}" [testenv:py35-consul] -commands = {toxinidir}/setup-consul-env.sh pifpaf -g TOOZ_TEST run consul -- python setup.py testr --slowest --testr-args="{posargs}" +commands = {toxinidir}/setup-consul-env.sh pifpaf -g TOOZ_TEST run consul -- {toxinidir}/tools/pretty_tox.sh "{posargs}" [testenv:cover] commands = python setup.py testr --slowest --coverage --testr-args="{posargs}"