-
-
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
fix issue 1074 and clean up junitxml #1091
fix issue 1074 and clean up junitxml #1091
Conversation
@alex can you perhaps take a look if that branch has positive effect on the memory usage of the junit reporting of the large testsuite? |
Sorry for taking so long to review this @RonnyPfannschmidt! 😅 Overall I really liked the changes you made. As a minor nitpick, I found some PEP-8 errors (mostly too much white-space between functions), but as I said those are minor. It seems this PR would interest @icemac as well. |
names = mangle_testnames(report.nodeid.split("::")) | ||
def make_properties_node(self): | ||
"""Return a Junit node containing custom properties set for | ||
the current test, if any, and reset the current custom properties. |
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.
This docstring no longer reflects reality (it doesn't clean properties
).
Aside from my minor comments, LGTM. 👍 Feel free to merge if you think my naming suggestions are not worthwhile to make right now. 😄 |
I will have a look into it, after this PR is merged and released. Thanks for looking into it. |
@icemac please take a look at it beforehand, i don't have a good benchmark atm, and i'd like to be sure i'm delivering the right thing |
@RonnyPfannschmidt I'll test today. |
@RonnyPfannschmidt I get an exception after some tests are run (summing up the number of successes etc. in the summary line is less than the number of collected items), see the transcript:
|
i see, good find, i'll investigate |
after investigation i'm certain the issue cannot be replicated when running the correct version of pytest @nicoddemus @hpk42 this one seems ready for merge |
'failure', | ||
'skipped', | ||
], 0) | ||
self.nodere_porters = {} # nodeid -> _NodeReporter |
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.
Should this be node_reporters
?
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.
good find
Could be that the problem reported by @icemac be due to |
i think its related to the issue about duplicate tests |
Good idea. But then it should be simple to verify it, just pass the same file name to pytest twice and you should see the same error. If that's the case we should fix this branch, as we just decided that running the same set of tests more than once is a valid use case. |
i just tried, and it will err out |
The current master will repeat a new <?xml version="1.0" encoding="utf-8"?>
<testsuite errors="0" failures="0" name="pytest" skips="0" tests="2" time="0.013">
<testcase classname="tmp.test_foo1" file="tmp\test_foo1.py" line="0" name="test_1" time="0.0010001659393310547"/>
<testcase classname="tmp.test_foo1" file="tmp\test_foo1.py" line="0" name="test_1" time="0.0010001659393310547"/>
</testsuite> I was thinking, to support the same case here, perhaps we could:
This will change the order of the What do you think? |
Will break on xdist |
You mean in the normal usage, or for duplicated test ids? |
For duplicate tests, they can interleave wrt reports |
Thought about that too, but that happens today already IIUC (both |
I plan to fix both by extending the key with the slave ID and implemening your proposal |
Sounds good, thanks! But how will you know which item was executed in which slave? We don't have how to get that information now, I think. |
Oooh didn't know about this line: def slave_testreport(self, node, rep):
if rep.when == "call" or (rep.when == "setup" and not rep.passed):
self.sched.remove_item(node, rep.item_index, rep.duration)
# self.report_line("testreport %s: %s" %(rep.id, rep.status))
rep.node = node # <----
self.config.hook.pytest_runtest_logreport(report=rep)
self._handlefailures(rep) So the |
that little gem came directly from @hpk42 :) |
I think this change warrants a CHANGELOG entry |
I think after you add a CHANGELOG entry you can merge this @RonnyPfannschmidt |
im on it |
+ review: should we allow the same key multile times
21c9979
to
7b7737b
Compare
rebased on to of master and added the entry, i'll wait for travis then push the button |
👍 |
fix issue 1074 and clean up junitxml
i started by running yapf on junitxml to get my ide warning-free
did the same on its tests and will simplify the test api a bit (i want the xml api out of the picture)
Fix #1074
Fix #641