From e858c7e50a477ec772cdfbe3d342ddadd59bf1fe Mon Sep 17 00:00:00 2001 From: Dan Smith Date: Mon, 22 Jul 2024 08:00:50 -0700 Subject: [PATCH] Fix coverage target This imports the [cover] target content from nova, which works. The existing one here fails with a setup.py complaint about the test command being missing. Trying the content from oslo_log does not work either. Change-Id: Ifc7b1a8bac54a826e6c197825a3e2f98b67323f1 --- tox.ini | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 1c57188a..b485dd3e 100644 --- a/tox.ini +++ b/tox.ini @@ -30,7 +30,20 @@ commands = sphinx-build -W --keep-going -b html doc/source doc/build/html [testenv:cover] -commands = python setup.py test --coverage --coverage-package-name=oslo_utils --testr-args='{posargs}' +# TODO(stephenfin): Remove the PYTHON hack below in favour of a [coverage] +# section once we rely on coverage 4.3+ +# +# https://bitbucket.org/ned/coveragepy/issues/519/ +setenv = + PYTHON=coverage run --source oslo_utils --parallel-mode +extras = +commands = + coverage erase + stestr run {posargs} + coverage combine + coverage html -d cover + coverage xml -o cover/coverage.xml + coverage report [flake8] # E731 skipped as assign a lambda expression