From 0c0b0b63b1ecfb935e8a11f50eb2b250a95fba2d Mon Sep 17 00:00:00 2001 From: frankbria Date: Thu, 8 Jan 2026 23:09:03 -0700 Subject: [PATCH] fix(ci): use full path to bats for kcov coverage kcov spawns a subprocess that doesn't inherit the npm PATH, so the 'bats' command wasn't found. Use the full path to the bats binary in node_modules/.bin/ to fix coverage measurement. --- .github/workflows/test.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f260857..59165bb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -95,17 +95,20 @@ jobs: run: | mkdir -p coverage + # Use full path to bats since kcov subprocess doesn't inherit npm PATH + BATS_CMD="$(pwd)/node_modules/.bin/bats" + # Run CLI parsing tests under kcov kcov --include-path="$(pwd)/ralph_loop.sh,$(pwd)/lib" \ --exclude-pattern=tests/,node_modules/ \ coverage/cli-parsing \ - bash -c "bats tests/unit/test_cli_parsing.bats" || true + bash -c "$BATS_CMD tests/unit/test_cli_parsing.bats" || true # Run all unit tests under kcov for comprehensive coverage kcov --include-path="$(pwd)/ralph_loop.sh,$(pwd)/lib" \ --exclude-pattern=tests/,node_modules/ \ coverage/all-unit \ - bash -c "bats tests/unit/" || true + bash -c "$BATS_CMD tests/unit/" || true - name: Parse coverage results id: coverage