Skip to content
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

CI: store merged coverage as an artifact #1256

Open
lmb opened this issue Dec 6, 2023 · 7 comments
Open

CI: store merged coverage as an artifact #1256

lmb opened this issue Dec 6, 2023 · 7 comments
Assignees
Labels
good first issue Good for newcomers

Comments

@lmb
Copy link
Collaborator

lmb commented Dec 6, 2023

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 lmb added the good first issue Good for newcomers label Dec 6, 2023
@lmb
Copy link
Collaborator Author

lmb commented Dec 6, 2023

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

@f1ko
Copy link

f1ko commented Dec 6, 2023

Happy to take it on

@lmb lmb assigned f1ko Dec 6, 2023
@amit-62
Copy link

amit-62 commented Jan 12, 2024

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

@ti-mo
Copy link
Collaborator

ti-mo commented Jan 15, 2024

Hi @f1ko, still working on this?

@f1ko
Copy link

f1ko commented Jan 15, 2024

Apologies, didn't get to it yet.

Feel free to work on it!

@amit-62
Copy link

amit-62 commented Jan 26, 2024

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

@saiaunghlyanhtet
Copy link

@lmb & @ti-mo
Can you review my pr, plz?
#1613

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

5 participants