Skip to content

Commit 5613d3b

Browse files
committed
185 problems left...
1 parent 5af1142 commit 5613d3b

File tree

7 files changed

+42
-42
lines changed

7 files changed

+42
-42
lines changed

cli/cliui/agent_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func TestAgent(t *testing.T) {
4545
return err
4646
},
4747
}
48-
cmd.SetOutput(ptty.Output())
48+
cmd.Stdout = ptty.Output()
4949
cmd.Stdin = ptty.Input()
5050
done := make(chan struct{})
5151
go func() {
@@ -92,7 +92,7 @@ func TestAgent_TimeoutWithTroubleshootingURL(t *testing.T) {
9292
},
9393
}
9494
ptty := ptytest.New(t)
95-
cmd.SetOutput(ptty.Output())
95+
cmd.Stdout = ptty.Output()
9696
cmd.Stdin = ptty.Input()
9797
done := make(chan error, 1)
9898
go func() {
@@ -145,7 +145,7 @@ func TestAgent_StartupTimeout(t *testing.T) {
145145
}
146146

147147
ptty := ptytest.New(t)
148-
cmd.SetOutput(ptty.Output())
148+
cmd.Stdout = ptty.Output()
149149
cmd.Stdin = ptty.Input()
150150
done := make(chan error, 1)
151151
go func() {
@@ -203,7 +203,7 @@ func TestAgent_StartErrorExit(t *testing.T) {
203203
}
204204

205205
ptty := ptytest.New(t)
206-
cmd.SetOutput(ptty.Output())
206+
cmd.Stdout = ptty.Output()
207207
cmd.Stdin = ptty.Input()
208208
done := make(chan error, 1)
209209
go func() {
@@ -258,7 +258,7 @@ func TestAgent_NoWait(t *testing.T) {
258258
}
259259

260260
ptty := ptytest.New(t)
261-
cmd.SetOutput(ptty.Output())
261+
cmd.Stdout = ptty.Output()
262262
cmd.Stdin = ptty.Input()
263263
done := make(chan error, 1)
264264
go func() {
@@ -327,7 +327,7 @@ func TestAgent_LoginBeforeReadyEnabled(t *testing.T) {
327327
}
328328

329329
ptty := ptytest.New(t)
330-
cmd.SetOutput(ptty.Output())
330+
cmd.Stdout = ptty.Output()
331331
cmd.Stdin = ptty.Input()
332332
done := make(chan error, 1)
333333
go func() {

cli/cliui/gitauth_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func TestGitAuth(t *testing.T) {
4040
})
4141
},
4242
}
43-
cmd.SetOutput(ptty.Output())
43+
cmd.Stdout = ptty.Output()
4444
cmd.Stdin = ptty.Input()
4545
done := make(chan struct{})
4646
go func() {

cli/cliui/provisionerjob_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ func newProvisionerJob(t *testing.T) provisionerJobTest {
146146
},
147147
}
148148
ptty := ptytest.New(t)
149-
cmd.SetOutput(ptty.Output())
149+
cmd.Stdout = ptty.Output()
150150
cmd.Stdin = ptty.Input()
151151
done := make(chan struct{})
152152
go func() {

cli/cliui/select_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func newSelect(ptty *ptytest.PTY, opts cliui.SelectOptions) (string, error) {
3939
return err
4040
},
4141
}
42-
cmd.SetOutput(ptty.Output())
42+
cmd.Stdout = ptty.Output()
4343
cmd.Stdin = ptty.Input()
4444
return value, cmd.RunContext(context.Background())
4545
}
@@ -82,7 +82,7 @@ func newRichSelect(ptty *ptytest.PTY, opts cliui.RichSelectOptions) (string, err
8282
return err
8383
},
8484
}
85-
cmd.SetOutput(ptty.Output())
85+
cmd.Stdout = ptty.Output()
8686
cmd.Stdin = ptty.Input()
8787
return value, cmd.RunContext(context.Background())
8888
}

cli/gitaskpass_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ func TestGitAskpass(t *testing.T) {
3232
url := srv.URL
3333
cmd, _ := clitest.New(t, "--agent-url", url, "Username for 'https://github.com':")
3434
pty := ptytest.New(t)
35-
cmd.SetOutput(pty.Output())
35+
cmd.Stdout = pty.Output()
3636
err := cmd.Run()
3737
require.NoError(t, err)
3838
pty.ExpectMatch("something")
3939

4040
cmd, _ = clitest.New(t, "--agent-url", url, "Password for 'https://potato@github.com':")
4141
pty = ptytest.New(t)
42-
cmd.SetOutput(pty.Output())
42+
cmd.Stdout = pty.Output()
4343
err = cmd.Run()
4444
require.NoError(t, err)
4545
pty.ExpectMatch("bananas")
@@ -55,7 +55,7 @@ func TestGitAskpass(t *testing.T) {
5555
url := srv.URL
5656
cmd, _ := clitest.New(t, "--agent-url", url, "--no-open", "Username for 'https://github.com':")
5757
pty := ptytest.New(t)
58-
cmd.SetOutput(pty.Output())
58+
cmd.Stdout = pty.Output()
5959
err := cmd.Run()
6060
require.ErrorIs(t, err, cliui.Canceled)
6161
pty.ExpectMatch("Nope!")
@@ -83,7 +83,7 @@ func TestGitAskpass(t *testing.T) {
8383

8484
cmd, _ := clitest.New(t, "--agent-url", url, "--no-open", "Username for 'https://github.com':")
8585
pty := ptytest.New(t)
86-
cmd.SetOutput(pty.Output())
86+
cmd.Stdout = pty.Output()
8787
go func() {
8888
err := cmd.Run()
8989
assert.NoError(t, err)

cli/server_createadminuser_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ func TestServerCreateAdminUser(t *testing.T) {
129129
"--password", password,
130130
)
131131
pty := ptytest.New(t)
132-
root.SetOutput(pty.Output())
133-
root.SetErr(pty.Output())
132+
root.Stdout = pty.Output()
133+
root.Stderr = pty.Output()
134134
errC := make(chan error, 1)
135135
go func() {
136136
err := root.WithContext(ctx).Run()
@@ -175,8 +175,8 @@ func TestServerCreateAdminUser(t *testing.T) {
175175

176176
root, _ := clitest.New(t, "server", "create-admin-user")
177177
pty := ptytest.New(t)
178-
root.SetOutput(pty.Output())
179-
root.SetErr(pty.Output())
178+
root.Stdout = pty.Output()
179+
root.Stderr = pty.Output()
180180
errC := make(chan error, 1)
181181
go func() {
182182
err := root.WithContext(ctx).Run()
@@ -217,8 +217,8 @@ func TestServerCreateAdminUser(t *testing.T) {
217217
)
218218
pty := ptytest.New(t)
219219
root.Stdin = pty.Input()
220-
root.SetOutput(pty.Output())
221-
root.SetErr(pty.Output())
220+
root.Stdout = pty.Output()
221+
root.Stderr = pty.Output()
222222
errC := make(chan error, 1)
223223
go func() {
224224
err := root.WithContext(ctx).Run()
@@ -267,8 +267,8 @@ func TestServerCreateAdminUser(t *testing.T) {
267267
"--password", "x",
268268
)
269269
pty := ptytest.New(t)
270-
root.SetOutput(pty.Output())
271-
root.SetErr(pty.Output())
270+
root.Stdout = pty.Output()
271+
root.Stderr = pty.Output()
272272

273273
err = root.WithContext(ctx).Run()
274274
require.Error(t, err)

cli/server_test.go

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ func TestServer(t *testing.T) {
119119
"--cache-dir", t.TempDir(),
120120
)
121121
pty := ptytest.New(t)
122-
root.SetOutput(pty.Output())
123-
root.SetErr(pty.Output())
122+
root.Stdout = pty.Output()
123+
root.Stderr = pty.Output()
124124
errC := make(chan error, 1)
125125
go func() {
126126
errC <- root.WithContext(ctx).Run()
@@ -148,8 +148,8 @@ func TestServer(t *testing.T) {
148148
"--cache-dir", t.TempDir(),
149149
)
150150
pty := ptytest.New(t)
151-
root.SetOutput(pty.Output())
152-
root.SetErr(pty.Output())
151+
root.Stdout = pty.Output()
152+
root.Stderr = pty.Output()
153153
errC := make(chan error, 1)
154154
go func() {
155155
errC <- root.WithContext(ctx).Run()
@@ -166,7 +166,7 @@ func TestServer(t *testing.T) {
166166
t.Parallel()
167167
root, _ := clitest.New(t, "server", "postgres-builtin-url")
168168
pty := ptytest.New(t)
169-
root.SetOutput(pty.Output())
169+
root.Stdout = pty.Output()
170170
err := root.Run()
171171
require.NoError(t, err)
172172

@@ -178,7 +178,7 @@ func TestServer(t *testing.T) {
178178

179179
root, _ := clitest.New(t, "server", "postgres-builtin-url", "--raw-url")
180180
pty := ptytest.New(t)
181-
root.SetOutput(pty.Output())
181+
root.Stdout = pty.Output()
182182
err := root.WithContext(ctx).Run()
183183
require.NoError(t, err)
184184

@@ -524,8 +524,8 @@ func TestServer(t *testing.T) {
524524
"--cache-dir", t.TempDir(),
525525
)
526526
pty := ptytest.New(t)
527-
root.SetOutput(pty.Output())
528-
root.SetErr(pty.Output())
527+
root.Stdout = pty.Output()
528+
root.Stderr = pty.Output()
529529

530530
errC := make(chan error, 1)
531531
go func() {
@@ -672,8 +672,8 @@ func TestServer(t *testing.T) {
672672

673673
root, _ := clitest.New(t, flags...)
674674
pty := ptytest.New(t)
675-
root.SetOutput(pty.Output())
676-
root.SetErr(pty.Output())
675+
root.Stdout = pty.Output()
676+
root.Stderr = pty.Output()
677677

678678
errC := make(chan error, 1)
679679
go func() {
@@ -762,8 +762,8 @@ func TestServer(t *testing.T) {
762762
)
763763

764764
pty := ptytest.New(t)
765-
root.SetOutput(pty.Output())
766-
root.SetErr(pty.Output())
765+
root.Stdout = pty.Output()
766+
root.Stderr = pty.Output()
767767
serverStop := make(chan error, 1)
768768
go func() {
769769
err := root.WithContext(ctx).Run()
@@ -792,8 +792,8 @@ func TestServer(t *testing.T) {
792792
)
793793

794794
pty := ptytest.New(t)
795-
root.SetOutput(pty.Output())
796-
root.SetErr(pty.Output())
795+
root.Stdout = pty.Output()
796+
root.Stderr = pty.Output()
797797
serverClose := make(chan struct{}, 1)
798798
go func() {
799799
err := root.WithContext(ctx).Run()
@@ -862,8 +862,8 @@ func TestServer(t *testing.T) {
862862
"--cache-dir", t.TempDir(),
863863
)
864864
pty := ptytest.New(t)
865-
root.SetOutput(pty.Output())
866-
root.SetErr(pty.Output())
865+
root.Stdout = pty.Output()
866+
root.Stderr = pty.Output()
867867
clitest.Start(ctx, t, root)
868868

869869
pty.ExpectMatch("is deprecated")
@@ -892,8 +892,8 @@ func TestServer(t *testing.T) {
892892
"--cache-dir", t.TempDir(),
893893
)
894894
pty := ptytest.New(t)
895-
root.SetOutput(pty.Output())
896-
root.SetErr(pty.Output())
895+
root.Stdout = pty.Output()
896+
root.Stderr = pty.Output()
897897
clitest.Start(ctx, t, root)
898898

899899
pty.ExpectMatch("is deprecated")
@@ -1288,7 +1288,7 @@ func TestServer(t *testing.T) {
12881288
// fails.
12891289
pty := ptytest.New(t)
12901290
root.Stdout = pty.Output()
1291-
root.SetErr(pty.Output())
1291+
root.Stderr = pty.Output()
12921292

12931293
serverErr := make(chan error, 1)
12941294
go func() {
@@ -1333,7 +1333,7 @@ func TestServer(t *testing.T) {
13331333
// fails.
13341334
pty := ptytest.New(t)
13351335
root.Stdout = pty.Output()
1336-
root.SetErr(pty.Output())
1336+
root.Stderr = pty.Output()
13371337

13381338
clitest.Start(ctx, t, root)
13391339

0 commit comments

Comments
 (0)