-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: GitHub <noreply@github.com>
- Loading branch information
1 parent
b71ee54
commit f2004f5
Showing
9 changed files
with
108 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
testcases: | ||
|
||
- name: test retry | ||
steps: | ||
- type: exec | ||
script: echo pending | ||
retry: 2 | ||
assertions: | ||
- result.systemout ShouldEqual ok | ||
|
||
- name: test retry and retry_if | ||
steps: | ||
- type: exec | ||
script: sleep 2 && echo error | ||
retry: 5 | ||
retry_if: | ||
- result.systemout ShouldEqual pending | ||
assertions: | ||
- result.systemout ShouldEqual ok |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: testsuite with retry if | ||
testcases: | ||
- name: testsuite with retry if (success) | ||
steps: | ||
- type: exec | ||
# we use a tmp file as "memory" to know whether we're on first attempt or second one | ||
script: | | ||
test -f /tmp/retry-if-first-attempt | ||
RC=$? | ||
touch /tmp/retry-if-first-attempt | ||
exit $RC | ||
retry: 1 | ||
retry_if: | ||
- result.code ShouldNotEqual 0 | ||
assertions: | ||
- result.code ShouldEqual 0 | ||
|
||
- name: testsuite with retry if (failing) | ||
steps: | ||
# spawn a venom sub-process and expect it to fail | ||
- type: exec | ||
script: '{{.venom.executable}} run failing/retry_if.yml' | ||
assertions: | ||
- result.code ShouldEqual 2 | ||
- result.systemerr ShouldBeEmpty | ||
# classic retry | ||
- result.systemout ShouldContainSubstring "It's a failure after 3 attempts" | ||
# retry with condition (sleep 2 * 5 retries = max 10 seconds) | ||
- result.timeseconds ShouldBeLessThan 10 | ||
- result.systemout ShouldContainSubstring "retry conditions not fulfilled, skipping 5 remaining retries" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters