You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[CHORE] Declare bats_require_minimum_version in every BATS file to silence the BW02 warnings #1697
area:testingTest infrastructure, BATS, pytestchoreGeneral tasks (e.g. update dependencies, contact a manufacturer, read a paper)effort:smallLess than 1 hourpriority:lowNice to have, do when capacity allowssemver:patchBug fix, backward-compatible
No file under tests/bats/ declares bats_require_minimum_version, so
every run of the suite prints a BW02 warning per use of a flag on run
(run --separate-stderr, run -0, …): bats 1.5+ gates those flags behind
the declaration and warns when it is missing. The suite is on bats 1.12.0
from the flake, so the declaration is safe everywhere the suite runs.
Cosmetic, but it is noise on every local and CI log, and with bats -j
(#1687) the warnings interleave with TAP output, which makes a real not ok harder to spot.
Acceptance Criteria
Every tests/bats/*.bats file that uses a run flag declares bats_require_minimum_version 1.5.0 at the top (after the shebang,
before setup); files that never pass a flag may declare it too for
uniformity — pick one rule and apply it to all 21 files
Three corrections, from implementing this (PR branch bugfix/1694-worktree-bats-isolation):
"No file under tests/bats/ declares bats_require_minimum_version" is wrong. githooks.bats:10 already declares it. 20 of the 21 files needed the line, not 21.
The suite emits exactly one BW02, not "one per use of a flag on run". There is a
single flagged run in the whole suite: init-workspace.bats:1801
(run --separate-stderr). Measured before the fix: grep -c BW02 = 1.
It does not interleave with TAP output. bats collects warnings and prints them in a
trailing "The following warnings were encountered during tests:" block after the plan, so
it never sits between ok/not ok lines — including under bats -j.
None of that changes the verdict: the acceptance criteria are met as written and the value is
drift-proofing, since the next run -0 or run --separate-stderr added to any of the 21
files would reintroduce the warning. That is now pinned by a parametrized pytest
(tests/test_bats_shape.py) rather than left to review, so the rule survives new files too. grep -c BW02 over bats -j 8 tests/bats/ is 0 and the suite is 602/602.
area:testingTest infrastructure, BATS, pytestchoreGeneral tasks (e.g. update dependencies, contact a manufacturer, read a paper)effort:smallLess than 1 hourpriority:lowNice to have, do when capacity allowssemver:patchBug fix, backward-compatible
Activity
test(bats): require the minimum bats version in every file
chore(test): declare bats_require_minimum_version in every BATS file
test(bats): name the file and the required line in the shape assertions
c-vigo commentedon Sep 25, 2026
Three corrections, from implementing this (PR branch
bugfix/1694-worktree-bats-isolation):tests/bats/declaresbats_require_minimum_version" is wrong.githooks.bats:10already declares it. 20 of the 21 files needed the line, not 21.BW02, not "one per use of a flag onrun". There is asingle flagged
runin the whole suite:init-workspace.bats:1801(
run --separate-stderr). Measured before the fix:grep -c BW02= 1.trailing "The following warnings were encountered during tests:" block after the plan, so
it never sits between
ok/not oklines — including underbats -j.None of that changes the verdict: the acceptance criteria are met as written and the value is
drift-proofing, since the next
run -0orrun --separate-stderradded to any of the 21files would reintroduce the warning. That is now pinned by a parametrized pytest
(
tests/test_bats_shape.py) rather than left to review, so the rule survives new files too.grep -c BW02overbats -j 8 tests/bats/is 0 and the suite is 602/602.test(bats): isolate worktree.bats and tighten the BATS suite (#1709)
c-vigo commentedon Sep 25, 2026
Shipped to
devin #1709: bats_require_minimum_version 1.5.0 in all 21 files, pinned by tests/test_bats_shape.py; BW02 count 0 in CI.test(bats): refuse teardown_file assertions in the BATS suite (#1720)