-
Notifications
You must be signed in to change notification settings - Fork 32
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
Adding GRPC support to go-sdk #175
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: unknown <[email protected]>
Signed-off-by: Pranshu Srivastava <[email protected]> Signed-off-by: unknown <[email protected]>
Signed-off-by: unknown <[email protected]>
Signed-off-by: re-Tick <[email protected]> Signed-off-by: unknown <[email protected]>
Signed-off-by: unknown <[email protected]>
fc78c5a
to
1563b09
Compare
Signed-off-by: unknown <[email protected]>
Signed-off-by: unknown <[email protected]>
keploy/keploy.go
Outdated
k.setKey(r) | ||
r.Header.Set("Content-Type", "application/json") | ||
if k.cfg.Server.GrpcEnabled { | ||
r, err := k.grpcClient.Test(k.Ctx, &proto.TestReq{ |
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.
Since, there are HTTP and GRPC_EXPORT types of tcs. Therefore, it should have proto.TestReq.GrpcResp field when tcs type is GRPC_EXPORT.
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.
Done
keploy/keploy.go
Outdated
k.setKey(r) | ||
r.Header.Set("Content-Type", "application/json") | ||
if k.cfg.Server.GrpcEnabled { | ||
_, err = k.grpcClient.DeNoise(k.Ctx, &proto.TestReq{ |
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.
Here, also it should have proto.TestReq.GrpcResp field assigned when tcs is of type GRPC_EXPORT.
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.
Done
Signed-off-by: unknown <[email protected]>
_, err = k.grpcClient.DeNoise(k.Ctx, &proto.TestReq{ | ||
ID: id, | ||
AppID: k.cfg.App.Name, | ||
Resp: &proto.HttpResp{ |
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.
Resp field is empty for testcase of type grpc
keploy/keploy.go
Outdated
ID: tc.ID, | ||
AppID: k.cfg.App.Name, | ||
RunID: runId, | ||
Resp: &proto.HttpResp{ |
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.
Please Resp field because this field stores response for http but in grpc, it should be empty.
o Signed-off-by: Ubuntu <[email protected]>
Signed-off-by: Ubuntu <[email protected]>
keploy/keploy.go
Outdated
return nil | ||
} | ||
} else { | ||
url := fmt.Sprintf("%s/regression/testcase?app=%s&offset=%d&limit=%d&testCasePath=%s&mockPath=%s&reqType=%s", k.cfg.Server.URL, k.cfg.App.Name, i, 25, k.cfg.App.TestPath, k.cfg.App.MockPath) |
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.
Please remove the reqType query parameter.
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.
Done. PTAL
Signed-off-by: Ubuntu <[email protected]>
Signed-off-by: Ubuntu <[email protected]>
Giving an option to the user to use either grpc or http while creating tests and mocks. GrpcEnabled field, in the server config will be used to choose one of the options.
Closes #4