From 2fc66e35024a6e1465b033f7daf5a4f2c3c5b3a4 Mon Sep 17 00:00:00 2001 From: Martin Kopec Date: Mon, 14 Dec 2020 20:01:16 +0000 Subject: [PATCH] Add openstack cover job The patch adds a new job which runs cover tox environment to show code coverage by unit tests. Change-Id: I888cd729b9a1dbe65a3380da357eafc1cc961b36 --- .zuul.yaml | 1 + tox.ini | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.zuul.yaml b/.zuul.yaml index 7c3412e..1940796 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -1,5 +1,6 @@ - project: templates: + - openstack-cover-jobs - openstack-python37-jobs - openstack-python3-wallaby-jobs check: diff --git a/tox.ini b/tox.ini index 1f1a23b..5775335 100644 --- a/tox.ini +++ b/tox.ini @@ -16,6 +16,7 @@ commands = whitelist_externals = bash + find distribute = false [testenv:pep8] @@ -29,10 +30,13 @@ commands = {posargs} [testenv:cover] basepython = python3 +setenv = + {[testenv]setenv} + PYTHON=coverage run --source refstack_client --parallel-mode commands = coverage erase find . -type f -name "*.pyc" -delete - stestr --test-path ./refstack_client/tests run {posargs} + stestr run {posargs} coverage combine coverage html -d cover coverage xml -o cover/coverage.xml