Skip to content

ci: count integration results through bun's colour codes - #733

Merged
devswha merged 2 commits into
devswha:mainfrom
radicor:ci/count-tests-through-colour
Oct 10, 2026
Merged

devswha merged 2 commits into
devswha:mainfrom
radicor:ci/count-tests-through-colour

Conversation

@pt-act

@pt-act pt-act commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

test:integration decides whether a file reported by matching /^\s*\d+ pass$/m and /^\s*\d+ fail$/m against the stdout it captured.

Bun colours its count lines whenever the environment asks it to, and FORCE_COLOR outranks NO_COLOR, so on a runner that sets it the line arrives as:

\x1b[0m\x1b[32m 13 pass\x1b[0m

Neither pattern matches. Every file goes into unread, the summary prints NO RESULT for all of them, and the lane exits 1 — with nothing having failed. On my box all 24 files had exited 0 while the reporter said every one of them was unreadable, which reads exactly like a catastrophic failure and cost me two false alarms.

The fix strips the colour before counting and reading, rather than trying to win an environment argument against FORCE_COLOR.

Proof, on the configuration that broke it

before   FORCE_COLOR=3 → exit 1, 24 × NO RESULT
after    FORCE_COLOR=3 → exit 0, 0 × NO RESULT
                              integration: 326 pass, 0 fail, 14 skip in 26 files, 4 at a time

Same environment, same command, same 26 files.

This is not a bug I introduced and it does not affect CI today, which does not set FORCE_COLOR. It is a trap for anyone whose editor, shell profile or container image does — and the failure mode is maximally confusing rather than merely wrong. Happy to close it if you would rather carry it; I hit it twice in one afternoon and would rather someone else did not have to.

@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Review in Change Stack →Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration
  • Configuration used: Repository: devswha/herdr-web-ui/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2ef3f338-42c5-4d32-9abf-27b2c9df7eec

📥 Commits

Reviewing files that changed from the base of the PR and between 3804b99 and ce7e1df.


You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: devswha/herdr-web-ui/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5afc6016-791d-480d-8d75-98b1b25bccaf



📥 Commits

Reviewing files that changed from the base of the PR and between ddc99bc and e809c06.




📒 Files selected for processing (1)
  • scripts/ci-tests.ts



Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.





📝 Summary

Summary by CodeRabbit

  • Bug Fixes
    • Integration test results with colored terminal output are now correctly recognized, including pass, fail, and skip counts.
📝 Summary
📝 Summary

Walkthrough

Integration test count parsing and unread-result detection now use output with ANSI color codes removed. Spawn configuration, exit-code handling, and count accumulation remain unchanged.

Changes

Integration Test Output

Layer / File(s) Summary
Normalize output before parsing
scripts/ci-tests.ts
The script strips ANSI color codes before parsing pass, fail, and skip counts and checking for unread results.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: devswha





Merge Risk: ⚪ Minimal · up to e809c

The change addresses the reported colored-output parsing failure. No actionable merge risk remains beyond normal checks.

Architecture Summary

Architecture risk: 🔵 Low · up to e809c

The change affects 1 system.

Changed systems: scripts

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — scripts (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in scripts/ci-tests.ts: Integration test count parsing and unread-result detection now use ANSI-stripped output instead of raw output. The spawn configuration, exit-code handling, and accumulation of parsed counts are unchanged.



Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title clearly identifies the CI change: parsing integration results despite Bun color codes.
Description check Passed The description explains the failure, the resulting behavior, the fix, and validation results. It does not use the template headings, but it provides the required Change and Validation information.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.





✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR





  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

The reporter matched /^\s*\d+ pass$/m against bun's captured stdout. Bun
colours its counts whenever the environment asks for colour - FORCE_COLOR
outranks NO_COLOR - and the line then reads ESC[0m ESC[32m 13 pass ESC[0m,
which no longer matches. Every file landed in unread and the lane exited 1
with nothing having failed: all 24 had exited 0.

Stripping the colour before counting is not the same as trusting the
environment to withhold it, which is what NO_COLOR alone already failed to do.
@pt-act
pt-act force-pushed the ci/count-tests-through-colour branch from e809c06 to 3804b99 Compare October 10, 2026 08:01
@devswha
devswha merged commit 7c01696 into devswha:main Oct 10, 2026
5 checks passed
devswha added a commit that referenced this pull request Oct 10, 2026
## Change

Release 0.4.6, from main at 2ae281d (24 PRs since v0.4.5: #615,
#693-#748).

- `package.json` and `herdr-plugin.toml`: 0.4.6.
- CHANGELOG: `[Unreleased]` becomes `[0.4.6] - 2026-10-11`. #615's entry
moves out of the 0.4.2 section, where its branch's merge left it. #697
and #695 get their links and credits. A Maintenance section covers #738,
#733 and #696. The compare links are fixed.
- `release-summaries.json`: 0.4.6 in en/ko/ja/zh (5 new, 3 improved, 5
fixed).
- `REMOTE_BUNDLE_VERSION` 24 -> 25. Bridge routes were added since
v0.4.5 (plugin actions, integrations, pane
split/zoom/swap/resize/clear/move/focus, tab move, find, layout ratio,
agent rename), so `remote-v25` is published before the app release.

## Validation

- `bun scripts/release-notes.ts 0.4.6` renders the summaries and the
full changelog.
- `bun run typecheck` and `bun run test:unit` pass: 2459 tests, 0 fail.

---------

Co-authored-by: devswha <[email protected]>
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.

2 participants