-
Couldn't load subscription status.
- Fork 716
Add global LIMA_BATS_ALL_TESTS_RETRIES variable
#4224
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
base: master
Are you sure you want to change the base?
Conversation
It will rerun all tests up to this number on failure. Also provides a `flaky` function to set the retries to LIMA_BATS_FLAKY_TESTS_RETRIES to allow a greater number of retries to known flaky tests. Signed-off-by: Jan Dubois <jan.dubois@suse.com>
9fb2d51 to
46e5183
Compare
|
Should we have a default |
|
|
||
| # BATS_TEST_RETRIES must be set for the individual test and cannot be imported from the | ||
| # parent environment because the BATS test runner sets it to 0 before running the test. | ||
| BATS_TEST_RETRIES=${LIMA_BATS_ALL_TESTS_RETRIES:-0} |
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.
Could you also update
lima/.github/workflows/test.yml
Lines 361 to 369 in 463f7e5
| - name: "Run BATS k8s tests" | |
| # Wish we could use BATS_TEST_RETRIES=3 as an environment variable here, | |
| # but bats does not seem to support it. | |
| uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2 | |
| with: | |
| timeout_minutes: 30 | |
| retry_on: error | |
| max_attempts: 3 | |
| command: ./hack/bats/lib/bats-core/bin/bats --timing ./hack/bats/extras/k8s.bats |
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.
ping @jandubois 🙏
No, by default the test shouldn't be flaky. |
|
Needs rebase |
It will rerun all tests up to this number on failure.
Also provides a
flakyfunction to set the retries toLIMA_BATS_FLAKY_TESTS_RETRIESto allow a greater number of retries to known flaky tests.So in CI you could set both, to e.g. retry all tests at least once, but retry flaky tests up to 5 times.