@@ -94,24 +94,24 @@ func TestInstallPathHandler(t *testing.T) {
94
94
95
95
}
96
96
97
- func testMultipleChecks (path string , t * testing.T ) {
97
+ func testMultipleChecks (path , name string , t * testing.T ) {
98
98
tests := []struct {
99
99
path string
100
100
expectedResponse string
101
101
expectedStatus int
102
102
addBadCheck bool
103
103
}{
104
- {"?verbose" , "[+]ping ok\n healthz check passed\n " , http .StatusOK , false },
104
+ {"?verbose" , fmt . Sprintf ( "[+]ping ok\n %s check passed\n " , name ) , http .StatusOK , false },
105
105
{"?exclude=dontexist" , "ok" , http .StatusOK , false },
106
106
{"?exclude=bad" , "ok" , http .StatusOK , true },
107
- {"?verbose=true&exclude=bad" , "[+]ping ok\n [+]bad excluded: ok\n healthz check passed\n " , http .StatusOK , true },
108
- {"?verbose=true&exclude=dontexist" , "[+]ping ok\n warn: some health checks cannot be excluded: no matches for \" dontexist\" \n healthz check passed\n " , http .StatusOK , false },
107
+ {"?verbose=true&exclude=bad" , fmt . Sprintf ( "[+]ping ok\n [+]bad excluded: ok\n %s check passed\n " , name ) , http .StatusOK , true },
108
+ {"?verbose=true&exclude=dontexist" , fmt . Sprintf ( "[+]ping ok\n warn: some health checks cannot be excluded: no matches for \" dontexist\" \n %s check passed\n " , name ) , http .StatusOK , false },
109
109
{"/ping" , "ok" , http .StatusOK , false },
110
110
{"" , "ok" , http .StatusOK , false },
111
- {"?verbose" , "[+]ping ok\n [-]bad failed: reason withheld\n healthz check failed\n " , http .StatusInternalServerError , true },
111
+ {"?verbose" , fmt . Sprintf ( "[+]ping ok\n [-]bad failed: reason withheld\n %s check failed\n " , name ) , http .StatusInternalServerError , true },
112
112
{"/ping" , "ok" , http .StatusOK , true },
113
113
{"/bad" , "internal server error: this will fail\n " , http .StatusInternalServerError , true },
114
- {"" , "[+]ping ok\n [-]bad failed: reason withheld\n healthz check failed\n " , http .StatusInternalServerError , true },
114
+ {"" , fmt . Sprintf ( "[+]ping ok\n [-]bad failed: reason withheld\n %s check failed\n " , name ) , http .StatusInternalServerError , true },
115
115
}
116
116
117
117
for i , test := range tests {
@@ -148,11 +148,11 @@ func testMultipleChecks(path string, t *testing.T) {
148
148
}
149
149
150
150
func TestMultipleChecks (t * testing.T ) {
151
- testMultipleChecks ("" , t )
151
+ testMultipleChecks ("" , "healthz" , t )
152
152
}
153
153
154
154
func TestMultiplePathChecks (t * testing.T ) {
155
- testMultipleChecks ("/ready" , t )
155
+ testMultipleChecks ("/ready" , "ready" , t )
156
156
}
157
157
158
158
func TestCheckerNames (t * testing.T ) {
0 commit comments