File tree Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -362,14 +362,9 @@ jobs:
362362 with :
363363 template : templates/k8s.yaml
364364 - name : " Run BATS k8s tests"
365- # Wish we could use BATS_TEST_RETRIES=3 as an environment variable here,
366- # but bats does not seem to support it.
367- uses : nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
368- with :
369- timeout_minutes : 30
370- retry_on : error
371- max_attempts : 3
372- command : ./hack/bats/lib/bats-core/bin/bats --timing ./hack/bats/extras/k8s.bats
365+ run : ./hack/bats/lib/bats-core/bin/bats --timing ./hack/bats/extras/k8s.bats
366+ env :
367+ LIMA_BATS_ALL_TESTS_RETRIES : 3
373368
374369 colima :
375370 name : " Colima tests (QEMU, Linux host)"
Original file line number Diff line number Diff line change @@ -8,6 +8,16 @@ set -o errexit -o nounset -o pipefail
88# The upstream PR https://github.com/bats-core/bats-core/pull/1118 is still open, so our submodule points to the PR commit.
99export BATS_RUN_ERREXIT=1
1010
11+ # BATS_TEST_RETRIES must be set for the individual test and cannot be imported from the
12+ # parent environment because the BATS test runner sets it to 0 before running the test.
13+ BATS_TEST_RETRIES=${LIMA_BATS_ALL_TESTS_RETRIES:- 0}
14+
15+ # Known flaky tests should call `flaky` inside the @test to allow retries up to
16+ # LIMA_BATS_FLAKY_TESTS_RETRIES even when the LIMA_BATS_ALL_TESTS_RETRIES is lower.
17+ flaky () {
18+ BATS_TEST_RETRIES=${LIMA_BATS_FLAKY_TESTS_RETRIES:- $BATS_TEST_RETRIES }
19+ }
20+
1121# Don't run the tests in ~/.lima because they may destroy _config, _templates etc.
1222export LIMA_HOME=${LIMA_BATS_LIMA_HOME:- $HOME / .lima-bats}
1323
@@ -71,4 +81,4 @@ assert_output_lines_count() {
7181declare -A -g TEST_CONTAINER_IMAGES=(
7282 [" nginx" ]=" ghcr.io/stargz-containers/nginx:1.19-alpine-org"
7383 [" coredns" ]=" public.ecr.aws/eks-distro/coredns/coredns:v1.12.2-eks-1-31-latest"
74- )
84+ )
You can’t perform that action at this time.
0 commit comments