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.
This commit is contained in:
frankbria 2026-01-08 23:09:03 -07:00
parent f286710ee4
commit 0c0b0b63b1

View file

@ -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