Skip to content

Commit

Permalink
test: bats warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
carlossg committed Aug 20, 2024
1 parent 8cfe24b commit f61ddd7
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions tests/tests.bats
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ SUT_IMAGE=maven
SUT_TAG=${TAG:-eclipse-temurin-17}
SUT_TEST_IMAGE=bats-maven-test

bats_require_minimum_version 1.5.0

load 'test_helper/bats-support/load'
load 'test_helper/bats-assert/load'
load test_helpers
Expand Down Expand Up @@ -77,7 +79,6 @@ base_image=eclipse-temurin-17
# Changes here need to be documented in the table in the README

@test "$SUT_TAG git is installed" {
run docker run --rm $SUT_IMAGE:$SUT_TAG git --version
if ! (
[[ "$SUT_TAG" == *"-alpine" ]] ||
[[ "$SUT_TAG" == "amazoncorretto-"* ]] ||
Expand All @@ -86,20 +87,20 @@ base_image=eclipse-temurin-17
[[ "$SUT_TAG" == "libericaopenjdk-"* ]] ||
[[ "$SUT_TAG" == *"graalvm"* ]]
); then
run docker run --rm $SUT_IMAGE:$SUT_TAG git --version
[ $status -eq 0 ]
else
[ $status -ne 0 ]
run -127 docker run --rm $SUT_IMAGE:$SUT_TAG git --version
fi
}

@test "$SUT_TAG curl is installed" {
run docker run --rm $SUT_IMAGE:$SUT_TAG curl --version
if [[ "$SUT_TAG" == amazoncorretto-*-debian ]] ||
[[ "$SUT_TAG" == azulzulu-*-debian ]]; then
[ $status -ne 0 ]
run -127 docker run --rm $SUT_IMAGE:$SUT_TAG curl --version
else
run docker run --rm $SUT_IMAGE:$SUT_TAG curl --version
[ $status -eq 0 ]

fi
}

Expand All @@ -114,14 +115,14 @@ base_image=eclipse-temurin-17
}

@test "$SUT_TAG which is installed" {
run docker run --rm $SUT_IMAGE:$SUT_TAG which sh
if ! (
[[ "$SUT_TAG" == openjdk-?? ]] ||
[[ "$SUT_TAG" == *"oracle"* ]]
); then
run docker run --rm $SUT_IMAGE:$SUT_TAG which sh
[ $status -eq 0 ]
else
[ $status -ne 0 ]
run -127 docker run --rm $SUT_IMAGE:$SUT_TAG which sh
fi
}

Expand All @@ -148,17 +149,17 @@ base_image=eclipse-temurin-17
}

@test "$SUT_TAG gpg is installed" {
run docker run --rm $SUT_IMAGE:$SUT_TAG gpg --version
if (
[[ "$SUT_TAG" == amazoncorretto-? ]] ||
[[ "$SUT_TAG" == amazoncorretto-?? ]] ||
[[ "$SUT_TAG" == amazoncorretto-*-al2023 ]] ||
[[ "$SUT_TAG" == openjdk-?? ]] ||
[[ "$SUT_TAG" == *"graalvm"* ]]
); then
run docker run --rm $SUT_IMAGE:$SUT_TAG gpg --version
[ $status -eq 0 ]
else
[ $status -ne 0 ]
run -127 docker run --rm $SUT_IMAGE:$SUT_TAG gpg --version
fi
}

Expand Down

0 comments on commit f61ddd7

Please sign in to comment.