-
Notifications
You must be signed in to change notification settings - Fork 216
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
feat: add junit output callback #853
base: master
Are you sure you want to change the base?
Conversation
I need this exact feature, so I second this pull request. |
You can take the file and add it to your project, that's what I did since it was never reviewed. |
"validators: " + str(phase_data["validators"]), | ||
"measured_value: " + str(phase_data["measured_value"]), | ||
"outcome: " + phase_data["outcome"], | ||
"log: " + "\n".join(log_output), "\n"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was having an issue with this throwing an exception because there was no "validators" entry in the phase_data dictionary for a measurement generated by a monitor. The change below resolved that issue with me.
if "name" in phase_data:
output.extend(["name: " + phase_data["name"]])
if "validators" in phase_data:
output.extend(["validators: " + str(phase_data["validators"])])
if "measured_value" in phase_data:
output.extend(["measured_value: " + str(phase_data["measured_value"])])
if "outcome" in phase_data:
output.extend(["outcome: " + phase_data["outcome"]])
output.extend(["log: " + "\n".join(log_output), "\n"])
What I did
I added a callback to get JUNIT files as an output.
Why I did it
In CI context, Jenkins uses JUNIT files to record tests. I have based my work on the JSON factory example.
Test output call example
XML example
Test with Jenkins plugin Test results analyzer
Success
Failure
Note
I was not quite sure of what to put instead of
test
in line 66This change is