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

Commit35e79bc

Browse files
committed
add a test for reporting html first served
1 parent0828c1d commit35e79bc

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

‎cli/server_test.go

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -964,7 +964,7 @@ func TestServer(t *testing.T) {
964964
server:=httptest.NewServer(r)
965965
deferserver.Close()
966966

967-
inv,_:=clitest.New(t,
967+
inv,cfg:=clitest.New(t,
968968
"server",
969969
"--in-memory",
970970
"--http-address",":0",
@@ -977,6 +977,26 @@ func TestServer(t *testing.T) {
977977

978978
<-deployment
979979
<-snapshot
980+
981+
accessURL:=waitAccessURL(t,cfg)
982+
983+
ctx,cancel:=context.WithTimeout(context.Background(),testutil.WaitMedium)
984+
defercancel()
985+
client:=codersdk.New(accessURL)
986+
body,err:=client.Request(ctx,http.MethodGet,"/",nil)
987+
require.NoError(t,err)
988+
require.NoError(t,body.Body.Close())
989+
990+
snap:=<-snapshot
991+
require.Condition(t,func()bool {
992+
htmlFirstServedFound:=false
993+
for_,item:=rangesnap.TelemetryItems {
994+
ifitem.Key==string(telemetry.TelemetryItemKeyHTMLFirstServedAt) {
995+
htmlFirstServedFound=true
996+
}
997+
}
998+
returnhtmlFirstServedFound
999+
},"no html_first_served telemetry item")
9801000
})
9811001
t.Run("Prometheus",func(t*testing.T) {
9821002
t.Parallel()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp