Skip to content

Commit

Permalink
Test repeat when run command returns non-zero exit code
Browse files Browse the repository at this point in the history
  • Loading branch information
jonsmock committed Dec 5, 2024
1 parent 79fc91a commit b81e935
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions examples/00-intro.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,21 @@ tests:
steps:
- exec: node1
run: rm -f repeat-test-file

- name: Repeat on non-zero exit code
exec: node1
repeat: { retries: 2, interval: '1s' }
run: |
if [ ! -f repeat-test-file ]; then
touch repeat-test-file
exit 1
fi
- exec: node1
run: rm -f repeat-test-file

- name: Repeat on failed expect assertion
exec: node1
repeat: { retries: 2, interval: '1s' }
run: |
if [ ! -f repeat-test-file ]; then
Expand All @@ -86,5 +100,6 @@ tests:
fi
expect:
- step.stdout == "Repeated successfully"

- exec: node1
run: rm -f repeat-test-file

0 comments on commit b81e935

Please sign in to comment.