-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Add file
and line
attributes to junit-xml output.
#809
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
Conversation
503e2a1
to
a7b8cbb
Compare
file
attribute to junit-xml output.file
and lineno
attributes to junit-xml output.
a7b8cbb
to
82806d5
Compare
Hey @kevincox, thanks for the PR. Some questions:
Cheers, |
I don't know if there is a "standard". I looked around and couldn't find anything except for a couple of random XML schemas (as you linked). RSpec JUnit Formatter has CircleCI uses these for [automatic balancing]. They also maintain their own formatter that provides this info for minitest (https://github.com/circleci/minitest-ci/blob/master/lib/minitest/ci.rb) I haven't tested on Jenkins but since RSpeck JUnit formatter is designed for Jenkins I would imagine it does. And the point of XML is to be extensible. However if someone could give that a test it would be awesome, I don't have any Jenkins available. |
I fixed the tests on windows. I'll rebase it into one commit when I get home. |
@kevincox I did a quick test in a Jenkins instance using your branch, this was the file generated: <?xml version="1.0" encoding="utf-8"?><testsuite errors="0" failures="0" name="pytest" skips="0" tests="1" time="0.010"><testcase classname="test_foo" file="test_foo.py" lineno="2" name="test_foo" time="0.000999927520752"/></testsuite> But the jobs unfortunately fails:
So it seems that unfortunately Jenkins has a strict schema checking regarding this... 😞 |
070de8f
to
7dfe3af
Compare
I have updated the PR to use the |
file
and lineno
attributes to junit-xml output.file
and line
attributes to junit-xml output.
Excellent! Could you add the url of the junit-10.xsd file in the docstring of the I will test this myself tomorrow, and if nobody opposes this will merge it then. 😄 |
This adds the `file` and `line` attributes to the junit-xml output which can be used by tooling to identify where tests come from. This can be used for many things such as IDEs jumping to failures and test runners evenly balancing tests among multiple executors. Update test_junitxml.py Foo.
7dfe3af
to
7fa27af
Compare
Updated with the requested changes. Do they look good to you? |
They do, thanks! |
@@ -67,6 +67,8 @@ | |||
|
|||
- add a new ``--noconftest`` argument which ignores all ``conftest.py`` files. | |||
|
|||
- add ``file`` and ``line`` attributes to JUnit-XML output. |
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.
If you want, feel free to add a *Thanks to Kevin Cox for PR" like some of the other entries. 😉
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.
Aha I'm fine with this.
Just tested and it works perfectly. Thanks again for the PR! 😄 |
Add `file` and `line` attributes to junit-xml output.
This adds the
file
andlineno
attributes to the junit-xml outputwhich can be used by tooling to identify where tests come from. This can be
used for many things such as IDEs jumping to failures and test
runners evenly balancing tests among multiple executors.