]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
tests: report coverage status for unittests
authorGuillaume Abrioux <gabrioux@redhat.com>
Tue, 12 May 2020 18:13:35 +0000 (20:13 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Fri, 22 May 2020 15:05:22 +0000 (17:05 +0200)
This commit adds pytest-cov usage in unittests

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 8d556b078779450ebdc49bcba6d8c8524bcd1c01)

.travis.yml

index 0268c70effbcc91a4ee3b5f97d67064d9d48b96e..fc33b83eaee95037d8cf35cf208b7d1dc746b496 100644 (file)
@@ -7,8 +7,8 @@ notifications:
   webhooks: https://galaxy.ansible.com/api/v1/notifications/
 install:
   - pip install -r requirements.txt
-  - pip install ansible-lint pytest
+  - pip install ansible-lint pytest pytest-cov
 script:
   - if [[ -n $(grep --exclude-dir=.git -P "\xa0" -r .) ]]; then echo 'NBSP characters found'; exit 1; fi
-  - pytest -vvvv tests/library/ tests/plugins/filter/
+  - pytest --cov=library/ --cov=plugins/filter/ -vvvv tests/library/ tests/plugins/filter/
   - for i in $(ls -1 roles/); do ANSIBLE_LOG_PATH=/dev/null ansible-lint -x 204 -v roles/$i/; if [ $? -ne 0 ]; then exit 1; fi; done