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

Measure test coverage as part of CI runs #293

Closed
edwardhartnett opened this issue Feb 13, 2021 · 7 comments
Closed

Measure test coverage as part of CI runs #293

edwardhartnett opened this issue Feb 13, 2021 · 7 comments
Assignees
Labels

Comments

@edwardhartnett
Copy link
Collaborator

We need to somehow measure and display test coverage as part of CI.

@kgerheiser
Copy link
Contributor

I was able to do this in Github by installing gcovr and passing CMAKE_Fortran_FLAGS for the necessary flags through the command line.

The issue is outputting the data. With Github Actions you can save artifacts as a .zip, but that's it. There's no way to directly view the HTML output. You have to manually download it to look at the results.

There's https://about.codecov.io which is a service that does this and integrates into Github, but it requires paying for it.

So, my plan is to upload the .html files and you'll have to manually look at them.

@edwardhartnett
Copy link
Collaborator Author

OK, that works for now, and maybe we can improve it later...

@kgerheiser
Copy link
Contributor

Fixed with #380

@edwardhartnett there's this issue in the upload artifact Action to be able to view files in the browser, and hopefully it's coming. actions/upload-artifact#14

@edwardhartnett
Copy link
Collaborator Author

OK, in the meantime, what's the procedure for getting the package of html files?

@kgerheiser
Copy link
Contributor

kgerheiser commented Mar 3, 2021

You go to Actions, click on a workflow run, and it's listed on the bottom under Artifacts as test-coverage. Click on that and it downloads.

See here, for example:

https://github.com/NOAA-EMC/UFS_UTILS/actions/runs/618295926

@edwardhartnett
Copy link
Collaborator Author

When I upload this and unzip, there is just one file, the main report file. But there should be a bunch more HTML files, one for each code file as well...

@kgerheiser
Copy link
Contributor

I was using the option --html which outputs just a single HTML file. The command --html-details makes a page for each file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants