Skip to content

Commit

Permalink
BATS: Fix minimum BATS version
Browse files Browse the repository at this point in the history
Rather than having specific requests for minimum BATS version, just have
one globally in `load.bash` and let everything else assume we have a good
version.

Signed-off-by: Mark Yen <[email protected]>
  • Loading branch information
mook-as committed May 6, 2024
1 parent bbed332 commit 5973212
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
4 changes: 4 additions & 0 deletions bats/tests/helpers/load.bash
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ setup_file() {
if semver_gt 5.0.0 "$(semver "$BASH_VERSION")"; then
fail "Bash 5.0.0 is required; you have $BASH_VERSION"
fi
# We currently use a submodule that provides BATS 1.10; we do not test
# against any other copy of BATS (and therefore only support the version in
# that submodule).
bats_require_minimum_version 1.10.0
# Ideally this should be printed only when using the tap formatter,
# but I don't see a way to check for this.
echo "# ===== $RD_TEST_FILENAME =====" >&3
Expand Down
4 changes: 0 additions & 4 deletions bats/tests/helpers/vm.bash
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
local_setup_file() {
bats_require_minimum_version 1.5.0
}

wait_for_shell() {
if is_windows; then
try --max 48 --delay 5 rdctl shell true
Expand Down
1 change: 0 additions & 1 deletion bats/tests/k8s/traefik.bats
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ local_setup() {
skip "Test does not yet work from inside a WSL distro when using networking tunnel, since it requires WSL integration"
fi
needs_port 80
bats_require_minimum_version 1.5.0
}

assert_traefik_pods_are_down() {
Expand Down
1 change: 0 additions & 1 deletion bats/tests/k8s/wasm.bats
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ assert_traefik_crd_established() {
# Get Kubernetes RuntimeClasses; sets $output to the JSON list.
get_runtime_classes() {
# kubectl may emit warnings here; ensure that we don't fall over.
bats_require_minimum_version 1.5.0
run --separate-stderr kubectl get RuntimeClasses --output json
assert_success || return

Expand Down

0 comments on commit 5973212

Please sign in to comment.