From 559d2dc86557a11abba35ee50448009d437c24c6 Mon Sep 17 00:00:00 2001 From: Nolan Brubaker Date: Tue, 19 Apr 2016 12:13:51 -0400 Subject: [PATCH] Add coverage reporting to inventory testing Using the coverage report will show how much of the dynamic_inventory.py script is actually exercised by tests. As of this commit, there is no enforced coverage level, rather it is used for informational purposes only. In the future, an enforce coverage percentage would be a good idea. Change-Id: Ic2ccc9ae5f306465b6990d935c82f81bb7b7956a --- test-requirements.txt | 1 + tox.ini | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/test-requirements.txt b/test-requirements.txt index 22e1b93ed0..2a1aff3c6c 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,6 +1,7 @@ ansible>1.9,<2.0,!=1.9.6 ansible-lint>=2.0.3,<=2.3.6 bashate==0.5.0 # Apache-2.0 +coverage<=4.0.3 # Apache-2.0 flake8==2.2.4 hacking>=0.10.0,<0.11 mccabe==0.2.1 # capped for flake8 diff --git a/tox.ini b/tox.ini index 1bc887bae1..d1b5ef8a49 100644 --- a/tox.ini +++ b/tox.ini @@ -89,8 +89,13 @@ commands = {toxinidir}/playbooks/*.yml" [testenv:inventory] +deps = + {[testenv]deps} + coverage commands = - python {toxinidir}/tests/test_inventory.py + coverage erase + coverage run {toxinidir}/tests/test_inventory.py + coverage report --include={toxinidir}/playbooks/inventory/* [testenv:linters] commands =