Closed dariodf closed 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
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!
In order to avoid generating and overwriting files on the fly, this PR makes use of some undocumented
Mix
functions to change theMix.Project
configuration on a task runtime. With this possibility, we:mix lcov
task to run amix lcov.run
subtask that runs recursively in the:test
environment for each project.mix lcov.run
change the current project configuration to addLcovEx
as the:test_coverage
tool, and run the actualmix test
task for the project.mix lcov
task once the recursive tasks finished.Also, some tests were updated to run with the proper configuration and increase the overall line coverage.