Skip to content

Make tests pass on small terminal width - #338

Open
socksy wants to merge 1 commit into
developfrom
fix/help-test-terminal-width
Open

Make tests pass on small terminal width#338
socksy wants to merge 1 commit into
developfrom
fix/help-test-terminal-width

Conversation

@socksy

@socksysocksy commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

when I ran cargo test locally it failed... because my terminal window was smaller than the help text we were asserting against, so the line breaks were misplaced. This makes that test a bit more resilient against that by flattening the text before asserting.

Summary by CodeRabbit

  • Tests
    • Improved command-line help output tests by disabling terminal-width wrapping during validation.
    • Ensured beta labels remain consistently displayed and matched in help text assertions.

@github-actions

This comment was marked as resolved.

@coderabbitai

coderabbitaiBot commented Jul 30, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Help-output tests now disable terminal line wrapping when rendering catalog and root command help, keeping beta-label assertions consistent across short, long, and subcommand help.

Changes

CLI help assertions

Layer / File(s)Summary
Disable help wrapping in beta-label assertions
crates/tower-cmd/src/catalogs.rs, crates/tower-cmd/src/lib.rs
Catalog, storage subcommand, and root help tests render with term_width(0) before checking [beta] markers.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Possibly related PRs

  • tower/tower-cli#241: Introduced the tower catalogs command help whose assertions are updated here.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title clearly summarizes the main change: updating help-output tests to pass when the terminal width is small.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/help-test-terminal-width

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

@socksy
socksyforce-pushed the fix/help-test-terminal-width branch from 1ec1e84 to ffb3b8cCompareJuly 30, 2026 15:45
@github-actions

This comment was marked as resolved.

@socksy
socksyforce-pushed the fix/help-test-terminal-width branch from ffb3b8c to b8bd3ddCompareJuly 30, 2026 15:46
@socksy
socksy changed the base branch from main to developAugust 3, 2026 09:01
@towertower deleted a comment from github-actionsBotAug 3, 2026
@towertower deleted a comment from github-actionsBotAug 3, 2026
@towertower deleted a comment from github-actionsBotAug 3, 2026
Sign up for freeto 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

@socksy@bradhe