From f9082bf85d8980b14e256364cf13c2130874bdcd Mon Sep 17 00:00:00 2001 From: Alec Warren Date: Thu, 3 Oct 2024 08:27:34 -0400 Subject: [PATCH] ci: fix tox.ini pytest cmd to use cloudinit dir for coverage reporting (#5774) The src code directory for checking code coverage in was erroneously set to "cloud-init" instead of "cloudinit". This prevented unit test coverage from being gathered and reported. --- tox.ini | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 3c432b696c3..25827adf9e8 100644 --- a/tox.ini +++ b/tox.ini @@ -132,7 +132,7 @@ commands = {envpython} -m json.tool --indent 2 {[files]network_v2} {[files]network_v2} [testenv:py3] -commands = {envpython} -m pytest -m "not hypothesis_slow" --cov=cloud-init --cov-branch {posargs:tests/unittests} +commands = {envpython} -m pytest -m "not hypothesis_slow" --cov=cloudinit --cov-branch {posargs:tests/unittests} [testenv:py3-fast] deps = @@ -151,6 +151,15 @@ commands = {envpython} -m pytest \ [testenv:py3-leak] commands = {envpython} -X tracemalloc=40 -Wall -m pytest {posargs:tests/unittests} +# generates html coverage report from the most recent pytest run +[testenv:coverage-html] +deps = {[testenv]deps} +commands = coverage html -i + +# prints out the coverage report "table" from the most recent pytest run +[testenv:coverage-report] +deps = {[testenv]deps} +commands = coverage report -i [testenv:lowest-supported] # Tox is going to install requirements from pip. This is fine for