@@ -13,11 +13,12 @@ import (
13
13
)
14
14
15
15
type testChecker struct {
16
- DERPReport derphealth.Report
17
- AccessURLReport healthcheck.AccessURLReport
18
- WebsocketReport healthcheck.WebsocketReport
19
- DatabaseReport healthcheck.DatabaseReport
20
- WorkspaceProxyReport healthcheck.WorkspaceProxyReport
16
+ DERPReport derphealth.Report
17
+ AccessURLReport healthcheck.AccessURLReport
18
+ WebsocketReport healthcheck.WebsocketReport
19
+ DatabaseReport healthcheck.DatabaseReport
20
+ WorkspaceProxyReport healthcheck.WorkspaceProxyReport
21
+ ProvisionerDaemonsReport healthcheck.ProvisionerDaemonsReport
21
22
}
22
23
23
24
func (c * testChecker ) DERP (context.Context , * derphealth.ReportOptions ) derphealth.Report {
@@ -40,6 +41,10 @@ func (c *testChecker) WorkspaceProxy(context.Context, *healthcheck.WorkspaceProx
40
41
return c .WorkspaceProxyReport
41
42
}
42
43
44
+ func (c * testChecker ) ProvisionerDaemons (context.Context , * healthcheck.ProvisionerDaemonsReportOptions ) healthcheck.ProvisionerDaemonsReport {
45
+ return c .ProvisionerDaemonsReport
46
+ }
47
+
43
48
func TestHealthcheck (t * testing.T ) {
44
49
t .Parallel ()
45
50
@@ -72,6 +77,9 @@ func TestHealthcheck(t *testing.T) {
72
77
Healthy : true ,
73
78
Severity : health .SeverityOK ,
74
79
},
80
+ ProvisionerDaemonsReport : healthcheck.ProvisionerDaemonsReport {
81
+ Severity : health .SeverityOK ,
82
+ },
75
83
},
76
84
healthy : true ,
77
85
severity : health .SeverityOK ,
@@ -99,6 +107,9 @@ func TestHealthcheck(t *testing.T) {
99
107
Healthy : true ,
100
108
Severity : health .SeverityOK ,
101
109
},
110
+ ProvisionerDaemonsReport : healthcheck.ProvisionerDaemonsReport {
111
+ Severity : health .SeverityOK ,
112
+ },
102
113
},
103
114
healthy : false ,
104
115
severity : health .SeverityError ,
@@ -127,6 +138,9 @@ func TestHealthcheck(t *testing.T) {
127
138
Healthy : true ,
128
139
Severity : health .SeverityOK ,
129
140
},
141
+ ProvisionerDaemonsReport : healthcheck.ProvisionerDaemonsReport {
142
+ Severity : health .SeverityOK ,
143
+ },
130
144
},
131
145
healthy : true ,
132
146
severity : health .SeverityWarning ,
@@ -154,6 +168,9 @@ func TestHealthcheck(t *testing.T) {
154
168
Healthy : true ,
155
169
Severity : health .SeverityOK ,
156
170
},
171
+ ProvisionerDaemonsReport : healthcheck.ProvisionerDaemonsReport {
172
+ Severity : health .SeverityOK ,
173
+ },
157
174
},
158
175
healthy : false ,
159
176
severity : health .SeverityWarning ,
@@ -181,6 +198,9 @@ func TestHealthcheck(t *testing.T) {
181
198
Healthy : true ,
182
199
Severity : health .SeverityOK ,
183
200
},
201
+ ProvisionerDaemonsReport : healthcheck.ProvisionerDaemonsReport {
202
+ Severity : health .SeverityOK ,
203
+ },
184
204
},
185
205
healthy : false ,
186
206
severity : health .SeverityError ,
@@ -208,6 +228,9 @@ func TestHealthcheck(t *testing.T) {
208
228
Healthy : true ,
209
229
Severity : health .SeverityOK ,
210
230
},
231
+ ProvisionerDaemonsReport : healthcheck.ProvisionerDaemonsReport {
232
+ Severity : health .SeverityOK ,
233
+ },
211
234
},
212
235
healthy : false ,
213
236
severity : health .SeverityError ,
@@ -235,6 +258,9 @@ func TestHealthcheck(t *testing.T) {
235
258
Healthy : false ,
236
259
Severity : health .SeverityError ,
237
260
},
261
+ ProvisionerDaemonsReport : healthcheck.ProvisionerDaemonsReport {
262
+ Severity : health .SeverityOK ,
263
+ },
238
264
},
239
265
severity : health .SeverityError ,
240
266
healthy : false ,
@@ -263,6 +289,70 @@ func TestHealthcheck(t *testing.T) {
263
289
Warnings : []health.Message {{Message : "foobar" , Code : "EFOOBAR" }},
264
290
Severity : health .SeverityWarning ,
265
291
},
292
+ ProvisionerDaemonsReport : healthcheck.ProvisionerDaemonsReport {
293
+ Severity : health .SeverityOK ,
294
+ },
295
+ },
296
+ severity : health .SeverityWarning ,
297
+ healthy : true ,
298
+ failingSections : []codersdk.HealthSection {},
299
+ }, {
300
+ name : "ProvisionerDaemonsFail" ,
301
+ checker : & testChecker {
302
+ DERPReport : derphealth.Report {
303
+ Healthy : true ,
304
+ Severity : health .SeverityOK ,
305
+ },
306
+ AccessURLReport : healthcheck.AccessURLReport {
307
+ Healthy : true ,
308
+ Severity : health .SeverityOK ,
309
+ },
310
+ WebsocketReport : healthcheck.WebsocketReport {
311
+ Healthy : true ,
312
+ Severity : health .SeverityOK ,
313
+ },
314
+ DatabaseReport : healthcheck.DatabaseReport {
315
+ Healthy : true ,
316
+ Severity : health .SeverityOK ,
317
+ },
318
+ WorkspaceProxyReport : healthcheck.WorkspaceProxyReport {
319
+ Healthy : true ,
320
+ Severity : health .SeverityOK ,
321
+ },
322
+ ProvisionerDaemonsReport : healthcheck.ProvisionerDaemonsReport {
323
+ Severity : health .SeverityError ,
324
+ },
325
+ },
326
+ severity : health .SeverityError ,
327
+ healthy : false ,
328
+ failingSections : []codersdk.HealthSection {codersdk .HealthSectionProvisionerDaemons },
329
+ }, {
330
+ name : "ProvisionerDaemonsWarn" ,
331
+ checker : & testChecker {
332
+ DERPReport : derphealth.Report {
333
+ Healthy : true ,
334
+ Severity : health .SeverityOK ,
335
+ },
336
+ AccessURLReport : healthcheck.AccessURLReport {
337
+ Healthy : true ,
338
+ Severity : health .SeverityOK ,
339
+ },
340
+ WebsocketReport : healthcheck.WebsocketReport {
341
+ Healthy : true ,
342
+ Severity : health .SeverityOK ,
343
+ },
344
+ DatabaseReport : healthcheck.DatabaseReport {
345
+ Healthy : true ,
346
+ Severity : health .SeverityOK ,
347
+ },
348
+ WorkspaceProxyReport : healthcheck.WorkspaceProxyReport {
349
+ Healthy : true ,
350
+ Severity : health .SeverityOK ,
351
+ },
352
+ ProvisionerDaemonsReport : healthcheck.ProvisionerDaemonsReport {
353
+ Severity : health .SeverityWarning ,
354
+ Warnings : []health.Message {{Message : "foobar" , Code : "EFOOBAR" }},
355
+ },
266
356
},
267
357
severity : health .SeverityWarning ,
268
358
healthy : true ,
@@ -291,6 +381,9 @@ func TestHealthcheck(t *testing.T) {
291
381
Healthy : false ,
292
382
Severity : health .SeverityError ,
293
383
},
384
+ ProvisionerDaemonsReport : healthcheck.ProvisionerDaemonsReport {
385
+ Severity : health .SeverityError ,
386
+ },
294
387
},
295
388
severity : health .SeverityError ,
296
389
failingSections : []codersdk.HealthSection {
@@ -299,6 +392,7 @@ func TestHealthcheck(t *testing.T) {
299
392
codersdk .HealthSectionWebsocket ,
300
393
codersdk .HealthSectionDatabase ,
301
394
codersdk .HealthSectionWorkspaceProxy ,
395
+ codersdk .HealthSectionProvisionerDaemons ,
302
396
},
303
397
}} {
304
398
c := c
0 commit comments