undercover-el / undercover.el

A test coverage library for Emacs
MIT License
86 stars 14 forks source link

Support for LCOV output #68

Closed jinnovation closed 3 years ago

jinnovation commented 3 years ago

It would be nice to have the option to output the coverage report as LCOV. This would allow for compatibility with Coveralls' own GitHub Action, which would allow for native reporting of test coverage in the PR itself.

CyberShadow commented 3 years ago

Is there a description of this format somewhere?

jinnovation commented 3 years ago

There's a general description of the expected format here.

There's also some related discussion in nedbat/coveragepy#587 that might be useful.

CyberShadow commented 3 years ago

Do you know if it's sufficient to emit only SF:, DA:, LH:, and LF: lines for Coveralls?

CyberShadow commented 3 years ago

Seems to work, can you try it?

In Cask:

(development
 ...
 (depends-on "undercover"
             :git "https://github.com/undercover-el/undercover.el"
             :branch "next"))

And then as described here.

jinnovation commented 3 years ago

Thanks for looking into this.

I implemented a setup similar to the integration example repo you created for a project I contribute to. However, I seem to be getting the following issue in the Coveralls Action:

Using lcov file: ./coverage/lcov.info
/home/runner/work/_actions/coverallsapp/github-action/master/node_modules/coveralls/lib/convertLcovToCoveralls.js:43
  if (file.includes('!')) {
           ^

TypeError: Cannot read property 'includes' of undefined
    at cleanFilePath (/home/runner/work/_actions/coverallsapp/github-action/master/node_modules/coveralls/lib/convertLcovToCoveralls.js:43:12)
    at /home/runner/work/_actions/coverallsapp/github-action/master/node_modules/coveralls/lib/convertLcovToCoveralls.js:106:19
    at Array.forEach (<anonymous>)
    at /home/runner/work/_actions/coverallsapp/github-action/master/node_modules/coveralls/lib/convertLcovToCoveralls.js:105:12
    at walkFile (/home/runner/work/_actions/coverallsapp/github-action/master/node_modules/lcov-parse/lib/index.js:106:9)
    at /home/runner/work/_actions/coverallsapp/github-action/master/node_modules/lcov-parse/lib/index.js:115:20
    at suppressedCallback (fs.js:202:5)
    at FSReqCallback.oncomplete (fs.js:146:23)

Details and implementation can be found here. Let me know if there's any other information I can provide that might be useful.

CyberShadow commented 3 years ago

Thanks for testing, that problem should now be fixed.

jinnovation commented 3 years ago

Excellent, looks like that did the trick.

Let me know how else I can assist.

CyberShadow commented 3 years ago

If everything looks good to you so far, let me know and I'll push to master and tag a release.

jinnovation commented 3 years ago

Looks good to me—doesn't look like there's anything out of the ordinary in the reporting in Coveralls for my repo.

I'm not in a position to comment on the undercover.el implementation itself, so I'll happily defer to you on that.

Looking forward to the release. Thanks again for looking into this.

CyberShadow commented 3 years ago

OK, here it is: https://github.com/undercover-el/undercover.el/releases/tag/v0.8.1

Thanks again for looking into this.

Your appreciation is appreciated :)

jinnovation commented 3 years ago

OK, here it is: https://github.com/undercover-el/undercover.el/releases/tag/v0.8.1

Awesome, I think we can close this issue now. 👏