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

Support for LCOV output #68

Closed
jinnovation opened this issue May 29, 2021 · 11 comments
Closed

Support for LCOV output #68

jinnovation opened this issue May 29, 2021 · 11 comments

Comments

@jinnovation
Copy link

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
Copy link
Member

Is there a description of this format somewhere?

jinnovation added a commit to jinnovation/kubernetes-el that referenced this issue May 29, 2021
The move towards GitHub Actions for CI in kubernetes-el#146 removed code coverage
tracking via Coveralls, which until now had come "for free" via
Travis.

This PR reintroduces Coveralls tracking via the guidance in
[undercover](https://github.com/undercover-el/undercover.el)
documentation. Unfortunately, this only enables tracking, but does not
provide feedback in PR of changes to test coverage like before. Were
undercover to integrate LCOV reporting support (see
undercover-el/undercover.el#68), this could then move to using [the
official Coveralls GitHub
Action](https://github.com/marketplace/actions/coveralls-github-action),
which would give that reporting.
@jinnovation
Copy link
Author

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

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

noorul pushed a commit to kubernetes-el/kubernetes-el that referenced this issue May 29, 2021
The move towards GitHub Actions for CI in #146 removed code coverage
tracking via Coveralls, which until now had come "for free" via
Travis.

This PR reintroduces Coveralls tracking via the guidance in
[undercover](https://github.com/undercover-el/undercover.el)
documentation. Unfortunately, this only enables tracking, but does not
provide feedback in PR of changes to test coverage like before. Were
undercover to integrate LCOV reporting support (see
undercover-el/undercover.el#68), this could then move to using [the
official Coveralls GitHub
Action](https://github.com/marketplace/actions/coveralls-github-action),
which would give that reporting.
@CyberShadow
Copy link
Member

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

@CyberShadow
Copy link
Member

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
Copy link
Author

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
Copy link
Member

Thanks for testing, that problem should now be fixed.

@jinnovation
Copy link
Author

Excellent, looks like that did the trick.

Let me know how else I can assist.

@CyberShadow
Copy link
Member

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

@jinnovation
Copy link
Author

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
Copy link
Member

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
Copy link
Author

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. 👏

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

No branches or pull requests

2 participants