From 3e235c9375f3fa52a3ceddcc3f6e4a09d5ba74ea Mon Sep 17 00:00:00 2001 From: Deploy Bot Date: Thu, 17 Jul 2025 21:02:16 -0400 Subject: [PATCH] Switch to using BATS helpers as submodules --- .github/workflows/test.yml | 31 ++++++++++--------------------- tests/parser.bats | 7 +++---- 2 files changed, 13 insertions(+), 25 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7dd3708..61b4792 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 diff --git a/tests/parser.bats b/tests/parser.bats index 918a763..267a685 100755 --- a/tests/parser.bats +++ b/tests/parser.bats @@ -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" {