parroty / excoveralls

Coverage report tool for Elixir with coveralls.io integration.
MIT License
820 stars 178 forks source link

Fix lcov 2.0 source file handling #315

Closed warmwaffles closed 1 year ago

warmwaffles commented 1 year ago

Prior to 2.0 being released, genhtml was much better about handling source files from the following paths:

But after 2.0 was released, when rendering with genhtml the paths would be mangled and look like the following:

I have tried in vain with many permutations of --prefix when running genhtml but the ultimate fix that made all of this go away was using the absolute path for the source file (SF).

warmwaffles commented 1 year ago

Hopefully @parroty this is okay to merge upstream as it would be nice for me to stop having to manually shim in a find replace for SF: files in my lcov info file.

parroty commented 1 year ago

Thanks!

warmwaffles commented 1 year ago

I think the issue resides somewhere in the lcov perl based upstream when they updated to 2.0, but I really don't know or have the time to go figure that bit out.

standback

parroty commented 1 year ago

Thanks for the comment 🙇 . (Before releasing the new version) I just wanted to confirm if it works on lcov 1.x too, as it's about the path expansion, correct?

warmwaffles commented 1 year ago

Correct, it's the path expansion/truncation being messed up. I have not checked this with lcov 1.0 as my distro and others have all bumped and upgraded as well.

warmwaffles commented 1 year ago

This is what it looks like on LCOV 2.0 before this patch

20230808-233818

And after the patch is applied

20230808-234028

Generated with

MIX_ENV=test mix coveralls.lcov

genhtml \
    --output-directory cover \
    --show-navigation \
    --no-function-coverage \
    --no-branch-coverage \
    --flat \
    --quiet \
    ./cover/lcov.info
warmwaffles commented 1 year ago

20230808-234429

Here's the patch with lcov 1.16

pardon my crappy coverage here... you can see why I need this 😄

parroty commented 1 year ago

Thanks for the detailed information 🙇 . I try to release the package later today.