2
2
3
3
using Test, Random
4
4
5
+ include (" buildkitetestjson.jl" )
6
+
5
7
function runtests (name, path, isolate= true ; seed= nothing )
6
8
old_print_setting = Test. TESTSET_PRINT_ENABLE[]
7
9
Test. TESTSET_PRINT_ENABLE[] = false
8
10
# remove all hint_handlers, so that errorshow tests are not changed by which packages have been loaded on this worker already
9
11
# packages that call register_error_hint should also call this again, and then re-add any hooks they want to test
10
12
empty! (Base. Experimental. _hint_handlers)
13
+ withenv (" JULIA_TEST_RECORD_PASSES" => Base. get_bool_env (" CI" , false )) do
11
14
try
12
15
if isolate
13
16
# Simple enough to type and random enough so that no one will hard
@@ -30,7 +33,13 @@ function runtests(name, path, isolate=true; seed=nothing)
30
33
original_env = copy (ENV )
31
34
original_project = Base. active_project ()
32
35
33
- Base. include (m, " $path .jl" )
36
+ try
37
+ Base. include (m, " $path .jl" )
38
+ finally
39
+ if Base. get_bool_env (" CI" , false )
40
+ BuildkiteTestJSON. serialize_testset_result_file (@__DIR__ , Test. get_testset ())
41
+ end
42
+ end
34
43
35
44
if Base. DEPOT_PATH != original_depot_path
36
45
msg = " The `$(name) ` test set mutated Base.DEPOT_PATH and did not restore the original values"
@@ -98,6 +107,7 @@ function runtests(name, path, isolate=true; seed=nothing)
98
107
ex isa TestSetException || rethrow ()
99
108
return Any[ex]
100
109
end
110
+ end # withenv
101
111
end
102
112
103
113
# looking in . messes things up badly
0 commit comments