From 09905baab2a20245e08e4bbfe872ef4875bd5f87 Mon Sep 17 00:00:00 2001 From: Chris Dent Date: Thu, 6 Sep 2018 19:25:33 +0100 Subject: [PATCH] Use both unit and functional for coverage testing Placement has always relied heavily on functional testing for both API and database testing, so not including those tests in 'coverage' leads to misleading results. This change adjusts the cover job in tox to use a test path of placement/tests, resulting in all the tests running. In the process .coveragerc is updated to be placement oriented and make sure we do not ignore branches. This is in preparation for turning on a check job for coverage. See this email for more on that: http://lists.openstack.org/pipermail/openstack-dev/2018-September/134385.html A followup patch will turn on a check job for it. Change-Id: I6c122facc9c9f6e0b2a1d69c6aaf5faeee7cf253 --- .coveragerc | 7 ++----- tox.ini | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.coveragerc b/.coveragerc index a116ffae9..cc0929ca6 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,7 +1,4 @@ [run] branch = True -source = nova -omit = nova/tests/* - -[report] -ignore_errors = True +source = placement +omit = placement/tests/* diff --git a/tox.ini b/tox.ini index e5859d08c..de807acdb 100644 --- a/tox.ini +++ b/tox.ini @@ -121,7 +121,7 @@ setenv = commands = {[testenv]commands} coverage erase - stestr run {posargs} + stestr --test-path=./placement/tests --group_regex=placement\.tests\.functional\.test_api(?:\.|_)([^_]+) run {posargs} coverage combine coverage html -d cover coverage xml -o cover/coverage.xml