cilium / ebpf

ebpf-go is a pure-Go library to read, modify and load eBPF programs and attach them to various hooks in the Linux kernel.

Home Page:https://ebpf-go.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CI: store merged coverage as an artifact

lmb opened this issue · comments

Running our test suite creates coverage information in coverage.out:

$ ./run-tests.sh 6.1
Fetching linux-6.1-amd64.tgz
Fetching linux-6.1-amd64-selftests-bpf.tgz
...
$ ls -lh coverage.out 
-rw-r--r--. 1 lorenz lorenz 521K Dec  6 14:12 coverage.out

That can be turned into a html report like so:

$ go tool cover -html=coverage.out -o coverage.html
$ ls -lh coverage.html 
-rw-r--r--. 1 lorenz lorenz 899K Dec  6 14:56 coverage.html

We should integrate this into our CI:

  • Upload each generated coverage.out as an artifact for that job
  • Collect all coverage.out from the various jobs and merge them using go tool covdata merge
  • Generate a single .html which shows overall test coverage and upload attach that to the build somehow
  • Brownie points if its possible to look at the coverage html by just clicking on a link instead of downloading + extracting

We might also have to investigate whether our merged test coverage in coverage.out is accurate, it's suspiciously low in some files.

commented

Happy to take it on

Hello @lmb and @f1ko, can I work on it?

Hi @f1ko, still working on this?

commented

Apologies, didn't get to it yet.

Feel free to work on it!

Hello @lmb, please review my PR and suggest improvements.
Thank you.