feat: add dismissed property to the healthcheck section (#10940)

This commit is contained in:
Marcin Tojek
2023-11-29 17:37:40 +01:00
committed by GitHub
parent d374becdeb
commit 2b574e2b2d
19 changed files with 225 additions and 38 deletions

View File

@ -68,4 +68,22 @@ func TestWebsocket(t *testing.T) {
assert.Equal(t, wsReport.Body, "test error")
assert.Equal(t, wsReport.Code, http.StatusBadRequest)
})
t.Run("DismissedError", func(t *testing.T) {
t.Parallel()
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitShort)
defer cancel()
wsReport := healthcheck.WebsocketReport{}
wsReport.Run(ctx, &healthcheck.WebsocketReportOptions{
AccessURL: &url.URL{Host: "fake"},
Dismissed: true,
})
require.True(t, wsReport.Dismissed)
require.Equal(t, health.SeverityError, wsReport.Severity)
require.NotNil(t, wsReport.Error)
require.Equal(t, health.SeverityError, wsReport.Severity)
})
}