JuliaCI / Coverage.jl

Take Julia code coverage and memory allocation results, do useful things with them
MIT License
174 stars 68 forks source link

Duplicated files in Coveralls #245

Closed ronisbr closed 4 years ago

ronisbr commented 4 years ago

Hi!

All my files are repeated 6 times in Coveralls analysis: https://coveralls.io/github/JuliaSpace/SatelliteToolbox.jl?branch=master. This does not happen with Coverage. I think this must be related to the fact that I was testing against 6 Julia versions. Is it expected?

I am using Coverage analysis by the native support in Travis:


language: julia

os:
    - linux
    - osx

julia:
    - 1.0
    - 1.2
    - nightly

codecov: true
coveralls: true

matrix:
    allow_failures:
        - julia: nightly

notifications:
    email: false

jobs:
  include:
    - stage: "Documentation"
      julia: 1.2
      os: linux
      script:
        - julia --project=docs/ -e 'using Pkg; Pkg.instantiate(); Pkg.add(PackageSpec(path=pwd()))'
        - julia --project=docs/ --color=yes docs/make.jl
      after_success: skip
DilumAluthge commented 4 years ago

This is an issue with the Coveralls.io service, not with the Coverage.jl or CoverageCore.jl packages.

The Coveralls.io service does not understand how to correctly merge multiple coverage reports for the same source code file. Therefore, if you go to your Coveralls.io dashboard, you see multiple duplicates of the same source file.

In contrast, the Codecov.io service correctly merges reports (https://docs.codecov.io/docs/merging-reports), and it does so automatically. Therefore, if you go to your Codecov.io dashboard, you will not see these duplicates.

The issue is with Coveralls.io, and unfortunately they need to be the ones to fix it.

If this is a problem for you, I'd recommend only using Codecov.io and not even bothering with Coveralls.io

vtjnash commented 4 years ago

I happened to be browsing the Coveralls.io docs, and found that it describes how to support this, it's just not automatic like codecov.io. We need to send parallel=true in the partial messages (if env COVERALLS_PARALLEL=true), then send a final "done" message to merge them and emit the report after all CI runs are completed. Theres examples for various CI provides at https://docs.coveralls.io/parallel-build-webhook.

DilumAluthge commented 4 years ago

We need to send parallel=true in the partial messages (if env COVERALLS_PARALLEL=true)

That seems very doable.

then send a final "done" message to merge them and emit the report after all CI runs are completed

That seems much harder. How would Coverage.jl know all of the CI runs are completed?

DilumAluthge commented 4 years ago

Ah, based off of the link you posted, I see what you mean. You have to set up the post-build webhook with the CI provider.

But what if you have two or more CI providers (e.g. Travis and AppVeyor) and you want to combine all the reports. Do you have to set up post-build webhooks on all of the CI providers? Does Coveralls understand that there are multiple CI providers?