dariodf / lcov_ex

Elixir lcov report generator
MIT License
31 stars 7 forks source link

Refactor task to avoid creating and swapping mix files on runs #14

Closed dariodf closed 1 year ago

dariodf commented 1 year ago

In order to avoid generating and overwriting files on the fly, this PR makes use of some undocumented Mix functions to change the Mix.Project configuration on a task runtime. With this possibility, we:

Also, some tests were updated to run with the proper configuration and increase the overall line coverage.

paulswartz commented 1 year ago

I tried this out on one of our Umbrella applications, and while it is creating the global .lcov, it looks like it's not correctly creating the file paths: https://github.com/paulswartz/api/actions/runs/3313439996

Here's the first couple lines of the .lcov file:

TN:Elixir.ALBMonitor
SF:lib/alb_monitor.ex

However, the actual file lives at apps/alb_monitor/lib/alb_monitor.ex.

Another issue (which might not be lcov_ex's fault) is that mocks using mox appear as a file within the deps module. I'm not sure what the right behavior is: probably ignoring them?

TN:Elixir.FakeAws
SF:/home/runner/work/api/api/deps/mox/lib/mox.ex
dariodf commented 1 year ago

Another issue (which might not be lcov_ex's fault) is that mocks using mox appear as a file within the deps module. I'm not sure what the right behavior is: probably ignoring them?

You are completely right, this happens when you add the mocks.ex file and the mock modules get compiled beforehand, and a simple ignored_paths: ["deps/"] default did the trick.

Would you mind giving it another round? Thank you very much again!