Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc8c9e51

Browse files
committed
511 problems left...
* Some server.go fixes
1 parenta58d15e commitc8c9e51

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

‎cli/server.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ flags, and YAML configuration. The precedence is as follows:
351351
shouldCoderTrace:=cfg.Telemetry.Enable.Value()&&!isTest()
352352
// Only override if telemetryTraceEnable was specifically set.
353353
// By default we want it to be controlled by telemetryEnable.
354-
ifinv.ParsedFlags().Changed("telemetry-trace") {
354+
ifinv.ParsedFlags().Changed("telemetry-trace") {
355355
shouldCoderTrace=cfg.Telemetry.Trace.Value()
356356
}
357357

@@ -457,7 +457,7 @@ flags, and YAML configuration. The precedence is as follows:
457457

458458
// DEPRECATED: This redirect used to default to true.
459459
// It made more sense to have the redirect be opt-in.
460-
ifos.Getenv("CODER_TLS_REDIRECT_HTTP")=="true"||inv.ParsedFlags().Changed("tls-redirect-http-to-https") {
460+
ifos.Getenv("CODER_TLS_REDIRECT_HTTP")=="true"||inv.ParsedFlags().Changed("tls-redirect-http-to-https") {
461461
cmd.PrintErr(cliui.Styles.Warn.Render("WARN:")+" --tls-redirect-http-to-https is deprecated, please use --redirect-to-access-url instead\n")
462462
cfg.RedirectToAccessURL=cfg.TLS.RedirectHTTP
463463
}
@@ -1119,7 +1119,7 @@ flags, and YAML configuration. The precedence is as follows:
11191119
gofunc() {
11201120
deferwg.Done()
11211121

1122-
ifok,_:=inv.ParsedFlags().GetBool(varVerbose);ok {
1122+
ifok,_:=inv.ParsedFlags().GetBool(varVerbose);ok {
11231123
cmd.Printf("Shutting down provisioner daemon %d...\n",id)
11241124
}
11251125
err:=shutdownWithTimeout(provisionerDaemon.Shutdown,5*time.Second)
@@ -1132,7 +1132,7 @@ flags, and YAML configuration. The precedence is as follows:
11321132
cmd.PrintErrf("Close provisioner daemon %d: %s\n",id,err)
11331133
return
11341134
}
1135-
ifok,_:=inv.ParsedFlags().GetBool(varVerbose);ok {
1135+
ifok,_:=inv.ParsedFlags().GetBool(varVerbose);ok {
11361136
cmd.Printf("Gracefully shut down provisioner daemon %d\n",id)
11371137
}
11381138
}()
@@ -1190,7 +1190,7 @@ flags, and YAML configuration. The precedence is as follows:
11901190

11911191
cfg:=createConfig(cmd)
11921192
logger:=slog.Make(sloghuman.Sink(inv.Stderr))
1193-
ifok,_:=inv.ParsedFlags().GetBool(varVerbose);ok {
1193+
ifok,_:=inv.ParsedFlags().GetBool(varVerbose);ok {
11941194
logger=logger.Leveled(slog.LevelDebug)
11951195
}
11961196

‎cli/server_test.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ func TestServer(t *testing.T) {
406406
"--tls-key-file",keyPath,
407407
"--cache-dir",t.TempDir(),
408408
)
409-
clitest.Start(ctx,t,root)
409+
clitest.Start(t,root.WithContext(ctx))
410410

411411
// Verify HTTPS
412412
accessURL:=waitAccessURL(t,cfg)
@@ -446,7 +446,7 @@ func TestServer(t *testing.T) {
446446
)
447447
pty:=ptytest.New(t)
448448
root.Stdout=pty.Output()
449-
clitest.Start(ctx,t,root)
449+
clitest.Start(t,root.WithContext(ctx))
450450

451451
accessURL:=waitAccessURL(t,cfg)
452452
require.Equal(t,"https",accessURL.Scheme)
@@ -864,7 +864,7 @@ func TestServer(t *testing.T) {
864864
pty:=ptytest.New(t)
865865
root.Stdout=pty.Output()
866866
root.Stderr=pty.Output()
867-
clitest.Start(ctx,t,root)
867+
clitest.Start(t,root.WithContext(ctx))
868868

869869
pty.ExpectMatch("is deprecated")
870870

@@ -894,7 +894,7 @@ func TestServer(t *testing.T) {
894894
pty:=ptytest.New(t)
895895
root.Stdout=pty.Output()
896896
root.Stderr=pty.Output()
897-
clitest.Start(ctx,t,root)
897+
clitest.Start(t,root.WithContext(ctx))
898898

899899
pty.ExpectMatch("is deprecated")
900900

@@ -1230,7 +1230,7 @@ func TestServer(t *testing.T) {
12301230
"--access-url","http://example.com",
12311231
"--log-human",fiName,
12321232
)
1233-
clitest.Start(context.Background(),t,root)
1233+
clitest.Start(t,root)
12341234

12351235
waitFile(t,fiName,testutil.WaitShort)
12361236
})
@@ -1247,7 +1247,7 @@ func TestServer(t *testing.T) {
12471247
"--access-url","http://example.com",
12481248
"--log-human",fi,
12491249
)
1250-
clitest.Start(context.Background(),t,root)
1250+
clitest.Start(t,root)
12511251

12521252
waitFile(t,fi,testutil.WaitShort)
12531253
})
@@ -1264,7 +1264,7 @@ func TestServer(t *testing.T) {
12641264
"--access-url","http://example.com",
12651265
"--log-json",fi,
12661266
)
1267-
clitest.Start(context.Background(),t,root)
1267+
clitest.Start(t,root)
12681268

12691269
waitFile(t,fi,testutil.WaitShort)
12701270
})
@@ -1319,7 +1319,7 @@ func TestServer(t *testing.T) {
13191319
// which can take a long time and end up failing the test.
13201320
// This is why we wait extra long below for server to listen on
13211321
// HTTP.
1322-
root,_:=clitest.New(t,
1322+
inv,_:=clitest.New(t,
13231323
"server",
13241324
"--verbose",
13251325
"--in-memory",
@@ -1332,10 +1332,10 @@ func TestServer(t *testing.T) {
13321332
// Attach pty so we get debug output from the command if this test
13331333
// fails.
13341334
pty:=ptytest.New(t)
1335-
root.Stdout=pty.Output()
1336-
root.Stderr=pty.Output()
1335+
inv.Stdout=pty.Output()
1336+
inv.Stderr=pty.Output()
13371337

1338-
clitest.Start(ctx,t,root)
1338+
clitest.Start(t,inv)
13391339

13401340
// Wait for server to listen on HTTP, this is a good
13411341
// starting point for expecting logs.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp