From b9fcd1ac01f098edb26c5d8843572ec52d7c9a9b Mon Sep 17 00:00:00 2001 From: Plamen Dimitrov Date: Tue, 3 Apr 2018 11:21:18 +0300 Subject: [PATCH] Include test coverage reports with python's coverage.py and codecov We generate a new report on each push and upload it for coverage analysis using the CI. --- .travis.yml | 1 + codecov.yml | 3 +++ packaging/pip_requirements.txt | 1 + tests/run_tests.sh | 2 +- 4 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 codecov.yml diff --git a/.travis.yml b/.travis.yml index 5f6c57f0..d97c7997 100644 --- a/.travis.yml +++ b/.travis.yml @@ -58,6 +58,7 @@ before_script: # run tests script: - if [[ $INSTALL_VARIANT != "pip" ]]; then cd packaging && bash packager_docker.sh; else cd tests && bash run_tests.sh; fi + - if [[ $INSTALL_VARIANT == "pip" ]]; then codecov; fi # use this to disable email notifications (e.g. while testing configuration) #notifications: diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 00000000..e2a23c23 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,3 @@ +codecov: + notify: + require_ci_to_pass: no diff --git a/packaging/pip_requirements.txt b/packaging/pip_requirements.txt index a44a27a9..2a5b492f 100644 --- a/packaging/pip_requirements.txt +++ b/packaging/pip_requirements.txt @@ -1,5 +1,6 @@ # minimal coverage==4.5.1 +codecov==2.0.15 Pillow==6.2.0 # backends diff --git a/tests/run_tests.sh b/tests/run_tests.sh index 3a9bc355..537f5825 100755 --- a/tests/run_tests.sh +++ b/tests/run_tests.sh @@ -5,5 +5,5 @@ set -e readonly libpath="${LIBPATH:-../guibot}" readonly coverage="${COVERAGE:-coverage3}" -$coverage run --source="$libpath" -m unittest discover -v +$coverage run --source="$libpath" -m unittest discover -s ../tests/ $coverage report -m