From: Guillaume Abrioux Date: Tue, 12 May 2020 18:13:35 +0000 (+0200) Subject: tests: report coverage status for unittests X-Git-Tag: v5.0.0~9 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0c6f5b6891052a3735dba392e8fa0d1dbb5c9fc3;p=ceph-ansible.git tests: report coverage status for unittests This commit adds pytest-cov usage in unittests Signed-off-by: Guillaume Abrioux (cherry picked from commit 8d556b078779450ebdc49bcba6d8c8524bcd1c01) --- diff --git a/.travis.yml b/.travis.yml index 0268c70ef..fc33b83ea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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