Skip to content

Commit

Permalink
make some test_logs match any because of new Downloads debugs (#4007)
Browse files Browse the repository at this point in the history
(cherry picked from commit 43e7849)
  • Loading branch information
IanButterworth authored and KristofferC committed Oct 18, 2024
1 parent e2f4632 commit d4a39f0
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions test/new.jl
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,7 @@ end
(:debug, "tiered_resolve: trying PRESERVE_ALL_INSTALLED"),
(:debug, "tiered_resolve: trying PRESERVE_ALL"),
min_level=Logging.Debug,
match_mode=:any,
Pkg.add(Pkg.PackageSpec(;name="JSON", version="0.18.0"); preserve=Pkg.PRESERVE_TIERED_INSTALLED)
)
@test Pkg.dependencies()[exuuid].version == v"0.3.0"
Expand All @@ -721,18 +722,29 @@ end
@test_logs(
(:debug, "tiered_resolve: trying PRESERVE_ALL_INSTALLED"),
min_level=Logging.Debug,
match_mode=:any,
Pkg.add("Example"; preserve=Pkg.PRESERVE_TIERED_INSTALLED) # should only add v0.3.0 as it was installed earlier
)
@test Pkg.dependencies()[exuuid].version == v"0.3.0"

withenv("JULIA_PKG_PRESERVE_TIERED_INSTALLED" => true) do
Pkg.activate(temp=true)
@test_logs (:debug, "tiered_resolve: trying PRESERVE_ALL_INSTALLED") min_level=Logging.Debug Pkg.add(name="Example")
@test_logs(
(:debug, "tiered_resolve: trying PRESERVE_ALL_INSTALLED"),
min_level=Logging.Debug,
match_mode=:any,
Pkg.add(name="Example")
)
@test Pkg.dependencies()[exuuid].version == v"0.3.0"
end

Pkg.activate(temp=true)
@test_logs (:debug, "tiered_resolve: trying PRESERVE_ALL") min_level=Logging.Debug Pkg.add(name="Example") # default 'add' should serve a newer version
@test_logs(
(:debug, "tiered_resolve: trying PRESERVE_ALL"),
min_level=Logging.Debug,
match_mode=:any,
Pkg.add(name="Example") # default 'add' should serve a newer version
)
@test Pkg.dependencies()[exuuid].version > v"0.3.0"
end
# - `tiered` is the default option.
Expand Down

0 comments on commit d4a39f0

Please sign in to comment.