test: refactor CLI create tests not to use PTY - #25807
Merged
Merged
Conversation
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
spikecurtis
commented
May 28, 2026
| @@ -1591,9 +1593,6 @@ func TestCreateWithPreset(t *testing.T) { | |||
| workspaceName := "my-workspace" | |||
| inv, root := clitest.New(t, "create", workspaceName, "--template", template.Name, "-y", "--preset", "invalid-preset") | |||
| clitest.SetupConfig(t, member, root) | |||
| pty := ptytest.New(t).Attach(inv) | |||
| inv.Stdout = pty.Output() | |||
| inv.Stderr = pty.Output() | |||
Contributor
Author
There was a problem hiding this comment.
some cases, like this one attach a PTY and then neither read nor write to it.
spikecurtis
force-pushed
the
spike/internal-1400-refactor-create
branch
from
May 28, 2026 19:36
ab23d58 to
d3cf837
Compare
spikecurtis
force-pushed
the
spike/internal-1400-expecter
branch
from
May 28, 2026 19:37
8bb24bb to
9729348
Compare
spikecurtis
marked this pull request as ready for review
May 28, 2026 19:44
sreya
approved these changes
May 28, 2026
| @@ -129,7 +129,8 @@ func TestCreateDynamic(t *testing.T) { | |||
| // When enable_region=true, the region parameter becomes required and CLI should prompt. | |||
| t.Run("PromptForConditionalParam", func(t *testing.T) { | |||
| t.Parallel() | |||
| ctx := testutil.Context(t, testutil.WaitLong) | |||
| ctx := testutil.Context(t, time.Hour) | |||
Contributor
Author
Merge activity
|
spikecurtis
changed the base branch from
spike/internal-1400-expecter
to
graphite-base/25807
May 28, 2026 21:38
spikecurtis
force-pushed
the
spike/internal-1400-refactor-create
branch
from
May 28, 2026 21:38
d3cf837 to
23bbd22
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Refactors CLI tests of the
createcommand as the first batch of tests refactored to take a PTY out of the loop.One interesting difference I noticed between PTY and a direct pipe to standard in is that on the PTY we write
\rto enter some input, but the kernel actually sends\n(or maybe\r\n) to the process, at least on Unix. (On windows we sent\r\ninto the PTY). This is reflected in the implementation of theWriter, otherwise mostly inspired by the PTYTest equivalents.