-
-
Notifications
You must be signed in to change notification settings - Fork 119
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
Implemented repeat attempts by default #394
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.
🙌
Hi! Wow, having a @repeat is great! Just one thing. What do the tests do? I don't get the names: Thanks @danieldisu! |
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!!
@rocboronat Both tests were doing the same, I removed one and change the name of the other for
I've extracted the Statement building to methods, but I'm not sure that's what you were pointing here 🤔 |
@Sloy @rocboronat @alorma Can you review it again 🙏 |
* Use this method when constructing the Rule to apply a default behavior of @[Repeat] without having to add the annotation to | ||
* each test. This can help you to find flaky tests. | ||
* <br></br> | ||
* The default behavior can be overridden with [Repeat] or [Repeat]. |
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.
[Repeat] or [Repeat]
?
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.
It was [Repeat] or [AllowFlaky]
, fixed!
@@ -44,6 +44,16 @@ public void repeatStatementReturnedWhenRepeatAnnotationFound() throws Exception | |||
assertTrue(resultStatement instanceof RepeatStatement); | |||
} | |||
|
|||
@Test | |||
public void repeatStatementReturnedWhenRepeatSetRepeatAttemptsByDefault() throws Exception { |
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.
Sorry, I don't get the repeat set repeat
😅
Maybe repeatStatementReturnedWhenSettingDefaultRepeatAttempts
?
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.
Yep, it make sense 👍 , changed
} | ||
|
||
@Test | ||
public void lastStatementReturnedWhenRepeatAttemptsByDefaultAndAllowFlakyStatementUsedAtTheSameTime() throws Exception { |
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.
Not that important because it's easier to get, but just to be coherent:
lastStatementReturnedWhenDefaultRepeatAttemptsAndAllowFlakyStatementUsedAtTheSameTime
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.
Changed 👍
There are some comments but if the Adevinta team wants to go on, it's good for me 👍 Thanks @danieldisu! |
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.
That's it then! Thanks!
Let's wait for the CI to finish testing... |
In this PR I've added a method that allows users to set repeat attempts by default, it works the same way than
allowFlakyAttemptsByDefault
but applies the@Retry
annotation to all methods