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 <sfinucan@redhat.com>
This commit is contained in:
Stephen Finucane 2018-10-04 11:18:26 +01:00
parent f14a3b2b73
commit ed77ce858d
3 changed files with 8 additions and 4 deletions

View File

@ -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

View File

@ -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

View File

@ -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