Switch to using BATS helpers as submodules

This commit is contained in:
Deploy Bot
2025-07-17 21:02:16 -04:00
parent a23b1d7a10
commit 3e235c9375
2 changed files with 13 additions and 25 deletions

View File

@@ -25,7 +25,11 @@ jobs:
--health-retries 5
steps:
- uses: actions/checkout@v3
- name: Checkout code with submodules
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: 'recursive'
- name: Install dependencies
run: |
@@ -38,28 +42,13 @@ jobs:
sudo ./bats-core/install.sh /usr/local
fi
# Install bats-support and bats-assert in a local directory
BATS_HELPER_PATH="$GITHUB_WORKSPACE/bats-helpers"
mkdir -p "$BATS_HELPER_PATH"
# Clone bats-support
if [ ! -d "$BATS_HELPER_PATH/bats-support" ]; then
git clone https://github.com/bats-core/bats-support.git "$BATS_HELPER_PATH/bats-support" --depth 1
# Verify BATS helpers are available
if [ ! -d "tests/test_helper/bats-support" ] || [ ! -d "tests/test_helper/bats-assert" ] || [ ! -d "tests/test_helper/bats-file" ]; then
echo "Error: BATS helper libraries not found in test_helper directory"
ls -la tests/test_helper/
exit 1
fi
# Clone bats-assert
if [ ! -d "$BATS_HELPER_PATH/bats-assert" ]; then
git clone https://github.com/bats-core/bats-assert.git "$BATS_HELPER_PATH/bats-assert" --depth 1
fi
# Clone bats-file
if [ ! -d "$BATS_HELPER_PATH/bats-file" ]; then
git clone https://github.com/bats-core/bats-file.git "$BATS_HELPER_PATH/bats-file" --depth 1
fi
# Export the path for use in tests
echo "BATS_LIB_PATH=$BATS_HELPER_PATH" >> $GITHUB_ENV
- name: Set up SSH
run: |
# Create .ssh directory

View File

@@ -1,10 +1,9 @@
#!/usr/bin/env bats
# Load BATS helper libraries
export BATS_LIB_PATH="/tmp/bats-helpers"
load "$BATS_LIB_PATH/bats-support/load.bash"
load "$BATS_LIB_PATH/bats-assert/load.bash"
load "$BATS_LIB_PATH/bats-file/load.bash"
load 'test_helper/bats-support/load'
load 'test_helper/bats-assert/load'
load 'test_helper/bats-file/load'
# Simple test for parse_volume function
@test "parse_volume should parse volume string correctly" {