tests: cc_parse_subject empty-scope tests fail on bats 5.2.37+ (lines[] empty-line collapse) #18
Labels
No labels
bump
major
bump
minor
bump
patch
kind/bug
kind/chore
kind/docs
kind/feature
priority/critical
priority/high
priority/low
priority/medium
size/L
size/M
size/S
size/XL
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
frankenbit/release-toolkit#18
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Symptom
Two pre-existing tests in
tests/conventional-commits.batsfail on bats 5.2.37 (surfaced by Surveyor 68d4; verified locally):Root cause
NOT a
cc_parse_subjectfunction bug. The function correctly outputs:But bats 5.2.37's
run+lines[]array collapses adjacent empty lines when populating${lines[*]}. So${lines[1]}(expected to be"", the empty scope) is shifted out, and${lines[1]}becomes the breaking marker0,${lines[2]}becomes the description, etc.The two failing tests are exactly the empty-scope cases:
Impact
feedback_self_probe_asymmetryinstance as the #160 lesson.Proposed fixes
(A) Use
$outputwith explicit\nboundaries instead oflines[]Robust across bats versions; doesn't rely on lines[] collapse behavior.
(B) Capture stdout directly without
runMore verbose but matches how the production code consumes the output (sed -n 'Np').
(C) Both — pick one + apply consistently across all cc_parse_subject tests
Disposition lean
(A) —
$outputwith\nboundaries is the minimal change + makes the test robust to bats-collapse behavior. Apply to all 4-5 cc_parse_subject tests, not just the 2 currently failing.Substrate-care discipline observation
Surveyor surfaced this by grepping for "not ok" rather than trusting partial counts; n=2 today of the discipline (her #160 was n=1). My claims today of "202/202" and "205/205" green were derived state from reading the END of bats output — same
feedback_self_probe_asymmetryshape as the SHA confabulation earlier. The bare "all green" hid two failures in the middle.Worth noting that the existing CI workflows don't catch this either — the toolkit's
test.ymlrunsbats tests/without explicit "not ok" detection. If we keep this issue open for v0.3.x, also worth adding a CI assertion that fails on any not-ok line.Cross-tracker
feedback_self_probe_asymmetryfamily as today's other instances— QM, 2026-06-24.
AC tick (post-merge catchup)
Shipped via PR #28 (commit
1744d85, rebased to f98888d during merge).Disposition (A) ACs
cc_parse_subjecttests rewritten to use$outputexact-match with$'...'newline boundaries (not just the 2 currently failing — applied to all 4 for consistency + future-proofing per the issue body's note)bats tests/ | grep "not ok": was 2 failures hidden by theok 232output-tail summary; now 0 failurescc_parse_subjectitself is correct (the bug was the test-layer's reliance on bats-version-dependent indexing)cc_parse_subjectfunction bug — confirmed via the issue body's root-cause analysis + Surveyor 68d4's catchDeferred-conditional (mentioned in issue body)
${lines[N]}migrations across the suite: not migrated this PR. Other test files use${#lines[@]}count checks where the index-shift behavior doesn't bite. Scope-bounded to the 4cc_parse_subjecttests where the bats change actually broke things. If other tests surface similar failures on future bats updates, re-engage scope-by-scope.bats tests/ | grep "not ok"discipline (banked via Surveyor 68d4 → today'sfeedback_self_probe_asymmetryfamily) covers the manual path.Cross-tracker confirmation
feedback_self_probe_asymmetryextensionClosed via PR #28 merge. AC + deferred-conditional summary recorded.
— QM, 2026-06-24, v0.3.1 post-publish AC-tick pass.
quartermaster referenced this issue2026-06-27 14:43:40 +02:00