Add coverage configuration for tox

Change-Id: I0b2366116d0191e2189db3d9439f1b17cb9f38af
This commit is contained in:
wangwei1 2020-05-15 17:26:22 +08:00
parent 45fefb8171
commit 0826f888c6
5 changed files with 27 additions and 1 deletions

11
.coveragerc Normal file
View File

@ -0,0 +1,11 @@
[run]
branch = True
source = ironic_prometheus_exporter
omit = *tests*
[report]
ignore_errors = True
omit = *tests*
[html]
directory = cover

View File

@ -87,6 +87,7 @@
- openstack-python3-victoria-jobs
- release-notes-jobs-python3
- publish-openstack-docs-pti
- openstack-cover-jobs
check:
jobs:
- ironic-prometheus-exporter-redfish

View File

@ -8,6 +8,7 @@ chardet==3.0.4
click==7.1.1
cliff==3.1.0
cmd2==0.8.9
coverage==4.0
cryptography==2.9
debtcollector==2.0.0
decorator==4.4.2
@ -95,4 +96,4 @@ WebOb==1.8.6
Werkzeug==1.0.1
wrapt==1.12.1
yappi==1.2.3
zipp==3.1.0
zipp==3.1.0

View File

@ -4,3 +4,4 @@ flake8
flake8-import-order>=0.17.1
stestr>=2.0.0 # Apache-2.0
oslotest>=3.2.0 # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.0

12
tox.ini
View File

@ -22,6 +22,18 @@ commands = stestr run {posargs}
[testenv:pep8]
commands = flake8 {posargs}
[testenv:cover]
setenv =
PYTHON=coverage run --parallel-mode
commands =
coverage erase
stestr run {posargs}
coverage combine
coverage report
coverage html
coverage xml -o cover/coverage.xml
[testenv:releasenotes]
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}