Skip to content

Commit 73ac39e

Browse files
CI: Record one result with duration (#57954)
Helps fill this out with something meaningful, which is better than the current zero duration and the old overcounting. https://buildkite.com/organizations/julialang/analytics/suites/julialang-base?branch=master <img width="1046" alt="Screenshot 2025-03-30 at 11 19 20 PM" src="https://github.com/user-attachments/assets/76e25e2d-aef8-4687-b349-c7017a7b3cdd" />
1 parent 2f34760 commit 73ac39e

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

test/buildkitetestjson.jl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,16 @@ function serialize_testset_result_file(dir::String, testset::Test.DefaultTestSet
258258
end
259259

260260
# deserilalizes the results files and writes them to collated JSON files of 5000 max results
261-
function write_testset_json_files(dir::String)
261+
function write_testset_json_files(dir::String, testset::Test.DefaultTestSet)
262262
data = Dict{String,Any}[]
263263
read_files = String[]
264+
# Set one result to represent the overall duration, given results have no duration
265+
overall_ts = result_dict(testset)
266+
# don't set location or file name for this result. They aren't required by BK
267+
overall_ts["result"] = "unknown"
268+
overall_ts["name"] = replace(get(ENV, "BUILDKITE_LABEL", "job label not found"), r":\w+:\s*" => "")
269+
push!(data, overall_ts)
270+
# Load all the serialized results files
264271
for res_dat in filter!(x -> occursin(r"^results.*\.dat$", x), readdir(dir))
265272
res_file = joinpath(dir, res_dat)
266273
append!(data, Serialization.deserialize(res_file))

test/runtests.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,6 @@ cd(@__DIR__) do
342342
end
343343
end
344344

345-
BuildkiteTestJSON.write_testset_json_files(@__DIR__)
346-
347345
#=
348346
` Construct a testset on the master node which will hold results from all the
349347
test files run on workers and on node1. The loop goes through the results,
@@ -369,6 +367,7 @@ cd(@__DIR__) do
369367
Test.TESTSET_PRINT_ENABLE[] = false
370368
o_ts = Test.DefaultTestSet("Overall")
371369
o_ts.time_end = o_ts.time_start + o_ts_duration # manually populate the timing
370+
BuildkiteTestJSON.write_testset_json_files(@__DIR__, o_ts)
372371
Test.push_testset(o_ts)
373372
completed_tests = Set{String}()
374373
for (testname, (resp,), duration) in results

0 commit comments

Comments
 (0)