-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add grpc health service #382
Conversation
overall lgtm. Do you think it makes sense to add a simple test like c := healthgrpc.NewHealthClient(conn)
got, err := c.Check(ctx, request)
if err != nil {
// error
}
if got is not what we want {
// error
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm.
This is more like a wishlist rather than a request but I guess other tests should also use Run()
and would also want to change Run()
to accept a Listener
instead of direct network address/port so that this test can use bufconn
instead.
Service: serviceName, | ||
}) | ||
if err != nil { | ||
t.Fatalf("healthClient.Check err: %v", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggest Errorf instead
https://github.com/golang/go/wiki/TestComments#keep-going
t.Fatalf("healthClient.Check err: %v", err) | ||
} | ||
if want := healthgrpc.HealthCheckResponse_SERVING; got.Status != want { | ||
t.Fatalf("hc.Check got: %v, want: %v", got.Status, want) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
Agreed. I'll open an issue for this. |
What type of PR is this?
What this PR does / Why we need it:
Adds gRPC health check service to the grpc server.
Which issue(s) this PR fixes:
Closes #378
Special notes for your reviewer:
Replaces part of #381