Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
IanButterworth committed Dec 15, 2022
1 parent 35b08ee commit 02e1d2f
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/Operations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1888,13 +1888,19 @@ function test(ctx::Context, pkgs::Vector{PackageSpec};

# Precompile in a child process with the test julia args to ensure native caches match test setup
cmd = gen_test_precompile_code(; coverage, julia_args, test_args)
p = subprocess_handler(cmd, ctx, sandbox_ctx, "Precompilation of test environment interrupted. Exiting the test precompilation process")
success(p) || @warn "Precompilation of test dependencies failed. Continuing to tests"
p, interrupted = subprocess_handler(cmd, ctx, sandbox_ctx, "Precompilation of test environment interrupted. Exiting the test precompilation process")
if !success(p)
if interrupted
return
else
printpkgstyle(ctx.io, :Testing, "Precompilation of test environment failed. Continuing to tests", color = Base.error_color())
end
end

printpkgstyle(ctx.io, :Testing, "Running tests...")
flush(ctx.io)
cmd = gen_test_code(source_path; coverage, julia_args, test_args)
p = subprocess_handler(cmd, ctx, sandbox_ctx, "Tests interrupted. Exiting the test process")
p, interrupted = subprocess_handler(cmd, ctx, sandbox_ctx, "Tests interrupted. Exiting the test process")
if success(p)
printpkgstyle(ctx.io, :Testing, pkg.name * " tests passed ")
elseif !interrupted
Expand Down Expand Up @@ -1964,7 +1970,7 @@ function subprocess_handler(cmd::Cmd, ctx, sandbox_ctx, error_msg::String)
rethrow()
end
end
return p
return p, interrupted
end

# Display
Expand Down

0 comments on commit 02e1d2f

Please sign in to comment.