fix(coverage): add coverage rc file

The tox coverage refers to a non-existing rc file. This patch set
redresses this by putting in a proper .coveragerc file similar to
all the other projects.

This patchset also makes the tox coverage job compatible w/ Zuul.

Change-Id: I96a3d13482053b591f7d01e1c5c1e906d84f8fb7
Depends-On: If3cba68492ba9c7a0e78258c7b669d1b39fcdeba
Signed-off-by: Tin Lam <tin@irrational.io>
This commit is contained in:
Tin Lam 2018-06-06 03:25:26 -05:00
parent 84694989b6
commit c39d21eec8
4 changed files with 23 additions and 12 deletions

7
.coveragerc Normal file
View File

@ -0,0 +1,7 @@
[run]
branch = True
source = armada
omit = armada/tests/*
[report]
ignore_errors = True

3
.stestr.conf Normal file
View File

@ -0,0 +1,3 @@
[DEFAULT]
test_path=armada/tests/unit
top_dir=./

View File

@ -7,11 +7,11 @@ sphinx_rtd_theme>=0.2.4
# Testing
bandit
codecov
coverage!=4.4,>=4.5.1 # Apache-2.0
testtools>=2.3.0 # MIT
os-testr>=1.0.0 # Apache-2.0
flake8>=3.3.0
mock
pytest==3.2.1
pytest-cov
pytest-mock
responses>=0.8.1
testtools==2.3.0

19
tox.ini
View File

@ -1,6 +1,6 @@
[tox]
skipsdist = True
envlist = py35, pep8, coverage, bandit
envlist = py35, pep8, cover, bandit
[testenv]
deps=
@ -53,15 +53,16 @@ commands =
bandit -r armada -x armada/tests -n 5
[testenv:cover]
passenv=http_proxy https_proxy no_proxy HTTP_PROXY HTTPS_PROXY NO_PROXY
setenv=
VIRTUAL_ENV={envdir}
setenv = {[testenv]setenv}
PYTHON=coverage run --source armada --parallel-mode
commands =
python -m pytest \
--cov-branch \
--cov-report term-missing:skip-covered \
--cov-config .coveragerc \
--cov=armada
coverage erase
find . -type f -name "*.pyc" -delete
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
coverage report
[flake8]
filename = *.py