Skip to content

Commit

Permalink
fix: store failure on last retry only (#181)
Browse files Browse the repository at this point in the history
Signed-off-by: Yvonnick Esnault <yvonnick.esnault@corp.ovh.com>
  • Loading branch information
yesnault authored and bnjjj committed Feb 12, 2019
1 parent f363173 commit 0b0228a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion process_teststep.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ func (v *Venom) RunTestStep(tcc TestCaseContext, e *ExecutorWrap, ts *TestSuite,
result, err = runTestStepExecutor(tcc, e, ts, step, l)

if err != nil {
tc.Failures = append(tc.Failures, Failure{Value: RemoveNotPrintableChar(err.Error())})
// we save the failure only if it's the last attempt
if retry == e.retry {
tc.Failures = append(tc.Failures, Failure{Value: RemoveNotPrintableChar(err.Error())})
}
continue
}

Expand Down
2 changes: 1 addition & 1 deletion tests/MyTestSuiteHTTP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ testcases:
- result.body ShouldContainSubstring /dedicated/server
- result.body ShouldContainSubstring /ipLoadbalancing
- result.statuscode ShouldEqual 200
- result.bodyjson.apis.apis0.path ShouldEqual /allDom
- result.bodyjson.apis.apis0.path ShouldEqual /services

- name: POST http testcase
steps:
Expand Down

0 comments on commit 0b0228a

Please sign in to comment.