Skip to content

Commit 2e652f1

Browse files
authored
Merge pull request #2389 from seefood/fix/bats-parallel-count-mismatch
Fix bats TAP count mismatch on Ubuntu CI
2 parents 4d3f4f0 + 53bb94b commit 2e652f1

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ jobs:
2727
which parallel # Verify installation
2828
- name: Test code
2929
run: test/run
30+
env:
31+
# Ubuntu runners ship GNU parallel, causing --tap + --jobs count mismatches.
32+
# Force single-threaded on Linux; let macOS use parallel (installed above).
33+
TEST_JOBS: ${{ runner.os == 'Linux' && '1' || 'detect' }}
3034

3135
build-docs:
3236
runs-on: ubuntu-latest

test/run

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ fi
2525
# AND that it is the GNU version of `parallel`.
2626
# If that is the case, try to guess the number of CPU cores,
2727
# so we can run `bats` in parallel processing mode, which is a lot faster.
28-
if command -v parallel &> /dev/null \
28+
if [[ "${TEST_JOBS:-detect}" != "1" ]] \
29+
&& command -v parallel &> /dev/null \
2930
&& parallel -V &> /dev/null \
3031
&& { parallel -V 2> /dev/null | grep -q '^GNU\>'; }; then
3132
# Expect to run at least on a dual-core CPU; slightly degraded performance

0 commit comments

Comments
 (0)