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

Generate code coverage report and upload to codecov.io #66

Open
wants to merge 6 commits into
base: master
from

Conversation

@mjarosie
Copy link

@mjarosie mjarosie commented Oct 19, 2019

Resolves #46

I couldn't successfully install codecov-haskell locally and the repository wasn't updated since June 2017 so I've used codecov.io bash uploader instead of the haskell-specific tool as per the documentation:

It has been a tradition for other products that integrate with different languages to create a specific plugin for each language. We believe this is a bad practice that quickly leads to out-of-date and poorly maintained packages.
One uploader to rule them all.

I think the .cabal file still needs to be changed a bit as hpc produces empty coverage reports for all libraries apart from dense-linear-algebra, hence the PR is still WIP, will update after I fix it : )

@mjarosie mjarosie force-pushed the mjarosie:feature/code_coverage_report branch from f2aef9c to 25eb964 Oct 19, 2019
@mjarosie
Copy link
Author

@mjarosie mjarosie commented Oct 21, 2019

Ok there are 2 issues:

  • the codecov-haskell package looks like it's not maintained anymore and doesn't compile with the newer releases of GHC
  • the stack test with --coverage option doesn't produce the full report and is not digestible by codecov-haskell

The solution to both problems would be to take over the codecov-haskell package. Do you think that's a good idea or should it be better solved somehow else?

@mjarosie mjarosie marked this pull request as ready for review Oct 21, 2019
@lehins
Copy link
Contributor

@lehins lehins commented Oct 21, 2019

@mjarosie Can't help you with the first problem. I've only successfully setup coveralls.io not codecov
For the second one though, after stack test --coverage try running:

$ stack hpc report --all
@lehins
Copy link
Contributor

@lehins lehins commented Oct 21, 2019

Speaking of the problem with codecov, it might be easier to switch to coveralls.io. There is a working solution on how you can set it up with a stack project. Here is an example: https://coveralls.io/github/lehins/massiv?branch=master

@mjarosie mjarosie force-pushed the mjarosie:feature/code_coverage_report branch from 1b4d346 to bad4c31 Oct 21, 2019
@mjarosie
Copy link
Author

@mjarosie mjarosie commented Oct 22, 2019

Thanks, I'll give it a whirl next. I was thinking about using coveralls.io as well, I just couldn't find a working solution either. The example will be really useful!

@lehins
Copy link
Contributor

@lehins lehins commented Nov 2, 2019

@mjarosie FYI, you can now use a static binary instead of recompiling stack-hpc-coveralls on each run
https://github.com/lehins/stack-hpc-coveralls/releases/tag/0.0.5.0

@lehins
Copy link
Contributor

@lehins lehins commented Nov 2, 2019

Something along those line will work:

     stack test --coverage
     stack hpc report --all
     curl -L https://github.com/lehins/stack-hpc-coveralls/releases/download/0.0.5.0/shc.tar.gz | tar xz shc
     ./shc --repo-token=$COVERALLS_REPO_TOKEN combined custom
mjarosie added 2 commits Nov 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants
You can’t perform that action at this time.