From 165a3873ddba11af43b03397a4b1a035da970662 Mon Sep 17 00:00:00 2001 From: Kiall Mac Innes Date: Sat, 24 Jan 2015 10:59:14 -0800 Subject: [PATCH] Add pretty_tox subunit wrapper Cleans up tox output to be more human friendly, this however does not resolve the logs/stacktraces being shown three times. Partial-Bug: 1413807 Change-Id: I8328b89e6a2d1c3f3dd8bd3218f450a4613ade59 --- test-requirements.txt | 1 + tools/pretty_tox.sh | 6 ++++++ tox.ini | 4 +++- 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100755 tools/pretty_tox.sh diff --git a/test-requirements.txt b/test-requirements.txt index 2166ade51..217ccd7da 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -17,3 +17,4 @@ testtools>=0.9.36,!=1.2.0 testrepository>=0.0.18 testscenarios>=0.4 WebTest>=2.0 +tempest-lib>=0.1.0 diff --git a/tools/pretty_tox.sh b/tools/pretty_tox.sh new file mode 100755 index 000000000..0fc360530 --- /dev/null +++ b/tools/pretty_tox.sh @@ -0,0 +1,6 @@ +#! /bin/sh + +TESTRARGS=$1 + +exec 3>&1 +status=$(exec 4>&1 >&3; ( python setup.py testr --slowest --testr-args="--subunit $TESTRARGS"; echo $? >&4 ) | subunit-trace -f) && exit $status diff --git a/tox.ini b/tox.ini index 6c4cbd42b..59c2e2778 100644 --- a/tox.ini +++ b/tox.ini @@ -14,7 +14,9 @@ deps = -r{toxinidir}/requirements.txt # Note the hash seed is set to 0 until designate can be tested with a # random hash seed successfully. setenv = PYTHONHASHSEED=0 -commands = python setup.py testr --slowest --testr-args='{posargs}' +whitelist_externals = sh +commands = + sh tools/pretty_tox.sh '{posargs}' [testenv:cover] commands = python setup.py testr --coverage --testr-args='{posargs}'