-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
junitxml: add properties node in testsuite level #1454
junitxml: add properties node in testsuite level #1454
Conversation
@nicoddemus however i am not sure if this is correct flow. please point me to the docs where i should mention this feature. thanks for the comments again. |
dbbd9fb
to
fd11b56
Compare
About the doc, I'm thinking here, just before the warning... also I think it is worth adding that this feature specifically will only be available in |
v = str(p.getAttribute('value')) | ||
actual[k] = v | ||
|
||
assert (len(actual.keys()) == len(expected.keys())) |
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.
No need to check the size and then each item individually, just simply:
assert actual == expected
And let pytest's assertion introspection take care of a good error message for you. 😉
b07658c
to
4c2736f
Compare
@nicoddemus Thank you for the good reviews so far. |
assert True | ||
|
||
This will add a property node below the testsuite node to the generated xml: | ||
.. code-block:: xml |
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.
Please add a blank line before this one otherwise this won't show up correctly in the generated HTML
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.
done
The commit allow users to add a properties node in testsuite level see example below: <testsuite errors="0" failures="0" name="pytest" skips="1" tests="1" time="11.824"> <properties> <property name="ARCH" value="PPC"/> <property name="OS" value="RHEL 7.2"/> <property name="TestPlanURL" value="https://url.."/> <property name="Automated" value="True"/> </properties> <testcase classname="git.....> </testcase> </testsuite> The current situation is that properties node can be added to every testcase node. However, sometimes we need some global properties that applies to all testcases and give better description for the testsuite itself.
4c2736f
to
fa6acdc
Compare
the output is validated against[1] [1] https://github.com/jenkinsci/xunit-plugin/blob/master/src/main/resources/org/jenkinsci/plugins/xunit/types/model/xsd/junit-10.xsd |
junitxml: add properties node in testsuite level
The commit allow users to add a properties node in testsuite level see
example below:
The current situation is that properties node can be added to every
testcase node. However, sometimes we need some global properties that
applies to all testcases and give better description for the testsuite
itself.