Switch to using BATS helpers as submodules
This commit is contained in:
31
.github/workflows/test.yml
vendored
31
.github/workflows/test.yml
vendored
@@ -25,7 +25,11 @@ jobs:
|
|||||||
--health-retries 5
|
--health-retries 5
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- name: Checkout code with submodules
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
submodules: 'recursive'
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
@@ -38,28 +42,13 @@ jobs:
|
|||||||
sudo ./bats-core/install.sh /usr/local
|
sudo ./bats-core/install.sh /usr/local
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Install bats-support and bats-assert in a local directory
|
# Verify BATS helpers are available
|
||||||
BATS_HELPER_PATH="$GITHUB_WORKSPACE/bats-helpers"
|
if [ ! -d "tests/test_helper/bats-support" ] || [ ! -d "tests/test_helper/bats-assert" ] || [ ! -d "tests/test_helper/bats-file" ]; then
|
||||||
mkdir -p "$BATS_HELPER_PATH"
|
echo "Error: BATS helper libraries not found in test_helper directory"
|
||||||
|
ls -la tests/test_helper/
|
||||||
# Clone bats-support
|
exit 1
|
||||||
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
|
|
||||||
fi
|
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
|
- name: Set up SSH
|
||||||
run: |
|
run: |
|
||||||
# Create .ssh directory
|
# Create .ssh directory
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
#!/usr/bin/env bats
|
#!/usr/bin/env bats
|
||||||
|
|
||||||
# Load BATS helper libraries
|
# Load BATS helper libraries
|
||||||
export BATS_LIB_PATH="/tmp/bats-helpers"
|
load 'test_helper/bats-support/load'
|
||||||
load "$BATS_LIB_PATH/bats-support/load.bash"
|
load 'test_helper/bats-assert/load'
|
||||||
load "$BATS_LIB_PATH/bats-assert/load.bash"
|
load 'test_helper/bats-file/load'
|
||||||
load "$BATS_LIB_PATH/bats-file/load.bash"
|
|
||||||
|
|
||||||
# Simple test for parse_volume function
|
# Simple test for parse_volume function
|
||||||
@test "parse_volume should parse volume string correctly" {
|
@test "parse_volume should parse volume string correctly" {
|
||||||
|
|||||||
Reference in New Issue
Block a user