Skip to content

Commit

Permalink
Merge pull request #254 from JuliaCI/tb/bail_out_quicker
Browse files Browse the repository at this point in the history
Bail out quicker when we can't test
  • Loading branch information
maleadt authored Jan 11, 2024
2 parents 8ba894e + a420566 commit d1513ff
Showing 1 changed file with 21 additions and 14 deletions.
35 changes: 21 additions & 14 deletions scripts/test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,28 @@ finally
end
end

# ensure the package has a test/runtests.jl file, so we can bail out quicker
src = Base.find_package(pkg.name)
runtests = joinpath(dirname(src), "..", "test", "runtests.jl")
if !isfile(runtests)
error("Package $(pkg.name) did not provide a `test/runtests.jl` file")
end

is_stdlib = any(Pkg.Types.stdlibs()) do (uuid,stdlib)
name = isa(stdlib, String) ? stdlib : first(stdlib)
name == pkg.name
end
if is_stdlib
println("\n$(pkg.name) is a standard library in this Julia build.")

# we currently only support testing the embedded version of stdlib packages
if pkg.version !== nothing || pkg.url !== nothing || pkg.rev !== nothing
error("Packages that are standard libraries can only be tested using the embedded version.")
end
end

if config.precompile

if config.precompile && !is_stdlib
print("\n\n", '#'^80, "\n# Precompilation\n#\n\n")

# we run with JULIA_PKG_PRECOMPILE_AUTO=0 to avoid precompiling on Pkg.add,
Expand All @@ -126,19 +146,6 @@ end

print("\n\n", '#'^80, "\n# Testing\n#\n\n")

is_stdlib = any(Pkg.Types.stdlibs()) do (uuid,stdlib)
name = isa(stdlib, String) ? stdlib : first(stdlib)
name == pkg.name
end
if is_stdlib
println("\n$(pkg.name) is a standard library in this Julia build.")

# we currently only support testing the embedded version of stdlib packages
if pkg.version !== nothing || pkg.url !== nothing || pkg.rev !== nothing
error("Packages that are standard libraries can only be tested using the embedded version.")
end
end

t0 = cpu_time()
io0 = io_bytes()
try
Expand Down

0 comments on commit d1513ff

Please sign in to comment.