Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make some test_logs match any because of new Downloads debugs #4007

Merged
merged 1 commit into from
Aug 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading