From c39d21eec801e67c7f1c0472219ad81d6b0d8a21 Mon Sep 17 00:00:00 2001 From: Tin Lam Date: Wed, 6 Jun 2018 03:25:26 -0500 Subject: [PATCH] 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 --- .coveragerc | 7 +++++++ .stestr.conf | 3 +++ test-requirements.txt | 6 +++--- tox.ini | 19 ++++++++++--------- 4 files changed, 23 insertions(+), 12 deletions(-) create mode 100644 .coveragerc create mode 100644 .stestr.conf diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 00000000..b599085a --- /dev/null +++ b/.coveragerc @@ -0,0 +1,7 @@ +[run] +branch = True +source = armada +omit = armada/tests/* + +[report] +ignore_errors = True diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 00000000..f64ac7a4 --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,3 @@ +[DEFAULT] +test_path=armada/tests/unit +top_dir=./ diff --git a/test-requirements.txt b/test-requirements.txt index 3a88bd8b..569d223c 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -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 diff --git a/tox.ini b/tox.ini index 63aa1bc6..a936684a 100644 --- a/tox.ini +++ b/tox.ini @@ -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