From 9a06348f4740a96270955e914c0450c263c932e2 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Mon, 23 Feb 2015 08:20:44 -0500 Subject: [PATCH] add pretty_tox to nova functional tests debugging tests is a lot easier when you can actually inject stderr directly through even on successes. Add the pretty tox facility from nova / tempest-lib into python-nova client as well for functional tests. Change-Id: I5c1f8244a5c743b590b74a8eb3eaf4a699555644 --- tools/pretty_tox.sh | 16 ++++++++++++++++ tox.ini | 5 ++++- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100755 tools/pretty_tox.sh 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}