Skip to content

fix(test): make setup_label assertion color-independent - #31

Merged
OneNoted merged 3 commits into
OneNoted:mainfrom
xqqmdy:fix/test-color-independent
Nov 13, 2026
Merged

OneNoted merged 3 commits into
OneNoted:mainfrom
xqqmdy:fix/test-color-independent

Conversation

@xqqmdy

@xqqmdy xqqmdy commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

setup_label() embeds ANSI styling via tier_token(), so asserting contains("[Recommended ]") on the raw string fails whenever colors are forced (CLICOLOR_FORCE=1) — e.g. running cargo test from an interactive shell that sets it, including through the pre-push hook. Strip the escape codes with console::strip_ansi_codes() before asserting.

Stack note: This is one of four single-commit PRs reviewed bottom-up:

Until the lower PRs merge, "Files changed" also shows their commits. The stacking exists because the local pre-push hook runs full CI on the working tree: on clang >= 22 machines the vulkan feature check cannot build without PR 3, and clippy 1.99 fails without PR 1, so each branch needs the ones below it to be locally verifiable. PRs 1–2 are independently green on GitHub CI (clang 18).

clippy 1.99 (useless_borrows_in_formatting) denies these under -D warnings;
local pre-push CI runs clippy with a newer toolchain than the one that last
touched src/ui.rs, so the hook fails on main without this.
setup_label embeds ANSI styling via tier_token, so asserting on the raw
string fails on terminals that force colors (CLICOLOR_FORCE=1), e.g. when
the pre-push hook runs cargo test from an interactive shell. Strip the
escape codes before asserting.
@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 991e3dd4-875a-47ae-aba6-5fe0d43728e4
Commits

Reviewing files that changed from the base of the PR and between 5f07631 and cbcc57f.

Files selected for processing: 2

  • src/asr_model.rs
  • src/ui.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@xqqmdy xqqmdy changed the title Fix/test color independent fix(test): make setup_label assertion color-independent Oct 30, 2026
@OneNoted
OneNoted merged commit ef4cb09 into OneNoted:main Nov 13, 2026
2 of 4 checks passed
@xqqmdy
xqqmdy deleted the fix/test-color-independent branch November 14, 2026 17:37
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