When I query the API for test metadata:
curl https://circleci.com/api/v1.1/project/github/ACCT/project/12345/tests -H "Circle-Token: REDACTED"
I get back the results as I would expect and I can pipe that into jq and see our failure:
jq '[.tests[] | select(.result=="failure")] | unique' ~/test.json
[
{
"classname": "spec.features.admin.commerce.member_cards_spec",
"file": "spec/features/admin/commerce/member_cards_spec.rb",
"name": "Removing Stored Credit Cards with stored cards selecting a non-default card removing the card",
"result": "failure",
"run_time": 14.366128,
"message": "Failure/Error: expect(page).to have_content(last4)...'",
"source": "unknown",
"source_type": "unknown"
}
]
Is there a way to pass along additional attributes from a junit formatter that I can get back in the API (e.g. team)? I tried adding additional attributes to our rspec junit formatter, but had no luck. It looks like there is source
and source_type
. I could use that but I am unsure where to set that in the junit output to get it to pass through, because it isn’t in the schema either.