From daccd021584658e2dede7ceeb0eedf60af883534 Mon Sep 17 00:00:00 2001 From: Will Miller Date: Fri, 14 Sep 2018 16:40:39 +0000 Subject: [PATCH] Add coverage testing --- .gitignore | 1 + test-requirements.txt | 1 + tox.ini | 13 +++++++++++++ 3 files changed, 15 insertions(+) diff --git a/.gitignore b/.gitignore index 59f9c28..a5e9414 100644 --- a/.gitignore +++ b/.gitignore @@ -45,6 +45,7 @@ pip-log.txt pip-delete-this-directory.txt # Unit test / coverage reports +cover/ htmlcov/ .tox/ .coverage diff --git a/test-requirements.txt b/test-requirements.txt index f41301b..ab67516 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -3,6 +3,7 @@ # process, which may cause wedges in the gate later. ansible-lint>=3.0.0 # MIT +coverage>=4.5.1 # Apache-2.0 flake8>=3.5.0 # MIT # Required for Python 2 mock>=2.0.0 # BSD diff --git a/tox.ini b/tox.ini index baa4108..2bd25f9 100644 --- a/tox.ini +++ b/tox.ini @@ -29,6 +29,19 @@ basepython = python2.7 commands = flake8 {posargs} +[testenv:cover] +basepython = python3 +setenv = + VIRTUAL_ENV={envdir} + PYTHON=coverage run --source tenks,ansible/action_plugins --parallel-mode +commands = + coverage erase + stestr run {posargs} + coverage combine + coverage report + coverage html -d cover + coverage xml -o cover/coverage.xml + [testenv:alint] basepython = python2.7 # ansible-lint doesn't support custom modules, so add ours to the Ansible path.