Skip to content
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

Merged

Conversation

tareqalayan
Copy link
Contributor

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.

@tareqalayan
Copy link
Contributor Author

@nicoddemus
I closed the PR to master,

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.

@nicoddemus
Copy link
Member

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 1.10.

v = str(p.getAttribute('value'))
actual[k] = v

assert (len(actual.keys()) == len(expected.keys()))
Copy link
Member

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. 😉

@tareqalayan tareqalayan force-pushed the add-global-properties-node branch 5 times, most recently from b07658c to 4c2736f Compare March 15, 2016 15:06
@tareqalayan
Copy link
Contributor Author

@nicoddemus Thank you for the good reviews so far.
please take a look and let me know if i need to change something.

assert True

This will add a property node below the testsuite node to the generated xml:
.. code-block:: xml
Copy link
Member

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

Copy link
Contributor Author

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants