Skip to content

Commit d875361

Browse files
authored
Merge pull request #2061 from pi-hole/update/bats
Update BATS core to 1.14
2 parents 32152b5 + d1fcd34 commit d875361

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

test/run.sh

100644100755
Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ docker buildx build \
2323
if [ -z "${BATS:-}" ]; then
2424
mkdir -p libs
2525
if [ ! -d libs/bats ]; then
26-
git clone --depth=1 --quiet --branch "${BATS_VERSION:-v1.13.0}" https://github.com/bats-core/bats-core libs/bats
26+
git clone --depth=1 --quiet --branch "${BATS_VERSION:-v1.14.0}" https://github.com/bats-core/bats-core libs/bats
2727
fi
2828
if [ ! -d libs/bats-support ]; then
2929
git clone --depth=1 --quiet --branch "${BATS_SUPPORT_VERSION:-v0.3.0}" https://github.com/bats-core/bats-support libs/bats-support
@@ -49,15 +49,14 @@ TEST_FILES=(
4949
# Configure BATS output and parallelization
5050
BATS_FLAGS=();
5151

52-
# Use pretty output when stdout is a terminal; TAP format for CI
53-
if [[ -t 1 ]]; then
54-
BATS_FLAGS+=("-p")
55-
fi
52+
# Use pretty output, since BATS 1.14 CI runs will auto-adjust
53+
BATS_FLAGS+=("-p")
5654

5755
# Parallelize tests if GNU parallel is available
5856
if command -v parallel > /dev/null 2>&1; then
5957
echo "GNU parallel found, running tests in parallel"
6058
BATS_FLAGS+=("--jobs" "$(nproc)")
6159
fi
6260

63-
"$BATS" "${BATS_FLAGS[@]}" "${TEST_FILES[@]}"
61+
# Ensure that the TERM environment variable is set for colored CI output, defaulting to xterm if not set
62+
TERM=${TERM:-xterm} "$BATS" "${BATS_FLAGS[@]}" "${TEST_FILES[@]}"

0 commit comments

Comments
 (0)