Skip to content

Fix bats TAP count mismatch on Ubuntu CI#2389

Merged
seefood merged 2 commits into
Bash-it:masterfrom
seefood:fix/bats-parallel-count-mismatch
Jun 2, 2026
Merged

Fix bats TAP count mismatch on Ubuntu CI#2389
seefood merged 2 commits into
Bash-it:masterfrom
seefood:fix/bats-parallel-count-mismatch

Conversation

@seefood

@seefood seefood commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Problem

Ubuntu 24.04 GitHub Actions runners ship GNU parallel, so test/run detects it and invokes bats with --jobs N --tap. This combination produces a TAP plan count mismatch — e.g. Executed 256 instead of expected 289 tests — causing exit code 1 even when every individual test passes. Seen in the CI run for #2387.

This is the Linux-side counterpart of the issue fixed for macOS in #2379.

Fix

Set TEST_JOBS: 1 for Linux runners so bats falls back to single-threaded mode, sidestepping the --tap + --jobs count-mismatch bug. macOS keeps parallel execution as set up in #2379.

env:
  TEST_JOBS: ${{ runner.os == 'Linux' && '1' || 'detect' }}

Test plan

seefood and others added 2 commits June 2, 2026 12:15
Ubuntu 24.04 runners ship GNU parallel, so test/run detects it and runs
bats with --jobs N --tap. This combination produces a TAP plan count
mismatch (e.g. 256 executed vs 289 expected), causing exit code 1 even
when all tests pass. Force TEST_JOBS=1 on Linux to use single-threaded
bats; macOS keeps parallel (installed explicitly in the prior step).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
bats-core rejects --no-parallelize-within-files when --jobs 1 is passed
("requires at least --jobs 2"). Guard the parallel branch so TEST_JOBS=1
falls through to the plain single-threaded exec, which uses neither flag.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@seefood seefood merged commit 2e652f1 into Bash-it:master Jun 2, 2026
8 checks passed
@seefood seefood deleted the fix/bats-parallel-count-mismatch branch June 2, 2026 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant