mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
feat: add dismissed
property to the healthcheck section (#10940)
This commit is contained in:
@ -67,6 +67,26 @@ func TestDatabase(t *testing.T) {
|
||||
assert.Contains(t, *report.Error, err.Error())
|
||||
})
|
||||
|
||||
t.Run("DismissedError", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
var (
|
||||
ctx, cancel = context.WithTimeout(context.Background(), testutil.WaitShort)
|
||||
report = healthcheck.DatabaseReport{}
|
||||
db = dbmock.NewMockStore(gomock.NewController(t))
|
||||
err = xerrors.New("ping error")
|
||||
)
|
||||
defer cancel()
|
||||
|
||||
db.EXPECT().Ping(gomock.Any()).Return(time.Duration(0), err)
|
||||
|
||||
report.Run(ctx, &healthcheck.DatabaseReportOptions{DB: db, Dismissed: true})
|
||||
|
||||
assert.Equal(t, health.SeverityError, report.Severity)
|
||||
assert.True(t, report.Dismissed)
|
||||
require.NotNil(t, report.Error)
|
||||
})
|
||||
|
||||
t.Run("Median", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
|
Reference in New Issue
Block a user