ebpf icon indicating copy to clipboard operation
ebpf copied to clipboard

CI: store merged coverage as an artifact

Open lmb opened this issue 2 years ago • 7 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

lmb avatar Dec 06 '23 15:12 lmb

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

lmb avatar Dec 06 '23 15:12 lmb

Happy to take it on

f1ko avatar Dec 06 '23 15:12 f1ko

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

amit-62 avatar Jan 12 '24 19:01 amit-62

Hi @f1ko, still working on this?

ti-mo avatar Jan 15 '24 11:01 ti-mo

Apologies, didn't get to it yet.

Feel free to work on it!

f1ko avatar Jan 15 '24 11:01 f1ko

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

amit-62 avatar Jan 26 '24 10:01 amit-62