[pygobject] coverage: add coverage context for each job



commit 2b85c14cc80c1d6685c8bd979ec15560f888d2b8
Author: Christoph Reiter <reiter christoph gmail com>
Date:   Fri Dec 27 16:14:11 2019 +0100

    coverage: add coverage context for each job

 .gitlab-ci/coverage-docker.sh   | 2 +-
 .gitlab-ci/test-docker-old.sh   | 5 +++--
 .gitlab-ci/test-docker.sh       | 5 +++--
 .gitlab-ci/test-flatpak-gtk4.sh | 5 +++--
 .gitlab-ci/test-msys2.sh        | 2 +-
 5 files changed, 11 insertions(+), 8 deletions(-)
---
diff --git a/.gitlab-ci/coverage-docker.sh b/.gitlab-ci/coverage-docker.sh
index 9b3e12ea..e594f1c0 100755
--- a/.gitlab-ci/coverage-docker.sh
+++ b/.gitlab-ci/coverage-docker.sh
@@ -15,7 +15,7 @@ for path in coverage/*.lcov; do
 done
 
 python -m coverage combine coverage
-python -m coverage html --ignore-errors -d coverage/report-python
+python -m coverage html --show-contexts --ignore-errors -d coverage/report-python
 genhtml --ignore-errors=source --rc lcov_branch_coverage=1 \
     coverage/*.lcov -o coverage/report-c
 
diff --git a/.gitlab-ci/test-docker-old.sh b/.gitlab-ci/test-docker-old.sh
index 8d451bc0..de238f81 100755
--- a/.gitlab-ci/test-docker-old.sh
+++ b/.gitlab-ci/test-docker-old.sh
@@ -10,7 +10,8 @@ source _venv/bin/activate
 export CCACHE_BASEDIR="$(pwd)"
 export CCACHE_DIR="${CCACHE_BASEDIR}/_ccache"
 COV_DIR="$(pwd)/coverage"
-export COVERAGE_FILE="${COV_DIR}/.coverage.${CI_JOB_NAME}"
+COV_KEY="${CI_JOB_NAME}"
+export COVERAGE_FILE="${COV_DIR}/.coverage.${COV_KEY}"
 mkdir -p "${COV_DIR}"
 mkdir -p "${CCACHE_DIR}"
 
@@ -18,4 +19,4 @@ mkdir -p "${CCACHE_DIR}"
 python -m pip install git+https://github.com/pygobject/pycairo.git
 python -m pip install pytest pytest-faulthandler coverage
 python setup.py build_tests
-xvfb-run -a python -m coverage run tests/runtests.py
+xvfb-run -a python -m coverage run --context "${COV_KEY}" tests/runtests.py
diff --git a/.gitlab-ci/test-docker.sh b/.gitlab-ci/test-docker.sh
index 7205f8b6..964a3674 100755
--- a/.gitlab-ci/test-docker.sh
+++ b/.gitlab-ci/test-docker.sh
@@ -11,7 +11,8 @@ COV_DIR="${SOURCE_DIR}/coverage"
 export MALLOC_CHECK_=3
 export MALLOC_PERTURB_=$((${RANDOM} % 255 + 1))
 export G_SLICE="debug-blocks"
-export COVERAGE_FILE="${COV_DIR}/.coverage.${CI_JOB_NAME}"
+COV_KEY="${CI_JOB_NAME}"
+export COVERAGE_FILE="${COV_DIR}/.coverage.${COV_KEY}"
 export CCACHE_BASEDIR="$(pwd)"
 export CCACHE_DIR="${CCACHE_BASEDIR}/_ccache"
 
@@ -47,7 +48,7 @@ fi;
 
 # BUILD & TEST AGAIN USING SETUP.PY
 python setup.py build_tests
-xvfb-run -a python -m coverage run tests/runtests.py
+xvfb-run -a python -m coverage run --context "${COV_KEY}" tests/runtests.py
 
 # COLLECT GCOV COVERAGE
 lcov --rc lcov_branch_coverage=1 --directory . --capture --output-file \
diff --git a/.gitlab-ci/test-flatpak-gtk4.sh b/.gitlab-ci/test-flatpak-gtk4.sh
index 189d63cd..320a107f 100755
--- a/.gitlab-ci/test-flatpak-gtk4.sh
+++ b/.gitlab-ci/test-flatpak-gtk4.sh
@@ -3,11 +3,12 @@
 set -e
 
 COV_DIR="$(pwd)/coverage"
-export COVERAGE_FILE="${COV_DIR}/.coverage.gtk4"
+COV_KEY="gtk4"
+export COVERAGE_FILE="${COV_DIR}/.coverage.${COV_KEY}"
 mkdir -p "${COV_DIR}"
 
 export TEST_GTK_VERSION=4.0
 python3 -m pip install --user pytest pytest-faulthandler coverage
 python3 setup.py build_tests
-python3 -m coverage run tests/runtests.py
+python3 -m coverage run --context "${COV_KEY}" tests/runtests.py
 chmod -R 777 "${COV_DIR}"
\ No newline at end of file
diff --git a/.gitlab-ci/test-msys2.sh b/.gitlab-ci/test-msys2.sh
index 38d4fbc1..133e2e60 100755
--- a/.gitlab-ci/test-msys2.sh
+++ b/.gitlab-ci/test-msys2.sh
@@ -49,7 +49,7 @@ export COVERAGE_FILE="${COV_DIR}/.coverage.${COV_KEY}"
 export PYTHONDEVMODE=1
 
 $PYTHON setup.py build_tests
-MSYSTEM= $PYTHON -m coverage run tests/runtests.py
+MSYSTEM= $PYTHON -m coverage run --context "${COV_KEY}" tests/runtests.py
 
 # FIXME: lcov doesn't support gcc9
 #~ curl -O -J -L "https://github.com/linux-test-project/lcov/archive/master.tar.gz";


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]