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

Don't bail out on test errors by default #10835

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
9 changes: 8 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,15 @@ cd(dirname(@__FILE__)) do

@everywhere include("testdefs.jl")

reduce(propagate_errors, nothing, pmap(runtests, tests; err_retry=false, err_stop=true))
err_stop = haskey(ENV, "JL_TESTFAILURE_STOP")
results = reduce(propagate_errors, nothing, pmap(runtests, tests; err_retry=false, err_stop=err_stop))

@unix_only n > 1 && rmprocs(workers(), waitfor=5.0)

# exit(1) if any test raised an error so that travis knows the build failed.
if any(x -> x==true, results)
exit(1)
end

println(" \033[32;1mSUCCESS\033[0m")
end
11 changes: 8 additions & 3 deletions test/testdefs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,18 @@ function runtests(name)
end

function propagate_errors(a,b)
if isa(a,Exception)
err_stop = haskey(ENV, "JL_TESTFAILURE_STOP")
err = false
if isa(a, Exception) || isa(b, Exception)
err = true
end
if isa(a,Exception) && err_stop
rethrow(a)
end
if isa(b,Exception)
if isa(b,Exception) && err_stop
rethrow(b)
end
nothing
err
end

# looking in . messes things up badly
Expand Down