Skip to content

prevent test timeout waiting for interactive input#1025

Merged
Soph merged 1 commit intomainfrom
soph/prevent-tty-block
Apr 24, 2026
Merged

prevent test timeout waiting for interactive input#1025
Soph merged 1 commit intomainfrom
soph/prevent-tty-block

Conversation

@Soph
Copy link
Copy Markdown
Collaborator

@Soph Soph commented Apr 24, 2026

https://entire.io/gh/entireio/cli/trails/6bb3a182c922


Note

Low Risk
Low risk: only refactors how the form is executed (via an overridable function) and adjusts a test to stub the interactive call path.

Overview
Prevents dispatch_wizard tests from blocking on interactive huh input by routing form.Run() through an overridable runDispatchWizardForm function.

Updates TestRunDispatchWizard_ProceedsWhenCurrentBranchCannotBeResolved to stub form execution and assert the wizard reaches the form-running path (via the run dispatch wizard error wrapper) instead of hanging.

Reviewed by Cursor Bugbot for commit 0054242. Configure here.

Copilot AI review requested due to automatic review settings April 24, 2026 14:57
@Soph Soph requested a review from a team as a code owner April 24, 2026 14:57
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR prevents a CLI unit test from hanging due to interactive TUI input by introducing a small seam to stub out huh.Form.Run() during tests.

Changes:

  • Add an overridable runDispatchWizardForm function variable used to execute the wizard form.
  • Update the dispatch wizard to call runDispatchWizardForm(form) instead of form.Run().
  • Stub runDispatchWizardForm in the relevant test to avoid blocking on interactive input.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
cmd/entire/cli/dispatch_wizard.go Adds a form-runner indirection and uses it when executing the dispatch wizard form.
cmd/entire/cli/dispatch_wizard_test.go Stubs the form runner so the test can reliably proceed without waiting for TTY input.

@Soph Soph merged commit 94a58e9 into main Apr 24, 2026
14 checks passed
@Soph Soph deleted the soph/prevent-tty-block branch April 24, 2026 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants