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
  • Loading branch information
IanButterworth authored Aug 28, 2024
1 parent 8b2c0f3 commit 43e7849
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 @@ -716,6 +716,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 @@ -726,18 +727,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 43e7849

Please sign in to comment.