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:
parent
f286710ee4
commit
0c0b0b63b1
1 changed files with 5 additions and 2 deletions
7
.github/workflows/test.yml
vendored
7
.github/workflows/test.yml
vendored
|
|
@ -95,17 +95,20 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
mkdir -p coverage
|
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
|
# Run CLI parsing tests under kcov
|
||||||
kcov --include-path="$(pwd)/ralph_loop.sh,$(pwd)/lib" \
|
kcov --include-path="$(pwd)/ralph_loop.sh,$(pwd)/lib" \
|
||||||
--exclude-pattern=tests/,node_modules/ \
|
--exclude-pattern=tests/,node_modules/ \
|
||||||
coverage/cli-parsing \
|
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
|
# Run all unit tests under kcov for comprehensive coverage
|
||||||
kcov --include-path="$(pwd)/ralph_loop.sh,$(pwd)/lib" \
|
kcov --include-path="$(pwd)/ralph_loop.sh,$(pwd)/lib" \
|
||||||
--exclude-pattern=tests/,node_modules/ \
|
--exclude-pattern=tests/,node_modules/ \
|
||||||
coverage/all-unit \
|
coverage/all-unit \
|
||||||
bash -c "bats tests/unit/" || true
|
bash -c "$BATS_CMD tests/unit/" || true
|
||||||
|
|
||||||
- name: Parse coverage results
|
- name: Parse coverage results
|
||||||
id: coverage
|
id: coverage
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue