Skip to content

Conversation

@PranshuSrivastava
Copy link
Contributor

@PranshuSrivastava PranshuSrivastava commented Mar 10, 2023

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

PranshuSrivastava and others added 5 commits March 10, 2023 13:30
Signed-off-by: unknown <iampranshu24@gmail.com>
Signed-off-by: Pranshu Srivastava <iampranshu24@gmail.com>
Signed-off-by: unknown <iampranshu24@gmail.com>
Signed-off-by: unknown <iampranshu24@gmail.com>
Signed-off-by: re-Tick <jain.ritik.1001@gmail.com>
Signed-off-by: unknown <iampranshu24@gmail.com>
Signed-off-by: unknown <iampranshu24@gmail.com>
Signed-off-by: unknown <iampranshu24@gmail.com>
Signed-off-by: unknown <iampranshu24@gmail.com>
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{
Copy link
Contributor

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.

Copy link
Contributor Author

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{
Copy link
Contributor

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.

Copy link
Contributor Author

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 <iampranshu24@gmail.com>
_, err = k.grpcClient.DeNoise(k.Ctx, &proto.TestReq{
ID: id,
AppID: k.cfg.App.Name,
Resp: &proto.HttpResp{
Copy link
Contributor

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{
Copy link
Contributor

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.

Ubuntu added 2 commits March 31, 2023 05:23
o

Signed-off-by: Ubuntu <ubuntu@ip-172-31-31-147.ap-south-1.compute.internal>
Signed-off-by: Ubuntu <ubuntu@ip-172-31-31-147.ap-south-1.compute.internal>
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)
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. PTAL

Ubuntu added 2 commits April 3, 2023 10:19
Signed-off-by: Ubuntu <ubuntu@ip-172-31-31-147.ap-south-1.compute.internal>
Signed-off-by: Ubuntu <ubuntu@ip-172-31-31-147.ap-south-1.compute.internal>
@keploy-staging
Copy link

To generate Unit Tests for this PR, please click here

@keploy-staging
Copy link

To generate Unit Tests for this PR, please click here

@keploy-staging
Copy link

To generate Unit Tests for this PR, please click here

@keploy-staging
Copy link

To generate Unit Tests for this PR, please click here

@keploy-staging
Copy link

To generate Unit Tests for this PR, please click here

@keploy-staging
Copy link

To generate Unit Tests for this PR, please click here

@keploy-staging
Copy link

To generate Unit Tests for this PR, please click here

@keploy-staging
Copy link

keploy-staging bot commented Apr 14, 2025

To generate Unit Tests for this PR, please click here

@keploy-staging
Copy link

To generate Unit Tests for this PR, please click here

@keploy
Copy link

keploy bot commented Apr 15, 2025

To generate Unit Tests for this PR, please click here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants