mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
server: Use named struct initialization in healthcheck test
Signed-off-by: Siyuan Zhang <sizhang@google.com>
This commit is contained in:
committed by
Siyuan Zhang
parent
0b46d431ec
commit
c6784a7e82
@@ -55,46 +55,46 @@ func TestHealthHandler(t *testing.T) {
|
|||||||
health string
|
health string
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
[]*pb.AlarmMember{},
|
alarms: []*pb.AlarmMember{},
|
||||||
"/health",
|
healthCheckURL: "/health",
|
||||||
http.StatusOK,
|
statusCode: http.StatusOK,
|
||||||
"true",
|
health: "true",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
[]*pb.AlarmMember{{MemberID: uint64(0), Alarm: pb.AlarmType_NOSPACE}},
|
alarms: []*pb.AlarmMember{{MemberID: uint64(0), Alarm: pb.AlarmType_NOSPACE}},
|
||||||
"/health",
|
healthCheckURL: "/health",
|
||||||
http.StatusServiceUnavailable,
|
statusCode: http.StatusServiceUnavailable,
|
||||||
"false",
|
health: "false",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
[]*pb.AlarmMember{{MemberID: uint64(0), Alarm: pb.AlarmType_NOSPACE}},
|
alarms: []*pb.AlarmMember{{MemberID: uint64(0), Alarm: pb.AlarmType_NOSPACE}},
|
||||||
"/health?exclude=NOSPACE",
|
healthCheckURL: "/health?exclude=NOSPACE",
|
||||||
http.StatusOK,
|
statusCode: http.StatusOK,
|
||||||
"true",
|
health: "true",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
[]*pb.AlarmMember{},
|
alarms: []*pb.AlarmMember{},
|
||||||
"/health?exclude=NOSPACE",
|
healthCheckURL: "/health?exclude=NOSPACE",
|
||||||
http.StatusOK,
|
statusCode: http.StatusOK,
|
||||||
"true",
|
health: "true",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
[]*pb.AlarmMember{{MemberID: uint64(1), Alarm: pb.AlarmType_NOSPACE}, {MemberID: uint64(2), Alarm: pb.AlarmType_NOSPACE}, {MemberID: uint64(3), Alarm: pb.AlarmType_NOSPACE}},
|
alarms: []*pb.AlarmMember{{MemberID: uint64(1), Alarm: pb.AlarmType_NOSPACE}, {MemberID: uint64(2), Alarm: pb.AlarmType_NOSPACE}, {MemberID: uint64(3), Alarm: pb.AlarmType_NOSPACE}},
|
||||||
"/health?exclude=NOSPACE",
|
healthCheckURL: "/health?exclude=NOSPACE",
|
||||||
http.StatusOK,
|
statusCode: http.StatusOK,
|
||||||
"true",
|
health: "true",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
[]*pb.AlarmMember{{MemberID: uint64(0), Alarm: pb.AlarmType_NOSPACE}, {MemberID: uint64(1), Alarm: pb.AlarmType_CORRUPT}},
|
alarms: []*pb.AlarmMember{{MemberID: uint64(0), Alarm: pb.AlarmType_NOSPACE}, {MemberID: uint64(1), Alarm: pb.AlarmType_CORRUPT}},
|
||||||
"/health?exclude=NOSPACE",
|
healthCheckURL: "/health?exclude=NOSPACE",
|
||||||
http.StatusServiceUnavailable,
|
statusCode: http.StatusServiceUnavailable,
|
||||||
"false",
|
health: "false",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
[]*pb.AlarmMember{{MemberID: uint64(0), Alarm: pb.AlarmType_NOSPACE}, {MemberID: uint64(1), Alarm: pb.AlarmType_CORRUPT}},
|
alarms: []*pb.AlarmMember{{MemberID: uint64(0), Alarm: pb.AlarmType_NOSPACE}, {MemberID: uint64(1), Alarm: pb.AlarmType_CORRUPT}},
|
||||||
"/health?exclude=NOSPACE&exclude=CORRUPT",
|
healthCheckURL: "/health?exclude=NOSPACE&exclude=CORRUPT",
|
||||||
http.StatusOK,
|
statusCode: http.StatusOK,
|
||||||
"true",
|
health: "true",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user