- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1.1k
WIP: Add gcov coverage report to Travis CI #705
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
Conversation
cffb9a4    to
    5b935eb      
    Compare
  
    Also make `make clean` and `.gitignore` aware of gcov.
5b935eb    to
    f8ca924      
    Compare
  
    There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding coverage reports to CI is a good idea. I don't think the summary alone is enough in code review. If someone PRs a change I would like to check if all lines and all branches of the new code are taken. The summary only shows a number of lines (and branches with -b) and waht percentage is exec'd. Even if the numbers stay constant with respect to master that does not mean that the new code is fully tested.
Would it be possible to have travis provide the html coverage report or push it somewhere (github pages, ...)? On the other hand I have no experience with codecov.io, but I have a slight preference for gcov because it works and it does not require a third party.
Fwiw with f8ca924 travis either shows gcovr not found or shows an empty code coverage report.
| 
 You can also use it locally in an edit/compile/test loop. On a real CI system it's easy to have the auto builds make their work product available, e.g. https://mf4.xiph.org/jenkins/job/opus-coverage/ws/coverage/index.html (and as I link this, I see someone broke branch coverage reporting in that project, presumably due to applying an os upgrade that upgraded lcov, sad. lol) But at least previously travis was super anal about not making work product from CI builds easily available-- presumably because they didn't want to get turned into free web hosting. I dunno if that has changed. | 
| 
 True, lines would help a lot more. I thought about running this locally but you're right. For the summary alone, we don't need to setup travis, that's useless. 
 As Greg points out that's hard with Travis. With tools like codevoc.io, this is easier: Third parties: Yes, I think that's like with Travis. It's convenient but we should not rely on it or trust it. My concern is rather that we prefer to keep things simple, and just running gcovr is indeed simpler. 
 Yep, I need to fix this. | 
| 
 For the specific case of code analysis (including test coverage), travis supports SonarQube for example. | 
| @real-or-random I think have a solution to the travis output problem. You can have secret credentials in travis: https://docs.travis-ci.com/user/encryption-keys/ So travis CI could be setup to be able to submit work-product output to an external host. As in ... just scp the gcovr html output to somehost:public_html/libsecp256k1/coverage/pr1234/. I don't think this is a replacement for a real CI setup that is able to do benchmarking or spend non-negligible amounts of time testing (e.g. running serious fuzz tests) --- but it would be fairly low effort to setup. (and if it breaks you just stop getting ci reports from the PR builds, which isn't the end of the world). | 
| The coverage report should exclude tests.c or otherwise it will always report very low figures (test failures), which will obscure real reductions in branch coverage (which should be very close to 100%). | 
| Closing in favor of #954. | 
Related to #704.
We could also additionally use something like https://codecov.io/ to get a nice report but I'm not sure if that's worth it.