fix(cli): remove unnecessary PTY from TestServerCreateAdminUser/Validates (#25444)

Fixes https://linear.app/codercom/issue/PLAT-224

The Validates subtest only checks that `Run()` returns a validation
error and never reads PTY output. We don't need it in this test, so
removing.

> 🤖 Generated by Coder Agents
This commit is contained in:
Cian Johnston
2026-05-19 10:35:50 +01:00
committed by GitHub
parent c0b4180206
commit 85289464b6
+3 -6
View File
@@ -4,6 +4,7 @@ import (
"context"
"database/sql"
"fmt"
"io"
"runtime"
"testing"
@@ -224,8 +225,7 @@ func TestServerCreateAdminUser(t *testing.T) {
}
connectionURL, err := dbtestutil.Open(t)
require.NoError(t, err)
ctx, cancelFunc := context.WithCancel(context.Background())
defer cancelFunc()
ctx := testutil.Context(t, testutil.WaitShort)
root, _ := clitest.New(t,
"server", "create-admin-user",
@@ -235,10 +235,7 @@ func TestServerCreateAdminUser(t *testing.T) {
"--email", "not-an-email",
"--password", "x",
)
pty := ptytest.New(t)
root.Stdout = pty.Output()
root.Stderr = pty.Output()
root.Stdout, root.Stderr = io.Discard, io.Discard
err = root.WithContext(ctx).Run()
require.Error(t, err)
require.ErrorContains(t, err, "'email' failed on the 'email' tag")