From 027d5d263cc03409a06ad114925d95e488c8ca1c Mon Sep 17 00:00:00 2001 From: John Garbutt Date: Tue, 2 May 2023 14:30:48 +0100 Subject: [PATCH] Fix up tox -e cover to use coverage Change-Id: I4516a958efd4b14a6d0f9f8a7763311f134c5215 --- .converagerc | 7 +++++++ test-requirements.txt | 2 ++ tox.ini | 8 +++++++- 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 .converagerc diff --git a/.converagerc b/.converagerc new file mode 100644 index 0000000..461ec33 --- /dev/null +++ b/.converagerc @@ -0,0 +1,7 @@ +[run] +branch = True +source = oslo_limit +omit = oslo_limit/tests/* + +[report] +ignore_errors = True diff --git a/test-requirements.txt b/test-requirements.txt index 049cf85..7d6094f 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -7,6 +7,8 @@ hacking>=3.0.1,<3.1.0 # Apache-2.0 oslotest>=3.2.0 # Apache-2.0 stestr>=1.0.0 # Apache-2.0 +coverage!=4.4,>=4.0 # Apache-2.0 + # Bandit security code scanner bandit>=1.7.0,<1.8.0 # Apache-2.0 diff --git a/tox.ini b/tox.ini index 54c1f12..9e084c1 100644 --- a/tox.ini +++ b/tox.ini @@ -34,7 +34,13 @@ 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_limit --testr-args='{posargs}' +setenv = + PYTHON=coverage run --source oslo_limit --parallel-mode +commands = + stestr run --slowest {posargs} + coverage combine + coverage html -d cover + coverage report [testenv:releasenotes] allowlist_externals = rm