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
This commit is contained in:
Nolan Brubaker 2016-04-19 12:13:51 -04:00 committed by Travis Truman
parent d4940515b6
commit 559d2dc865
2 changed files with 7 additions and 1 deletions

View File

@ -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

View File

@ -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 =