-
Notifications
You must be signed in to change notification settings - Fork 176
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
Fix lcov 2.0 source file handling #315
Fix lcov 2.0 source file handling #315
Conversation
Prior to 2.0 being released, `genhtml` was much better about handling source files from the following paths: * `test/support/some_helper.ex` * `lib/foo/bar.ex` But after 2.0 was released, when rendering with `genhtml` the paths would be mangled and look like the following: * `test/support/test/support/some_helper.ex` * `lib/foo/lib/foo/bar.ex` 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`).
3633ecf
to
c6b4bd4
Compare
@@ -53,18 +53,18 @@ defmodule ExCoveralls.LcovTest do | |||
Lcov.execute(@source_info) | |||
end) =~ @stats_result | |||
|
|||
assert(File.read!(report) =~ ~s(TN:\nSF:test/fixtures/test.ex\nDA:1,0\nDA:2,1\nLF:2\nLH:1\nend_of_record\n)) | |||
%{size: size} = File.stat! report | |||
assert(size == @file_size) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to remove the file size assertion because with the absolute path being used, it would cause the file size to be different.
We already test the file size via the File.read!
and matching it against the string.
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 |
Thanks! |
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? |
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. |
Thanks for the detailed information 🙇 . I try to release the package later today. |
Prior to 2.0 being released,
genhtml
was much better about handling source files from the following paths:test/support/some_helper.ex
lib/foo/bar.ex
But after 2.0 was released, when rendering with
genhtml
the paths would be mangled and look like the following:test/support/test/support/some_helper.ex
lib/foo/lib/foo/bar.ex
I have tried in vain with many permutations of
--prefix
when runninggenhtml
but the ultimate fix that made all of this go away was using the absolute path for the source file (SF
).