-
Notifications
You must be signed in to change notification settings - Fork 18
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
[ISSUE-70] Possibility to not fail the test during retries #72
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.
Overall looks good to me, only few minor comments, thanks for the implementation!
RequestRepeatOptional(optional bool) RequestHTTPBuilder | ||
|
||
// RequestRepeatBroken is a broken politic for repeat request. | ||
// If Broken is true and request is failed, than test step allure will be broken, and t.Fail() will execute. |
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.
If Broken is true and request is failed, than test step allure will be broken, and t.Fail() will execute.
I guess you mean t.Fail() will not execute here ?
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.
Right now, t.fail
will be executed if we have a broken test. What do you think about it? Is it good way or not?
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.
I think that Broken will be very similar to just keep default behaviour then
I was thinking that you introduced the Broken flag to have another way of handling the tests.
Basically I thought as follow:
- Optional: true -> Will mark the retry as skipped and not fail the whole test
- Broken: true -> Will mark the retry as failed, the whole test as broken, but not fail the whole test
- Optional: false, Broken false -> Will mark the retries as failed as well as the overall test as failed
Let me know if my understanding is incorrect
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.
Broken true -> Will mark the retries as failed as well as the overall test as failed.
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.
@siller174 Sorry for late reply, let me give more details:
This is currently what is happening when I put Optional: true
Here is what I had in mind with the optional mechanism:
- If all retries are failing -> fail the test and do not execute the rest of the test (assertions and so on)
- If after x retry (x < maxRetryCount), the x retry is successful, continue the rest of the test (assertions and so on)
Aside from this, for now the retry is mostly based on the HttpCode assertion, but I would say it can apply to all kind of assertions instead (body assertion, http code assertion, header assertion, response assertion)
i.e. if any kind of assertion fails during the test process, apply the same retry logic as mentioned in points 1. and 2. above
No description provided.