Support coverage of package extension ?
Hi, I just tried to use LocalCoverage on a package with an extension, but it seems no coverage is generated for these files, even though the tests started by generate_coverage call methods from the extension. Is this currently supported ?
We just call
Pkg.test(pkg; coverage = true, ...)
I am not aware of a way to generate coverage for dependencies, but if you know one, PRs are welcome.
I would recommend asking about this on Discourse, then if there is a viable way we can incorporate it.
@tpapp So actually it works, but is not the default. Since package extensions live under Mypackage > ext and not Mypackage > src the default used in https://github.com/JuliaCI/LocalCoverage.jl/blob/f197f21f94b25074dc5c1abaf7aa3edaa15f3a66/src/LocalCoverage.jl#L234 ignores the coverage for any extension.
There are three solutions there.
- Ignore pre 1.9 packages and change this default to
["src","ext"]to encompass any extension - Make a switch based on
isdefined(Base,:get_extension)that would add"ext"to the list of folders on 1.9+ julia. - Do nothing but inform the user in
READMEthat it is the way to activate this.
What is your opinion ?
Ha, another comment, related to the addition of the "ext" subfolder by default. The current implementation errors if "ext" is provided in the list of subdirs, but does not exist. So there may be something to modify there as well in case you want to change the defaults to account for the extensions' directory.
I'll close this for now, but that may be useful to others