diff --git a/Project.toml b/Project.toml index f06fc58b..39b38ea7 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "RegistryCI" uuid = "0c95cc5f-2f7e-43fe-82dd-79dbcba86b32" authors = ["Dilum Aluthge ", "Fredrik Ekre ", "contributors"] -version = "7.5.0" +version = "7.5.1" [deps] Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" diff --git a/test/automerge-unit.jl b/test/automerge-unit.jl index aba69916..1ba756e9 100644 --- a/test/automerge-unit.jl +++ b/test/automerge-unit.jl @@ -514,18 +514,20 @@ end @testset "`AutoMerge.meets_version_has_osi_license`" begin # Let's install a fresh depot in a temporary directory # and add some packages to inspect. - tmp_path = mktempdir() + tmp_depot = mktempdir() function has_osi_license_in_depot(pkg) return AutoMerge.meets_version_has_osi_license( - pkg; pkg_code_path=pkgdir_from_depot(tmp_path, pkg) + pkg; pkg_code_path=pkgdir_from_depot(tmp_depot, pkg) ) end - withenv("JULIA_DEPOT_PATH" => tmp_path, "JULIA_PKG_SERVER" => "") do - run(`julia -e 'import Pkg; Pkg.Registry.add("General")'`) - end - withenv("JULIA_DEPOT_PATH" => tmp_path) do - run(`julia -e 'import Pkg; Pkg.add(["RegistryCI"])'`) - end + env1 = copy(ENV) + env1["JULIA_DEPOT_PATH"] = tmp_depot + delete!(env1, "JULIA_LOAD_PATH") + delete!(env1, "JULIA_PROJECT") + env2 = copy(env1) + env2["JULIA_PKG_SERVER"] = "" + run(setenv(`julia -e 'import Pkg; Pkg.Registry.add("General")'`, env2)) + run(setenv(`julia -e 'import Pkg; Pkg.add(["RegistryCI"])'`, env1)) # Let's test ourselves and some of our dependencies that just have MIT licenses: result = has_osi_license_in_depot("RegistryCI") @test result[1] @@ -535,7 +537,7 @@ end @test result[1] # Now, what happens if there's also a non-OSI license in another file? - pkg_path = pkgdir_from_depot(tmp_path, "UnbalancedOptimalTransport") + pkg_path = pkgdir_from_depot(tmp_depot, "UnbalancedOptimalTransport") open(joinpath(pkg_path, "LICENSE2"); write=true) do io cc0_bytes = read(joinpath(@__DIR__, "license_data", "CC0.txt")) println(io) @@ -550,7 +552,7 @@ end @test !result[1] # What about no license at all? - pkg_path = pkgdir_from_depot(tmp_path, "VisualStringDistances") + pkg_path = pkgdir_from_depot(tmp_depot, "VisualStringDistances") rm(joinpath(pkg_path, "LICENSE")) result = has_osi_license_in_depot("VisualStringDistances") @test !result[1]