julia-actions / julia-processcoverage

MIT License
13 stars 9 forks source link

Exclude files from coverage analysis #12

Open timholy opened 2 years ago

timholy commented 2 years ago

It would be nice to be able to exclude some source files from coverage. A good example is https://github.com/timholy/ProfileView.jl, where the precompile.jl file only runs when the package is being built, not when it gets tested. Coverage is at ~81% altogether, but the coverage of ProfileView.jl is ~91%, and the latter is the more accurate number.

A workaround is to move it to a separate directory, but to me the more attractive option is to exclude it from coverage analysis.

If there's someone who is willing to do the "actions" part of this, I can add a keyword to https://github.com/JuliaCI/CoverageTools.jl/blob/9d8fba371f4c65a7e9ca3bdaae753a52bcb22218/src/lcov.jl#L123

MilesCranmer commented 4 months ago

Anything updates on this? I would love a

#! coverage: off

and

#! coverage: on
IanButterworth commented 4 months ago

Regarding the original use case Tim had, 1.11 now no longer generates coverage data during the precompile stage (though that might be worth checking because there have been some changes in that code since that change was made)