@@ -49,11 +49,10 @@ func TestHealthcheck(t *testing.T) {
49
49
t .Parallel ()
50
50
51
51
for _ , c := range []struct {
52
- name string
53
- checker * testChecker
54
- healthy bool
55
- severity health.Severity
56
- failingSections []healthsdk.HealthSection
52
+ name string
53
+ checker * testChecker
54
+ healthy bool
55
+ severity health.Severity
57
56
}{{
58
57
name : "OK" ,
59
58
checker : & testChecker {
@@ -93,9 +92,8 @@ func TestHealthcheck(t *testing.T) {
93
92
},
94
93
},
95
94
},
96
- healthy : true ,
97
- severity : health .SeverityOK ,
98
- failingSections : []healthsdk.HealthSection {},
95
+ healthy : true ,
96
+ severity : health .SeverityOK ,
99
97
}, {
100
98
name : "DERPFail" ,
101
99
checker : & testChecker {
@@ -135,9 +133,8 @@ func TestHealthcheck(t *testing.T) {
135
133
},
136
134
},
137
135
},
138
- healthy : false ,
139
- severity : health .SeverityError ,
140
- failingSections : []healthsdk.HealthSection {healthsdk .HealthSectionDERP },
136
+ healthy : false ,
137
+ severity : health .SeverityError ,
141
138
}, {
142
139
name : "DERPWarning" ,
143
140
checker : & testChecker {
@@ -178,9 +175,8 @@ func TestHealthcheck(t *testing.T) {
178
175
},
179
176
},
180
177
},
181
- healthy : true ,
182
- severity : health .SeverityWarning ,
183
- failingSections : []healthsdk.HealthSection {},
178
+ healthy : true ,
179
+ severity : health .SeverityWarning ,
184
180
}, {
185
181
name : "AccessURLFail" ,
186
182
checker : & testChecker {
@@ -220,9 +216,8 @@ func TestHealthcheck(t *testing.T) {
220
216
},
221
217
},
222
218
},
223
- healthy : false ,
224
- severity : health .SeverityWarning ,
225
- failingSections : []healthsdk.HealthSection {healthsdk .HealthSectionAccessURL },
219
+ healthy : false ,
220
+ severity : health .SeverityWarning ,
226
221
}, {
227
222
name : "WebsocketFail" ,
228
223
checker : & testChecker {
@@ -262,9 +257,8 @@ func TestHealthcheck(t *testing.T) {
262
257
},
263
258
},
264
259
},
265
- healthy : false ,
266
- severity : health .SeverityError ,
267
- failingSections : []healthsdk.HealthSection {healthsdk .HealthSectionWebsocket },
260
+ healthy : false ,
261
+ severity : health .SeverityError ,
268
262
}, {
269
263
name : "DatabaseFail" ,
270
264
checker : & testChecker {
@@ -304,9 +298,8 @@ func TestHealthcheck(t *testing.T) {
304
298
},
305
299
},
306
300
},
307
- healthy : false ,
308
- severity : health .SeverityError ,
309
- failingSections : []healthsdk.HealthSection {healthsdk .HealthSectionDatabase },
301
+ healthy : false ,
302
+ severity : health .SeverityError ,
310
303
}, {
311
304
name : "ProxyFail" ,
312
305
checker : & testChecker {
@@ -346,9 +339,8 @@ func TestHealthcheck(t *testing.T) {
346
339
},
347
340
},
348
341
},
349
- severity : health .SeverityError ,
350
- healthy : false ,
351
- failingSections : []healthsdk.HealthSection {healthsdk .HealthSectionWorkspaceProxy },
342
+ severity : health .SeverityError ,
343
+ healthy : false ,
352
344
}, {
353
345
name : "ProxyWarn" ,
354
346
checker : & testChecker {
@@ -389,9 +381,8 @@ func TestHealthcheck(t *testing.T) {
389
381
},
390
382
},
391
383
},
392
- severity : health .SeverityWarning ,
393
- healthy : true ,
394
- failingSections : []healthsdk.HealthSection {},
384
+ severity : health .SeverityWarning ,
385
+ healthy : true ,
395
386
}, {
396
387
name : "ProvisionerDaemonsFail" ,
397
388
checker : & testChecker {
@@ -431,9 +422,8 @@ func TestHealthcheck(t *testing.T) {
431
422
},
432
423
},
433
424
},
434
- severity : health .SeverityError ,
435
- healthy : false ,
436
- failingSections : []healthsdk.HealthSection {healthsdk .HealthSectionProvisionerDaemons },
425
+ severity : health .SeverityError ,
426
+ healthy : false ,
437
427
}, {
438
428
name : "ProvisionerDaemonsWarn" ,
439
429
checker : & testChecker {
@@ -474,9 +464,8 @@ func TestHealthcheck(t *testing.T) {
474
464
},
475
465
},
476
466
},
477
- severity : health .SeverityWarning ,
478
- healthy : true ,
479
- failingSections : []healthsdk.HealthSection {},
467
+ severity : health .SeverityWarning ,
468
+ healthy : true ,
480
469
}, {
481
470
name : "AllFail" ,
482
471
healthy : false ,
@@ -518,14 +507,6 @@ func TestHealthcheck(t *testing.T) {
518
507
},
519
508
},
520
509
severity : health .SeverityError ,
521
- failingSections : []healthsdk.HealthSection {
522
- healthsdk .HealthSectionDERP ,
523
- healthsdk .HealthSectionAccessURL ,
524
- healthsdk .HealthSectionWebsocket ,
525
- healthsdk .HealthSectionDatabase ,
526
- healthsdk .HealthSectionWorkspaceProxy ,
527
- healthsdk .HealthSectionProvisionerDaemons ,
528
- },
529
510
}} {
530
511
c := c
531
512
t .Run (c .name , func (t * testing.T ) {
@@ -537,7 +518,6 @@ func TestHealthcheck(t *testing.T) {
537
518
538
519
assert .Equal (t , c .healthy , report .Healthy )
539
520
assert .Equal (t , c .severity , report .Severity )
540
- assert .Equal (t , c .failingSections , report .FailingSections )
541
521
assert .Equal (t , c .checker .DERPReport .Healthy , report .DERP .Healthy )
542
522
assert .Equal (t , c .checker .DERPReport .Severity , report .DERP .Severity )
543
523
assert .Equal (t , c .checker .DERPReport .Warnings , report .DERP .Warnings )
0 commit comments