Add Junix XML export for SuiteResult#2352
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces the ability to export test suite results to JUnit XML format, adding a to_junit_xml method to the SuiteResult class and implementing the export logic in a new module. The implementation includes detailed mapping of scenario results, checks, and metrics to standard JUnit elements. Review feedback identifies opportunities to improve the generated XML by removing redundant step data in failure details and reducing file size by avoiding duplicate JSON payloads across the properties and system-out sections.
|
Updated the XML mapping to follow maintainer feedback: |
|
I addressed the review feedback in
When convenient, could a maintainer add the |
kevinmessiaen
left a comment
There was a problem hiding this comment.
Thanks for your first contribution to Giskard!
Looking good, however there is a small issue with having duplicated data in the report.
I also left some comments on how we could improve the outputs display while reusing already existing code.
| @@ -0,0 +1,222 @@ | |||
| from __future__ import annotations | |||
There was a problem hiding this comment.
from __future__ import annotations is unnecessary with 3.12+
| from __future__ import annotations |
|
Hi again, thanks for the feedback. I pushed |
Description
Adds native JUnit XML export for
SuiteResultusing onlyxml.etree.ElementTree.This PR introduces:
giskard.checks.export.junit.to_junit_xmlSuiteResult.to_junit_xml(...)convenience methodSuiteResult-><testsuite>ScenarioResult-><testcase>final_traceand step payloads as propertiesValidation:
uv run pytest libs/giskard-checks/tests/export/test_junit.py -quv run pytest libs/giskard-checks/tests -qRelated Issue
Closes #2345
Type of Change
Checklist
CODE_OF_CONDUCT.mddocument.CONTRIBUTING.mdguide.pdm.lockrunningpdm update-lock(only applicable whenpyproject.tomlhas beenmodified)