Skip to content
Snippets Groups Projects
Commit 7ecf1c89 authored by Duncan Macleod's avatar Duncan Macleod Committed by Duncan Macleod
Browse files

ci: improve coverage measurement

use a combiner job to resolve paths and aggregate coverage properly
parent 2e86bce8
No related branches found
No related tags found
1 merge request!49Improve coverage reporting
......@@ -27,6 +27,8 @@ include:
- local: '/.gitlab/ci/python.yml'
# Docker builds
- local: '/.gitlab/ci/docker.yml'
# Code coverage
- local: '/.gitlab/ci/coverage.yml'
# Code quality
- local: '/.gitlab/ci/analysis.yml'
# Documentation
......
# ---------------------------
# Code coverage
# ---------------------------
include:
# https://computing.docs.ligo.org/gitlab-ci-templates/
- project: computing/gitlab-ci-templates
# https://computing.docs.ligo.org/gitlab-ci-templates/python/
file: python.yml
# -- coverage ---------------
#
# This job combinces the individual
# coverage reports from each job
# to make a proper coverage result
#
coverage:
stage: .post
extends:
# https://computing.docs.ligo.org/gitlab-ci-templates/python/#.python:coverage-combine
- .python:coverage-combine
......@@ -24,3 +24,11 @@
- tar -xf gwdatafind-server-*.tar.* --wildcards "*/tests" --strip-components=1
# run pytest
- !reference [".python:pytest", script]
# upload coverage file as an artifact to be combined later
artifacts:
when: always
paths:
- .coverage-*
# disable coverage total for test jobs, this is reported
# by the coverage job
coverage: null
......@@ -5,9 +5,28 @@ requires = [
]
build-backend = "setuptools.build_meta"
# -- coverage.py
[tool.coverage.paths]
# map standard install paths back to the source to
# enable merging coverage of installed module from
# multiple platforms
source = [
"gwdatafind_server/", # <-- source path, must come first
"/usr/lib/python*/*-packages/gwdatafind_server/",
"/usr/local/lib/python*/*-packages/gwdatafind_server/",
]
[tool.coverage.run]
# measure coverage for the gwdatafind_server package
source = ["gwdatafind_server"]
[tool.coverage.report]
# print report with one decimal point
precision = 1
# -- pytest
[tool.pytest.ini_options]
addopts = "-r a"
filterwarnings = [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment