-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
#1706 - WIP - add feature retries #1886
Conversation
I appreciate that you're creating a PR for a new feature. However we request that you open an issues to discuss significant contributions prior to making them. This would have allowed me to point out that the reason Additionally Cucumber-JVM currently doesn't support reporting on retried tests at all. So merely adding functionality to rerun tests until passed will not be sufficient to accept a PR. There is functionality coming up to make it possible to report on retried scenarios but that won't be available until the new Message protocol has been implemented (#1841). Finally it would also have allowed me to point out that if you are using TestNG and aren't interested in fixing testng-team/testng#891 nor willing to wait for #1841 you can also extend |
Cool your final comment will be sufficient for my purposes. |
@mpkorstanje question for you about this comment... let's say I do what you suggested here and then it passes on the 2nd+ try. Will the cucumber-report have a single successful attempt? or will the cucumber-report get messed up? |
I honestly don't know. It will very much depend on the way a particular reporting plugin was written. However given that currently there is no way to differentiate between the events from the original execution and the events from any subsequent rerun, I suspect it won't go well. |
@mpkorstanje I'm currently using https://mvnrepository.com/artifact/net.masterthought/cucumber-reporting/4.11.2 What I can try to do if necessary is run test, some errors occur. we then parse the testng test output and initiate retry on each failing test where appropriate. and if the test passes after the 2nd try, inject the cucumber output from the initial test with the passing test to replace the previously failing test and regenerate the report html. Meh? |
Ideally your reporter would understand that a test was rerun and report it as such. Currently only the native TestNG and JUnit reporters can do that. So you'd have to rely on those reports rather then anything generated by Cucumber or based on Cucumbers output. So if you ask me what you can try: I'd spend my time making tests more stable. |
this is the classic response to the flaky test retry situation. and in my case, there is a mainframe system that causes intermittent test failures completely outside of my control. |
Been there done that. In hindsight it was the biggest waste of my time. 😁 |
@mpkorstanje this works great. I noticed that it still has a json record of the failures prior to the passing retry however. Is there some way to "erase" the previous failed attempts prior to letting the scenario pass? I am looking into the source code of the cucumber-reporting github project as well to see if I can do this during the generation of the pretty HTML report. Because right now the test report looks like there are This isn't that big of a deal, except for the fact that now the real failures if there are any are going to be lumped in with ones that were successfully retried later. |
@mpkorstanje never mind my previous question. i went ahead and added this ability into the cucumber-reporting in a PR. |
Ooh. Well done. |
Summary
Add a retry feature.
Details
Should be able to retry using a --retry parameter, or a Retry annotation.
Motivation and Context
#1706
How Has This Been Tested?
Pending test coverage.
Screenshots (if appropriate):
Types of changes
Checklist: