-
Notifications
You must be signed in to change notification settings - Fork 770
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
[ready] Add coverage testing support #271
Conversation
Add information on running coverage tests and tidy up the developer test documentation.
Review status: 0 of 2 files reviewed at latest revision, 1 unresolved discussion. TESTS.md, line 35 [r1] (raw file): Comments from the review on Reviewable.io |
Should we use coveralls for ycmd? Review status: 0 of 2 files reviewed at latest revision, 2 unresolved discussions. TESTS.md, line 6 [r1] (raw file): Comments from the review on Reviewable.io |
Well, let's see what happens. Review status: 0 of 3 files reviewed at latest revision, 2 unresolved discussions. Comments from the review on Reviewable.io |
We need to create an account on the website, are we? Anyway, this coverage tool is great: a score of 85%, not bad! Review status: 0 of 3 files reviewed at latest revision, 1 unresolved discussion. Comments from the review on Reviewable.io |
Seemed to work for my fork. Looks like a neat tool. https://coveralls.io/github/puremourning/ycmd-1 Would require @Valloric to link the repo. Review status: 0 of 3 files reviewed at latest revision, 1 unresolved discussion. Comments from the review on Reviewable.io |
I'm not crazy about coveralls.io because once you have that information for every commit you push then it feels like you're doing the tests only because you don't want that number to go down instead of making the tests that matter and that bring value to the project. I'm not saying that having that number is a bad thing, that would be stupid, but the fact of having that number constantly would be counterproductive IMHO. Review status: 0 of 3 files reviewed at latest revision, 1 unresolved discussion. Comments from the review on Reviewable.io |
Well, the reason I went looking for coverage tools is that i wanted augment my current testing efforts. I find coverage reports very useful to ensure that:
Chasing a statistic for the sake of the statistic is certainly somewhat pointless, but a handful of tests covering 100% of the code is certainly better than no tests at all. And possibly better than 100 tests testing the same codepath. At least, IMO. Anyway - I'm not too bothered either way. It is 2 lines in the travis setup to enable/disable it, but documenting how to do it manually was my goal - primarily because I will forget if i don't! Review status: 0 of 3 files reviewed at latest revision, 1 unresolved discussion. Comments from the review on Reviewable.io |
I agree with you that testing is a really important thing (you're not alone :)) and I agree that having some number to have a sense if the way we test things is useful. I just wanted to point out that having that number constantly is not always a good thing.
We could always try it and if we don't find it useful we could disable it.
👍 |
I think we should run coverage only for one build: Python 2.7 with CLANG_COMPLETER=true on Linux (or add a specific build for it). Reviewed 1 of 2 files at r1, 1 of 2 files at r2. Comments from the review on Reviewable.io |
A specific build only for coverage seems a good thing (separation of the tests from the statistics) but wouldn't also be a waste of resources? we should basically re-run the tests, right? Review status: 2 of 3 files reviewed at latest revision, 1 unresolved discussion. Comments from the review on Reviewable.io |
It would be only 1/9 more resources and since Travis run builds in parallel, the duration would be nearly the same. Review status: 2 of 3 files reviewed at latest revision, 1 unresolved discussion. Comments from the review on Reviewable.io |
@vheon I (and everyone else here) agree with your point that chasing that coverage number is silly. Of course it is. But coverage metrics are very, very useful when they can provide insight like "given a file, which lines are being exercised by tests"? Holy crap is that useful. I've found far too many instances of "hey I thought that was being tested" (when it wasn't) through such tools. A general number showing "X% of this project is covered by tests" is also useful as a badge of quality. People looking at the project can feel more confident depending on it when the number is >80%. Hell, just seeing the coveralls.io badge in the README makes me have a higher opinion of any GitHub project (even if the computed number is low) because the people working on it at least ostensibly care about testing. And if the badge has even a 1% positive influence encouraging people to write more tests, I'll gladly take that. So WRT coveralls.io, I say we go for it. I created an account and turned it "on" for ycmd & YouCompleteMe. Do I need to do anything else? Review status: 2 of 3 files reviewed at latest revision, 1 unresolved discussion. TESTS.md, line 35 [r1] (raw file): Could you create an issue for it so we don't forget? Comments from the review on Reviewable.io |
Review status: 2 of 3 files reviewed at latest revision, 1 unresolved discussion. Comments from the review on Reviewable.io |
too. I'm not firing Reviewed 1 of 2 files at r1, 2 of 2 files at r2. TESTS.md, line 35 [r1] (raw file): Comments from the review on Reviewable.io |
This is how I added one coverage run on Travis and here the Travis results. Review status: all files reviewed at latest revision, 1 unresolved discussion. Comments from the review on Reviewable.io |
I've implemented @micbou's approach of running an extra build just for coverage. Review status: 1 of 5 files reviewed at latest revision, 1 unresolved discussion. Comments from the review on Reviewable.io |
Reviewed 2 of 4 files at r3. TESTS.md, line 76 [r3] (raw file): TESTS.md, line 77 [r3] (raw file): Comments from the review on Reviewable.io |
Review status: 3 of 5 files reviewed at latest revision, 3 unresolved discussions. TESTS.md, line 76 [r3] (raw file): TESTS.md, line 77 [r3] (raw file): Comments from the review on Reviewable.io |
Reviewed 1 of 4 files at r3. Comments from the review on Reviewable.io |
Should we add the coveralls.io badge to the README? Review status: 4 of 5 files reviewed at latest revision, 1 unresolved discussion. Comments from the review on Reviewable.io |
Reviewed 3 of 4 files at r3, 1 of 1 files at r4. run_tests.py, line 100 [r4] (raw file): Comments from the review on Reviewable.io |
117f933
to
aae3bee
Compare
Review status: 5 of 6 files reviewed at latest revision, 2 unresolved discussions. run_tests.py, line 100 [r4] (raw file): Comments from the review on Reviewable.io |
Reviewed 1 of 1 files at r4, 1 of 1 files at r5. Comments from the review on Reviewable.io |
@puremourning Could you add the coveralls.io badge to the README as well? I want users to see we care about testing. Review status: all files reviewed at latest revision, 2 unresolved discussions. Comments from the review on Reviewable.io |
i thought i did... README.md [![Coverage Status](https://coveralls.io/repos/Valloric/ycmd/badge.svg?branch=master&service=github)](https://coveralls.io/github/Valloric/ycmd?branch=master) Review status: all files reviewed at latest revision, 2 unresolved discussions. Comments from the review on Reviewable.io |
Bah, I'm blind. :) Is this ready to merge? BTW we might want to get in the habit of adding a "[READY]" prefix to PR titles when the author feels it's ready to be merged. Should save an RTT or two. Review status: all files reviewed at latest revision, 2 unresolved discussions. Comments from the review on Reviewable.io |
Yes i think this is ready. Review status: all files reviewed at latest revision, 2 unresolved discussions. Comments from the review on Reviewable.io |
@homu r+ Thank you for working on this! Review status: all files reviewed at latest revision, 1 unresolved discussion. Comments from the review on Reviewable.io |
📌 Commit aae3bee has been approved by |
⚡ Test exempted - status |
[ready] Add coverage testing support Add information on running coverage tests and tidy up the developer test documentation. Run a new Travis build with coverage enabled. Pass coverage data to coveralls.io. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/ycmd/271) <!-- Reviewable:end -->
Add information on running coverage tests and tidy up the developer test documentation.
Run a new Travis build with coverage enabled.
Pass coverage data to coveralls.io.