]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Extract test coverage statistics from the gcov job
authorMark Andrews <marka@isc.org>
Thu, 23 Feb 2023 22:39:34 +0000 (09:39 +1100)
committerMark Andrews <marka@isc.org>
Tue, 28 Feb 2023 23:50:02 +0000 (10:50 +1100)
In older GitLab versions, the regular expression used for extracting
test coverage statistics from the output of GitLab CI jobs was
configured in the project's settings, using GitLab's web interface.
That changed in recent GitLab versions [1]; the previous configuration
method was removed from the web interface altogether as of GitLab 15.0.
The relevant regular expression is now supposed to be set in the
relevant job's definition in .gitlab-ci.yml.

Set the regular expression used for extracting test coverage
statistics in the definition of the "gcov" GitLab CI job.  Use the
regular expression suggested in GitLab's documentation [2].

[1] https://docs.gitlab.com/ee/update/deprecations.html#test-coverage-project-cicd-setting
[2] https://docs.gitlab.com/ee/ci/pipelines/settings.html#test-coverage-examples

(cherry picked from commit db7af9fcc1c91c3290982b555bdf1c55f6a73d66)

.gitlab-ci.yml

index 9a2c10bb57b716c407a497ced23c95ef4a0c7706..004e2a789c110bf8b3c42cf7330427ed945bc260 100644 (file)
@@ -1601,6 +1601,7 @@ gcov:
     - gcovr --root . --exclude-directories bin/tests --exclude-directories doc --exclude-directories fuzz --exclude-directories lib/samples --exclude tests --html-details -o coverage.html
     - gcovr --root . --exclude-directories bin/tests --exclude-directories doc --exclude-directories fuzz --exclude-directories lib/samples --exclude tests -o coverage.txt
     - tail -n 3 coverage.txt
+  coverage: /^TOTAL.*\s+(\d+\%)$/
   artifacts:
     paths:
       - coverage*.html