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

@socksy socksy 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

coderabbitai Bot 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 name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The 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
socksy force-pushed the fix/help-test-terminal-width branch from 1ec1e84 to ffb3b8c Compare July 30, 2026 15:45
@github-actions

This comment was marked as resolved.

@socksy
socksy force-pushed the fix/help-test-terminal-width branch from ffb3b8c to b8bd3dd Compare July 30, 2026 15:46
@socksy
socksy changed the base branch from main to develop August 3, 2026 09:01
@tower tower deleted a comment from github-actions Bot Aug 3, 2026
@tower tower deleted a comment from github-actions Bot Aug 3, 2026
@tower tower deleted a comment from github-actions Bot Aug 3, 2026
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.

1 participant