From ed77ce858d1d6824519ed5f33b68c546de0f5ad1 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Thu, 4 Oct 2018 11:18:26 +0100 Subject: [PATCH] tox: Suppress output Since the switch to stestr in commit 2222dbb47, the tests have taken to spewing a load of noise. This seems to be because we dropped the configuration for OS_STDOUT_CAPTURE and OS_STDERR_CAPTURE, which was previously configured in '.testr.conf'. This is fixed. However, it seems it's also necessary to explicitly pass the '--suppress-attachments' option to 'stestr' to properly silence things. This seems to be necessary because many pbr commands output to stdout by default, while other projects (nova, etc.) use 'logging'. Use of this option requires stestr 2.1.0 [1] so we bump the lower-constraint. As an aside, finding out what caused this output was easier said than done. I tried stestr, testr and fixtures, before finally finding it in subunit. [1] https://github.com/mtreinish/stestr/commit/1316ebd7 Change-Id: I1678bcd26b41fdf09f98c36fc095d6d4c1826deb Signed-off-by: Stephen Finucane --- lower-constraints.txt | 2 +- test-requirements.txt | 2 +- tox.ini | 8 ++++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lower-constraints.txt b/lower-constraints.txt index 44956cef..173a299c 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -26,7 +26,7 @@ six==1.10.0 snowballstemmer==1.2.1 Sphinx==1.6.5 sphinxcontrib-websupport==1.0.1 -stestr==2.0.0 +stestr==2.1.0 testrepository==0.0.18 testresources==2.0.0 testscenarios==0.4 diff --git a/test-requirements.txt b/test-requirements.txt index e7ecf83c..8c3e70e6 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -6,7 +6,7 @@ fixtures>=3.0.0 # Apache-2.0/BSD hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0 mock>=2.0.0 # BSD six>=1.10.0 # MIT -stestr>=2.0.0 # Apache-2.0 +stestr>=2.1.0 # Apache-2.0 testresources>=2.0.0 # Apache-2.0/BSD testscenarios>=0.4 # Apache-2.0/BSD testtools>=2.2.0 # MIT diff --git a/tox.ini b/tox.ini index d97e6ff7..4d460d8b 100644 --- a/tox.ini +++ b/tox.ini @@ -5,11 +5,15 @@ envlist = py{27,35,36},pep8,docs [testenv] usedevelop = True install_command = pip install {opts} {packages} -passenv = PBR_INTEGRATION PIPFLAGS PIPVERSION PBRVERSION REPODIR WHEELHOUSE PROJECTS OS_TEST_TIMEOUT OS_STDOUT_CAPTURE OS_STDERR_CAPTURE +passenv = PBR_INTEGRATION PIPFLAGS PIPVERSION PBRVERSION REPODIR WHEELHOUSE PROJECTS +setenv = + OS_STDOUT_CAPTURE={env:OS_STDOUT_CAPTURE:1} + OS_STDERR_CAPTURE={env:OS_STDERR_CAPTURE:1} + OS_TEST_TIMEOUT={env:OS_TEST_TIMEOUT:60} deps = -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} -r{toxinidir}/test-requirements.txt -commands = stestr run {posargs} +commands = stestr run --suppress-attachments {posargs} [testenv:pep8] basepython = python3