Skip to content

tests: pin render width suite-wide so --help asserts match CI#147

Merged
alexkroman merged 2 commits into
mainfrom
claude/session-dx-improvements-ojcbcs
Jun 13, 2026
Merged

tests: pin render width suite-wide so --help asserts match CI#147
alexkroman merged 2 commits into
mainfrom
claude/session-dx-improvements-ojcbcs

Conversation

@alexkroman

Copy link
Copy Markdown
Collaborator

The fixed_render_size fixture (COLUMNS=80/LINES=40) was opt-in, used only by
the snapshot modules. The ~20 other test files that assert against --help or
rendered CLI output ran at whatever width the environment supplied. Rich's
no-clip help table ellipsizes a long flag name ("--end-of-turn-c…") once its
column overflows, so a substring assert like "--with-api-key" in help passes
at a contributor's wide local terminal and fails at CI's narrower width.

That gap cost one PR three CI rounds on a single test
(test_api_key_flag_is_hidden_from_help). Making the fixture autouse pins the
render width for every test, so a local green is a CI green for output tests.
Tests that need a different width still override it per call
(runner.invoke(app, argv, env={"COLUMNS": "300"})).

Document the lesson in tests/AGENTS.md.

claude and others added 2 commits June 13, 2026 04:48
The fixed_render_size fixture (COLUMNS=80/LINES=40) was opt-in, used only by
the snapshot modules. The ~20 other test files that assert against --help or
rendered CLI output ran at whatever width the environment supplied. Rich's
no-clip help table ellipsizes a long flag name ("--end-of-turn-c…") once its
column overflows, so a substring assert like `"--with-api-key" in help` passes
at a contributor's wide local terminal and fails at CI's narrower width.

That gap cost one PR three CI rounds on a single test
(test_api_key_flag_is_hidden_from_help). Making the fixture autouse pins the
render width for every test, so a local green is a CI green for output tests.
Tests that need a different width still override it per call
(runner.invoke(app, argv, env={"COLUMNS": "300"})).

Document the lesson in tests/AGENTS.md.
@alexkroman alexkroman enabled auto-merge June 13, 2026 04:55
@alexkroman alexkroman added this pull request to the merge queue Jun 13, 2026
Merged via the queue into main with commit 52962ae Jun 13, 2026
16 checks passed
@alexkroman alexkroman deleted the claude/session-dx-improvements-ojcbcs branch June 13, 2026 05:03
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