Skip to content

Commit

Permalink
cotrol CI var during build tests
Browse files Browse the repository at this point in the history
  • Loading branch information
IanButterworth committed Dec 15, 2022
1 parent 3f315c0 commit 41c9870
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/api.jl
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,9 @@ end
@info "Auto precompilation enabled"
Pkg.develop(Pkg.PackageSpec(path="packages/Dep4"))
Pkg.develop(Pkg.PackageSpec(path="packages/NoVersion")) # a package with no version number
Pkg.build(io=iob) # should trigger auto-precomp
withenv("CI" => "false") do
Pkg.build(io=iob) # should trigger auto-precomp when not on CI
end
@test occursin("Precompiling", String(take!(iob)))
Pkg.precompile(io=iob)
@test !occursin("Precompiling", String(take!(iob))) # test that the previous precompile was a no-op
Expand All @@ -153,7 +155,9 @@ end

ENV["JULIA_PKG_PRECOMPILE_AUTO"]=1
Pkg.develop(Pkg.PackageSpec(path="packages/BrokenDep"))
Pkg.build(io=iob) # should trigger auto-precomp and soft-error
withenv("CI" => "false") do
Pkg.build(io=iob) # should trigger auto-precomp and soft-error when not on CI
end
@test occursin("Precompiling", String(take!(iob)))
broken_packages = Pkg.API.pkgs_precompile_suspended
@test length(broken_packages) == 1
Expand Down

0 comments on commit 41c9870

Please sign in to comment.