PkgTemplates.jl icon indicating copy to clipboard operation
PkgTemplates.jl copied to clipboard

Visualize detailed coverage information on GitLab

Open piever opened this issue 5 years ago • 5 comments

Thanks a lot for this package, it's been very useful to set up a package on GitLab.!

There is one thing I couldn't figure out though. I'm running "code coverage" after testing, and I got the corresponding code on the gitlab-ci.yml config file:

.coverage:
  coverage: /Test coverage (\d+\.\d+%)/
  after_script:
    - |
      julia -e '
        using Pkg
        Pkg.add("Coverage")
        using Coverage
        c, t = get_summary(process_folder())
        using Printf
        @printf "Test coverage %.2f%%\n" 100c / t'

However, this just gives an overall number. Is there a way to visualize this coverage information, that is, file by file, line in codecov GitHub hosted packages? Or is it a limitation of GitLab that one has only access to a final number (overall coverage percentage)?

EDIT: please feel free to close if this is off-topic and coverage visualization is not done via the gitlab-ci.yml config file that PkgTemplates generates.

piever avatar Jul 04 '20 13:07 piever

Is there a code coverage service like Codecov or Coveralls that supports GitLab? Because that's what we're looking for here.

christopher-dG avatar Jul 04 '20 21:07 christopher-dG

After a very brief search it seems that Codecov does support GitLab, so that's worth looking into.

christopher-dG avatar Jul 04 '20 21:07 christopher-dG

Ah, you are right! Actually, there is an example julia repo in GitLab here https://gitlab.com/tkpapp/GitlabJuliaDemo.jl that has codecov enabled.

piever avatar Jul 05 '20 14:07 piever

I think the best way forward is to add actual GitLab support to Coverage.jl, since GitLab is officially supported by Codecov. Adding such support looks simple, I just need to test some things before submitting a PR.

christopher-dG avatar Jul 11 '20 21:07 christopher-dG

My Codecov experiments have so far been mostly failures, Codecov gave me HTTP errors when I tried to use my Coverage.jl fork, so I am probably setting some fields incorrectly. Then I tried to use their agnostic Bash uploader with an LCOV file, which kind of worked but had some missing info. I think with some more effort we can make it work, but I'll try another day. I'm also going to look into Coveralls which claims to support GitLab.

christopher-dG avatar Jul 16 '20 17:07 christopher-dG