-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Populate output xml file after every test on a suite is completed #12350
Comments
Given that this would probably be a substantial slowdown for many test suites, we're unlikely to put this in Pytest. I'd suggest copying this logic to your own hook which will be run after each test function, probably |
Altering the xml writer so it dumps and releases while updating a xml header by overwriting it would actually resolve the resource issues we currently face with captured output intensive test suites |
Hi, excellent! Glad to hear your suggestions and comments guys. Thanks in advance. |
The topic is not something I'll personally touch I haven't used junitxml output in almost a decade |
What's the problem this feature will solve?
I have been running tests suites on automated regressions via Jenkins using pytest for a while. Usually it runs without issues but from time to time due to timeouts an interrupt will kill the job and the output xml file will not be generated even thought some tests have been successfully run.
Is there a chance to extend/generate the output xml file after every test is completed? So if the suite face a timeout sigterm we still will be able to get the results for the tests that run without issues until that point.
I've run through the code (I'm not an expert on pytest) but I think it is related to this function.
Example: Lets say that we have a test suite with 10 tests, sometimes due timeout the job receive a sigterm that kills it at some point, for example, lets say on the 7th test , but all 6 previous tests have been run successfully. At this point the output xml file is not been created so the info for the previous 6 tests is lost.
Describe the solution you'd like
I would like to know if there is a flag o way to make the xml output generated every time a tests runs to avoid the issue of loosing information (specially if it is a big suite with far more tests and it takes a lot more of time to run).
I'm quite aware that this process (if possible or implemented) could add more time to the overall run time, but it will be appreciated and a reasonable trade off (at least in my case) instead of having to run a big suite of tests from scratch if a percentage or big part of it is already completed.
Additional context
Current versions related to pytest being used on my test environment:
pytest-randomly==3.4.0
pytest-repeat==0.8.0
pytest-timeout==1.3.4
pytest==6.2.5
I'll be glad to hear any suggestion from the pytest team or contribute with a PR for this one if needed.
The text was updated successfully, but these errors were encountered: