Skip to content

Instantly share code, notes, and snippets.

@ferdyh
Last active October 22, 2021 12:24
Show Gist options
  • Save ferdyh/b76d01cedb6c03c953004a35e2888b35 to your computer and use it in GitHub Desktop.
Save ferdyh/b76d01cedb6c03c953004a35e2888b35 to your computer and use it in GitHub Desktop.
cat run_results.json| jq --raw-output '.results | map("<testcase name=\"" + (.unique_id|gsub("\\.[a-z0-9]{10}$"; "")|rtrimstr(".")) + "\" time=\"" + (.execution_time|tostring) + "\"" + if (.status != "pass") then "><failure message=\"" + .message + "\" /></testcase>" else "/>" end)' | jq -r '.[]' | (echo "<testsuites><testsuite>" && cat && echo "</testsuite></testsuites>") > test-results.xml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment