-
Notifications
You must be signed in to change notification settings - Fork 11
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
Repeat on failure #53 #214
base: develop
Are you sure you want to change the base?
Conversation
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.
We have some points where we could improve. Some of which needs further investigations.
{ | ||
TYPE, METHOD | ||
}) | ||
public @interface RepeatOnFailure |
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.
We need JavaDoc here.
@@ -0,0 +1,24 @@ | |||
package com.xceptance.neodymium.module.statement.repeat; | |||
|
|||
public class RepeatOnFailureData |
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.
Need some JavaDoc here.
|
||
import com.xceptance.neodymium.module.StatementBuilder; | ||
|
||
public class RepeatStatement extends StatementBuilder |
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.
Also JavaDoc
public static AtomicInteger val = new AtomicInteger(0); | ||
|
||
@Test | ||
public void testVisitingHomepage() |
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.
We might want to have some more meaningful test case names here.
import com.xceptance.neodymium.module.statement.repeat.RepeatOnFailure; | ||
|
||
@RunWith(NeodymiumRunner.class) | ||
public class OverridingRepeatOnFailureTest |
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 test is not testing any override.
} | ||
catch (Throwable t) | ||
{ | ||
if (iterationIndex != maxRepetitionNumber) |
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.
When we interact with a browser, we will need a fresh browser instance here. Otherwise we will reuse the same browser with cookies and session data from the previously failed test.
}) | ||
public @interface RepeatOnFailure | ||
{ | ||
int value() default 1; |
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.
The value currently represents the number of maximum runs. So if we have it set to 1, we'll run only once even if the test fails. The semantic of @RepeatOnFailure(1)
is that the test is repeated once on fail therefore has two runs.
We should change the meaning of the value so that @RepeatOnFailure(1)
has one repeated run (or in other words two runs).
public String getTestName(Object data) | ||
{ | ||
RepeatOnFailureData d = (RepeatOnFailureData) data; | ||
return "Run number " + d.getIterationNumber(); |
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.
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.
We should investigate if we can improve the current implementation in terms of reporting.
In the jUnit/Allure report, we a lot of skipped runs if the run succeeded before the maximum was reached. Also we always see all failed (repeated) runs, will be go as errors into any report statistic. It would be cool if we could configure to suppress such failed cases which went green on retry (since the test case is known to be flaky otherwise we would not add this annotation).
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.
Please investigate if removing the "skipped" and "failed" runs from the reporting can be done easily, otherwise we can add an improvement in a separate task.
} | ||
|
||
@Override | ||
public String getCategoryName(Object data) |
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 leads to a separate category in the junit test report for all tests using this annotation. It would be nicer if only test reruns land in a separate category and tests which ran successfully just go into a default category.
No description provided.