Add coverage testing

This commit is contained in:
Will Miller 2018-09-14 16:40:39 +00:00
parent 08940e1d94
commit daccd02158
3 changed files with 15 additions and 0 deletions

1
.gitignore vendored
View File

@ -45,6 +45,7 @@ pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
cover/
htmlcov/
.tox/
.coverage

View File

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

13
tox.ini
View File

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