Skip to content

Create and enable post-processing job for code coverage reporting #1211

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

a-wai
Copy link
Contributor

@a-wai a-wai commented Jun 19, 2025

Add a new template for generating code coverage report, meant to be used as a post-processing job for kernels built with GCOV support.

This job will collect coverage data from every test job of a given kbuild node, report lines/functions coverage for each job, aggregate coverage data for all jobs and generate the following artifacts pertaining to the kbuild node itself:

  • single-page HTML report including lines/functions coverage data for each source file
  • LCOV-compatible tracefile for further processing (filtering, generating detailed HTML report...) by individual developers
  • child nodes with global lines/functions coverage for the aggregated data

Depends on kernelci/kernelci-core#2908 kernelci/kernelci-core#2909 & kernelci/kernelci-core#2916

@a-wai a-wai requested review from nuclearcat and laura-nao June 19, 2025 15:35
@a-wai a-wai force-pushed the coverage-report-initial-template branch 7 times, most recently from 1eeec0d to 905de3a Compare June 25, 2025 14:38
@a-wai
Copy link
Contributor Author

a-wai commented Jun 26, 2025

Successfully tested on staging, as can be seen from the list of child nodes for the corresponding kbuild:

  • each ltp-* node has coverage.functions and coverage.lines child nodes containing the coverage percentage in data[misc][measurement] (except for one which timed out in LAVA, and therefore didn't upload the coverage data tarball -- this will be fixed with a follow-up PR)
  • the coverage-report node contains the HTML report as well as a (gzipped) LCOV-compatible tracefile and job log as artifacts
  • coverage-report also has coverage.* child nodes reporting the coverage percentages for all aggregated tests

a-wai added 2 commits June 26, 2025 12:40
This new template is meant to be executed as a post-processing job, once
every test job for a given `kbuild` node are complete. It gathers the
raw coverage data from each of those test jobs and processes it as
follows:
* create a single JSON tracefile using `gcovr`
* extract lines/functions coverage percentages for each job
* create `test` child nodes for each job, reporting those percentages
* merge all tracefiles in a single results file and generate both an
  HTML report and `lcov`-compatible tracefile; the HTML report gives a
  quick overview of the code coverage, while the tracefile can then be
  downloaded by developers for more targeted processing
* create `test` child nodes for the `kbuild` job, reporting global
  lines/functions coverage percentages for this run

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
Create a generic job definition meant for post-processing coverage data
for kernel builds where GCOV support is enabled. This job is enabled for
all kernels built with the `coverage` config fragment.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
@a-wai a-wai force-pushed the coverage-report-initial-template branch from 905de3a to f277c92 Compare June 26, 2025 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant