Skip to content

Commit 1256e3e

Browse files
committed
Buildkite Test Analytics: fix failure_expanded
The `failure_expanded` attribute of a test result is an _array_ of objects, not a single object. I believe this is to support the possibility of multiple failure reasons in a single test case, although I'm not sure if that's used anywhere. https://buildkite.com/docs/test-analytics/importing-json#json-test-results-data-reference-test-result-objects
1 parent b70e1ae commit 1256e3e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/buildkitetestjson.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ function add_failure_info!(data::Dict{String, Any}, result::Test.Result)
105105
data["failure_reason"] = if result.test_type === :test_error
106106
if occursin("\nStacktrace:\n", result.backtrace)
107107
err, trace = split(result.backtrace, "\nStacktrace:\n", limit=2)
108-
data["failure_expanded"] = Dict{String, Any}(
109-
"expanded" => split(err, '\n'),
110-
"backtrace" => split(trace, '\n'))
108+
data["failure_expanded"] =
109+
[Dict{String,Any}("expanded" => split(err, '\n'),
110+
"backtrace" => split(trace, '\n'))]
111111
end
112112
"Exception (unexpectedly) thrown during test"
113113
elseif result.test_type === :test_nonbool

0 commit comments

Comments
 (0)