Skip to content

Commit 0347a5e

Browse files
Use new directory-specific codecov tracking (#3021)
1 parent 7beb67e commit 0347a5e

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@ Pkg v1.9 Release Notes
33

44
- Pkg will now respect the version of packages put into the sysimage using e.g. PackageCompiler. For example,
55
if version 1.3.2 of package A is in the sysimage, Pkg will always install that version when adding the package,
6-
or when the packge is installed as a dependency to some other package. This can be disabled by calling `Pkg.respect_sysimage_versions(false)`.
6+
or when the packge is installed as a dependency to some other package. This can be disabled by calling
7+
`Pkg.respect_sysimage_versions(false)` ([#3002]).
8+
- When code coverage tracking is enabled for `Pkg.test` the new path-specific code-coverage option is used to limit coverage
9+
to the directory of the package being tested. Previously the `--code-coverage=user` option was used, which tracked files
10+
in all code outside of Core & Base, i.e. all stdlibs and all user packages, which often made running tests with
11+
code coverage a lot slower ([#3021]).
712

813
Pkg v1.8 Release Notes
914
======================
@@ -59,3 +64,5 @@ Pkg v1.7 Release Notes
5964
[#2933]: https://github.com/JuliaLang/Pkg.jl/issues/2933
6065
[#2985]: https://github.com/JuliaLang/Pkg.jl/issues/2985
6166
[#2995]: https://github.com/JuliaLang/Pkg.jl/issues/2995
67+
[#3002]: https://github.com/JuliaLang/Pkg.jl/issues/3002
68+
[#3021]: https://github.com/JuliaLang/Pkg.jl/issues/3021

src/Operations.jl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1450,19 +1450,20 @@ function free(ctx::Context, pkgs::Vector{PackageSpec}; err_if_free=true)
14501450
end
14511451
end
14521452

1453-
function gen_test_code(testfile::String;
1453+
function gen_test_code(source_path::String;
14541454
coverage=false,
14551455
julia_args::Cmd=``,
14561456
test_args::Cmd=``)
1457+
test_file = testfile(source_path)
14571458
code = """
14581459
$(Base.load_path_setup_code(false))
1459-
cd($(repr(dirname(testfile))))
1460+
cd($(repr(dirname(test_file))))
14601461
append!(empty!(ARGS), $(repr(test_args.exec)))
1461-
include($(repr(testfile)))
1462+
include($(repr(test_file)))
14621463
"""
14631464
return ```
14641465
$(Base.julia_cmd())
1465-
--code-coverage=$(coverage ? "user" : "none")
1466+
--code-coverage=$(coverage ? string("@", source_path) : "none")
14661467
--color=$(Base.have_color === nothing ? "auto" : Base.have_color ? "yes" : "no")
14671468
--compiled-modules=$(Bool(Base.JLOptions().use_compiled_modules) ? "yes" : "no")
14681469
--check-bounds=yes
@@ -1742,7 +1743,7 @@ function test(ctx::Context, pkgs::Vector{PackageSpec};
17421743
Pkg._auto_precompile(sandbox_ctx, warn_loaded = false)
17431744
printpkgstyle(ctx.io, :Testing, "Running tests...")
17441745
flush(ctx.io)
1745-
cmd = gen_test_code(testfile(source_path); coverage=coverage, julia_args=julia_args, test_args=test_args)
1746+
cmd = gen_test_code(source_path; coverage=coverage, julia_args=julia_args, test_args=test_args)
17461747
p = run(pipeline(ignorestatus(cmd), stdin = stdin, stdout = sandbox_ctx.io, stderr = stderr_f()), wait = false)
17471748
interrupted = false
17481749
try

0 commit comments

Comments
 (0)