Skip to content

build: Code coverage report

Antoine Belvire requested to merge build/report_test_coverage into master

Context

Closes #78 (closed).

What has changed?

Main Changes

buildSrc/*, */build.gradle.kts

  • Record test coverage using JaCoCo.
  • Aggregate coverage report using the JaCoCo Report Aggregation Gradle Plugin, for later consumption.

.gitlab-ci.yml

  • Adjust CI build so that total coverage is displayed in MR summary: Basically print the JaCoCo report in logs and set a coverage regex for Gitlab to find the value when it parses the logs.
  • Adjust CI build so that detailed coverage is displayed in MR diffs:
    • Convert the aggragated JaCoCo report to Cobertura format using cover2cover.py (taken from here) which was previously added to the build image.
    • Export this Cobertura report.

Others

cli

  • Added a test and a harmless code change (reformet file) to verify that coverage was correctly displayed taken into account.

.gitlab-ci.yml

  • Use a variable to define the Linux image name: Easier to change the value (it is used by 2 jobs).
Edited by Antoine Belvire

Merge request reports