-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Buildkite Test Analytics: fix failure_expanded
#53706
Buildkite Test Analytics: fix failure_expanded
#53706
Conversation
Pinging @tecosaur as the main author of |
Hello @pda, thanks for raising this issue and coming in with a fix too (with such a detailed explanation too 😍)! Looking at the code, it all looks good to me 🙂 Personally, I'd prefer it if the As a (personal) style nit, I'm not sure I'm a fan of the closing braces on their own lines, and would be tempted to do a more compact style like this data["failure_expanded"] =
[Dict{String,Any}("expanded" => split(err, '\n'),
"backtrace" => split(trace, '\n'))] but I think at this point we're more in the realm of personal preference than style guides. So, this looks good to me and thanks again for the contribution! |
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
Done!
I'll absolutely defer to you on Julia style, it's not my home turf at all. |
Aside: I notice the environment var Line 431 in e99627f
But it seems to be working, so perhaps the environment is being modified somewhere within the test running scripts etc? This is what I ran to generate the files locally:
|
Thank you @pda! |
This pull request changes
failure_expanded
fromDict{String, Any}
toVector{Dict{String, Any}}
to fix a JSON schema issue in the Bootleg JSON writer 🏴☠️ which is responsible for producing JSON test results for Buildkite Test Analytics.The
failure_expanded
attribute of a test result is a JSON array of objects, rather than 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.I believe the associated uploads (batches of up to 5,000 results) are currently getting a successful HTTP 202 Accepted response, but the response body will contain an error for each test case that had a non-array
failure_expanded
, meaning those test cases will be dropped:Rather than make the Buildkite API more permissive, I figured I'd come and fix it upstream, and write my first few tiny lines of Julia while I'm at it 😁
I've verified that the adjusted JSON output it accepted by our ingestion system.
For verification, I added an error to an arbitrarily selected test (because workers don't return information about passing/broken tests, only errors or failure):
… and then
CI=true ./julia test/runtests.jl char
which producestest/results_1.json
.Before:
After:
Diff: