Conversation
|
Hello 👋 I would like some feedback on the changes related to issue #3428. Cheers ! |
There was a problem hiding this comment.
Hey @tbourrely,
this is a great start! The general architecture seems fine to me. I've spotted a few details in comments. However, the unique major missing point is a unit test for the JavaScript API. You can find them here https://github.com/grafana/k6/blob/master/internal/js/modules/k6/grpc/client_test.go
examples/grpc_healthcheck.js
Outdated
There was a problem hiding this comment.
| const response = client.healthcheck("") | |
| const response = client.healthcheck() |
I would prefer if we support null instead of empty string for the default case.
examples/grpc_healthcheck.js
Outdated
There was a problem hiding this comment.
| const response = client.healthcheck("") | |
| const response = client.healthCheck("") |
I see you've originally proposed this name, that resonates with me because it matches the namespace of the API. Did you encounter any obstacle with it?
There was a problem hiding this comment.
| // Healthcheck runs healtcheck | |
| // Healthcheck checks if the server side is up and ready to serve responses. |
internal/js/modules/k6/grpc/grpc.go
Outdated
There was a problem hiding this comment.
| mustAddServingStatus("HealthcheckUnknown", healthpb.HealthCheckResponse_UNKNOWN) | |
| mustAddServingStatus("HealthCheckUnknown", healthpb.HealthCheckResponse_UNKNOWN) |
It seems consistent with the current API. What is the case used on JavaScript-grpc library?
There was a problem hiding this comment.
There was a problem hiding this comment.
HealthCheck is more consistent with the current method.
There was a problem hiding this comment.
| func TestHealthcheck(t *testing.T) { | |
| func TestHealthCheckServing(t *testing.T) { |
We are missing a not serving case.
05f2d36 to
225969a
Compare
|
Thanks for the review @codebien 👍 |
|
I've added the JS client tests. |
vendor/modules.txt
Outdated
There was a problem hiding this comment.
It shouldn't happen here, can you rollback it, please? If this is a requirement, then we need a dedicated pull request for it.
internal/js/modules/k6/grpc/grpc.go
Outdated
There was a problem hiding this comment.
HealthCheck is more consistent with the current method.
There was a problem hiding this comment.
| res, err := c.HealthCheck(context.Background(), "") | |
| res, err := c.HealthCheck(context.Background(), "HERE-SERVICE") |
We're missing a case where we test a specific service
|
@tbourrely can you rebase and resolve the conflicts, please? |
886dc73 to
ca96658
Compare
ca96658 to
0e3fb95
Compare
68ec422 to
b054618
Compare
b054618 to
129be31
Compare
codebien
left a comment
There was a problem hiding this comment.
LGTM 🎉 @tbourrely thanks for the contribution 🙇
As soon as we have resolved the linter issue, we're working internally on it, we will merge this pull request.
What?
Add a healthcheck method to gRPC JS client.
Why?
Remove invoke boilerplate as specified in #3428
Checklist
make check) and all pass.Related PR(s)/Issue(s)
Closes #3428