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

Option to output coverage in lcov format #109

Closed
ahumphreys87 opened this issue Jun 27, 2014 · 13 comments · Fixed by #182
Closed

Option to output coverage in lcov format #109

ahumphreys87 opened this issue Jun 27, 2014 · 13 comments · Fixed by #182
Assignees
Labels
Milestone

Comments

@ahumphreys87
Copy link

@ahumphreys87 ahumphreys87 commented Jun 27, 2014

Hi Guys,

Im currently using Hapi and using lab to build my tests, Im looking to intergrate my app with coveralls.io (https://coveralls.io/) however it requires coverage reports to be in lcov format. Is this an option with lab or is it planned for a feature version?

@nelsonic

This comment has been minimized.

Copy link

@nelsonic nelsonic commented Jul 7, 2014

👍 for using coveralls.io with Lab

(it would be a great way to promote the fact that Hapi has 100% test coverage - which will increase adoption)

Given that Lab is based on Mocha, we could use mocha-lcov-reporter
https://github.com/StevenLooman/mocha-lcov-reporter/ to output the .lcov file

@hueniverse any objections to me adding lcov.js to lib/reporters trying it out and submitting a PR?

@hueniverse

This comment has been minimized.

Copy link
Member

@hueniverse hueniverse commented Aug 3, 2014

I'll take a proper lcov reporter that's compliant with http://ltp.sourceforge.net/coverage/lcov/geninfo.1.php but the mocha one looks like a hack.

@nelsonic

This comment has been minimized.

Copy link

@nelsonic nelsonic commented Aug 3, 2014

Thanks @hueniverse if you want to delegate some of the work back, please do.

@hueniverse

This comment has been minimized.

Copy link
Member

@hueniverse hueniverse commented Aug 3, 2014

I'll anyone wants to work on this, they should just indicate it in a comment here so others will know.

@martinheidegger

This comment has been minimized.

Copy link
Contributor

@martinheidegger martinheidegger commented Aug 15, 2014

I havn't found a good "specification" for the lcov format but I found the parser of the format @ lcov:
https://github.com/linux-test-project/lcov/blob/a6b10a41056cd10c7b735e259fee81f1865c2109/bin/lcov#L1664

Not hard to read.

@martinheidegger

This comment has been minimized.

Copy link
Contributor

@martinheidegger martinheidegger commented Aug 15, 2014

Further information: the lcov format reporter of instanbul seems more complete:
https://github.com/gotwarlost/istanbul/blob/master/lib/report/lcovonly.js

@chasevida

This comment has been minimized.

Copy link

@chasevida chasevida commented Aug 15, 2014

+1 for this feature

@kidtronnix

This comment has been minimized.

Copy link

@kidtronnix kidtronnix commented Aug 30, 2014

another +1 for this feature

@thaiat

This comment has been minimized.

Copy link

@thaiat thaiat commented Sep 3, 2014

+1

@geek geek self-assigned this Sep 3, 2014
@geek geek added this to the 4.2.1 milestone Sep 3, 2014
@geek geek added the enhancement label Sep 3, 2014
@geek

This comment has been minimized.

Copy link
Member

@geek geek commented Sep 4, 2014

I added the lcov reporter, but one thing to note is that according to the spec the branch number is actually a gcc internal number. Therefore, I didn't add branch reporting beyond marking the entire line as covered or not.

But it does work well with:

$ lab -r lcov > lcov.info
$ genhtml lcov.info --output-directory out
@arb arb closed this in #182 Sep 4, 2014
@nelsonic

This comment has been minimized.

Copy link

@nelsonic nelsonic commented Sep 4, 2014

thanks @geek great work! 😉

@chasevida

This comment has been minimized.

Copy link

@chasevida chasevida commented Sep 11, 2014

thanks @geek for this and also @smaxwellstewart for your toothache repo showing it off.

@kidtronnix

This comment has been minimized.

Copy link

@kidtronnix kidtronnix commented Sep 11, 2014

No worries!

On 11 September 2014 02:17, Mark notifications@github.com wrote:

thanks @geek https://github.com/geek for this and also @smaxwellstewart
https://github.com/smaxwellstewart for your toothache
https://github.com/smaxwellstewart/toothache repo showing it off.


Reply to this email directly or view it on GitHub
#109 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
9 participants
You can’t perform that action at this time.