-
Notifications
You must be signed in to change notification settings - Fork 126
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
Remove support for junit-xml, use Jinja2 instead #3150
Conversation
7b86542
to
be139fe
Compare
Hello @happz , thanks for your early hints. It's still very early for a review. Many code parts will probably change, especially due to the Polarion report plugin. |
Is it possible to validate the |
Currently, this functionality is not supported, and the XML files are not validated against any XSD schema, even when using From python-junit-xml
The I plan to create simple XSD schemas for each JUnit flavor supported by TMT and add tests validating the generated JUnit files against these schemas. Additionally, it would be a good idea to have TMT dynamically validate the schema of the generated JUnit files. If a file does not conform to its respective schema, the report plugin should fail, unless e.g. the |
+1. Check out #3153, it does similar validation when consuming |
a2a6e2b
to
47307a9
Compare
b042929
to
1e59194
Compare
280830b
to
85b1822
Compare
0d2969b
to
8554165
Compare
9ee1638
to
e613189
Compare
e613189
to
d8c650a
Compare
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.
LGTM
d8c650a
to
49a0604
Compare
49a0604
to
597e000
Compare
597e000
to
38c9d87
Compare
This PR removes support for the deprecated
junit-xml
library and uses the Jinja2 to generate JUnit XML instead.It also prepares support for various junit flavors (
--flavor
) and adds the possibility to specify user-defined JUnit Jinja templates using the--template-path
and--flavor=custom
options. These options are mutually exclusive.The current implementation requires that custom templates must be valid XML files. If we want to allow users use non-XML custom templates, we would probably go with something like template report plugin for results.
The implementation of the
polarion
flavor and its support in the Polarion report plugin will be addressed in a separate PR. In this PR, the Polarion report plugin just calls thejunit.make_junit_xml
function in nearly the same way as before, aiming to keep the Polarionxunit.xml
file unchanged.TODOs:
default
flavor and validate the XML output against this schema. Warn user if there are any problems.[ ] Possibility to specify template variables directly from cmdline as key-values (e.g.- This could be a part of "template" report plugin in the future.--var <key> <value>
) for acustom
flavor / user-defined template?"
are not escaped to"
inside of tag data (they are correctly escaped inside attributes). According to my knowledge, this should be OK and the XML is also valid.The generated XML output is not a valid XML file or it is not valid against the XSD schema
.duration
should be probably converted tofloat
and propagated to XMLtime="<val>"
attributes as float, not an integer. If this gets changed, is it possible to enforce float attributes in XSD schema? - tmt works with seconds, let's just convert them to floats using a jinja filter.Pull Request Checklist