I am working with two packages, where a downstream package depends on a base package. The directory structure is of the form
A
- Project.toml
- Manifest.toml
- src
- [...]
- test
- [...]
- B
- Project.toml
- Manifest.toml
- src
- [...]
- test
- [...]
Other unrelated files are not mentioned here.
The downstream package B
dev
s the base package A
. I am trying to run the tests for B
and look at the coverage in A/src
, that is how much of A
’s code is covered by the testset of B
.
I am using
julia --startup=no --project=downstream --code-coverage=user
to start Julia, and then I use
julia> using Pkg
julia> Pkg.test(coverage=true)
to run the tests for B
on Julia v1.9.3. The tests run fine, but I find that *.cov
files are generated only within B/src
. No *.cov
files are generated in A/src
. The behavior is as expected on Julia v1.6, where running the tests generates a *.cov
corresponding to each source file in A/src
that is hit. I’m unsure why this is not the case on v1.9. I have also tried with --code-coverage=all
but that doesn’t change anything, as might be expected. The tests on v1.9 do hit these files, but there’s no corresponding coverage file that’s written out.
In Julia 1.9 Highlights there’s a mention of coverage tracking fewer files by default, but I couldn’t understand if this changes the behavior of --code-coverage=user
.
Any suggestion on how to restore the 1.6-like behavior and generate coverage files for A/src
as well?