Skip to content

Commit

Permalink
[ISSUE-70] Possibility to not fail the test during retries
Browse files Browse the repository at this point in the history
  • Loading branch information
siller174 committed Apr 22, 2024
1 parent 3065426 commit b3fb204
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions builder_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func (qt *cute) RequestRepeatDelay(delay time.Duration) RequestHTTPBuilder {

// RequestRepeatPolitic set politic for request repeat.
// if response.Code != Expect.Code, than request will repeat Count counts with Delay delay.
// if Optional is true and request is failed, than test step allure will be option, and t.Fail() will not execute.
// if Optional is true and request is failed, than test step allure will be skipped, and t.Fail() will not execute.
// If Broken is true and request is failed, than test step allure will be broken, and t.Fail() will not execute.
func (qt *cute) RequestRepeatPolitic(politic *RequestRepeatPolitic) RequestHTTPBuilder {
if politic == nil {
Expand All @@ -37,8 +37,8 @@ func (qt *cute) RequestRepeatPolitic(politic *RequestRepeatPolitic) RequestHTTPB
return qt
}

// RequestRepeatOption set option politic for request repeat.
// if Optional is true and request is failed, than test step allure will be option, and t.Fail() will not execute.
// RequestRepeatOptional set option politic for request repeat.
// if Optional is true and request is failed, than test step allure will be skipped, and t.Fail() will not execute.
func (qt *cute) RequestRepeatOptional(option bool) RequestHTTPBuilder {
qt.tests[qt.countTests].Request.Repeat.Optional = option

Expand Down
10 changes: 5 additions & 5 deletions interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,11 @@ type TableTest interface {
ControlTest
}

// RequestHTTPBuilder is a scope of methods for create HTTP requests
// RequestHTTPBuilder is a scope of methods to create HTTP requests
type RequestHTTPBuilder interface {
// Request is function for set http.Request
Request(r *http.Request) ExpectHTTPBuilder
// RequestBuilder is function for create http.Request with help builder.
// RequestBuilder is function for set http.Request with builders
// Available builders:
// WithMethod
// WithURL
Expand All @@ -169,7 +169,7 @@ type RequestHTTPBuilder interface {
RequestParams
}

// RequestParams is a scope of methods for configurate http request
// RequestParams is a scope of methods to configure request
type RequestParams interface {
// RequestRepeat is a function for set options in request
// if response.Code != Expect.Code, than request will repeat counts with delay.
Expand All @@ -183,12 +183,12 @@ type RequestParams interface {

// RequestRepeatPolitic is a politic for repeat request.
// if response.Code != Expect.Code, than request will repeat counts with delay.
// if Optional is true and request is failed, than test step allure will be option, and t.Fail() will not execute.
// if Optional is true and request is failed, than test step allure will be skipped, and t.Fail() will not execute.
// If Broken is true and request is failed, than test step allure will be broken, and t.Fail() will execute.
RequestRepeatPolitic(politic *RequestRepeatPolitic) RequestHTTPBuilder

// RequestRepeatOptional is a option politic for repeat request.
// if Optional is true and request is failed, than test step allure will be option, and t.Fail() will not execute.
// if Optional is true and request is failed, than test step allure will be skipped, and t.Fail() will not execute.
RequestRepeatOptional(optional bool) RequestHTTPBuilder

// RequestRepeatBroken is a broken politic for repeat request.
Expand Down
2 changes: 1 addition & 1 deletion test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ type Request struct {
}

// RequestRepeatPolitic is struct for repeat politic
// if Optional is true and request is failed, than test step allure will be option, and t.Fail() will not execute.
// if Optional is true and request is failed, than test step allure will be skip, and t.Fail() will not execute.
// If Broken is true and request is failed, than test step allure will be broken, and t.Fail() will not execute.
// If Optional and Broken is false, than test step will be failed, and t.Fail() will execute.
// If response.Code != Expect.Code, than request will repeat Count counts with Delay delay.
Expand Down

0 comments on commit b3fb204

Please sign in to comment.