Closed itkhanz closed 3 weeks ago
@itkhanz , this is currently not possible due to some limitations in Gradle itself. This issue describes the problem for JUnit 5, but the iteration selection works similarly for TestNG, and the plugin can't tell Gradle to execute just a single iteration of the data-driven test method.
I'll close the issue for now, as there is nothing we can do until Gradle addresses the underlying issue..
Hi, I have noticed this behavior with gradle-retry-plugin while running DataDriven tests in TestNG that if any of the run of DataDriven Test gets failed, then instead of retrying that particular test run, it reruns the entire test with all the data again. This is a serious problem lets say if i have a data driven test in TestNG where I am supplying my test with different sets of data to invoke each time with a new data, then it will rerun the entire test again causing long time delay and unnessary retries to test invocations that although got passed in first attempt but will be retried because another test run with a different data for same test got failed.
To reproduce this issue, consider this scenario where i have a simple data driven test which gets invoked 2 times with a different data. During the second invokation of the test when the count is 2, then this test will fail. At this point, instead of retrying this particular test invocation, it retries the entire test again with all the invocations.
Steps to reproduce:
Run the below TestNG test in gradle with
maxRetries
set to 1.Log output:-
As you can see from the results of above execution, that it retries the whole test again instead of retrying it just once with data when count = 2 becuase this test got failed only on this value from datadriven test.
We actually have many test cases, where we are running the data driven tests multiple times, and if retry-plugin starts retrying the entire tests then this results in unncessary retries, and more execution time for the tests.
Could you please look into this and see if it is possible to retry only that test invocation that got failed instead of retrying it all? This would be very helpful. Thank you.