add sql wrapper tests, regen
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
@@ -104,7 +104,7 @@ func TestFlow(t *testing.T) {
|
||||
steps := []flow.Step{
|
||||
flow.NewCallStep("test", pb.TestServiceName, "LookupUser", flow.StepID("test.TestService.LookupUser")),
|
||||
flow.NewCallStep("test", pb.TestServiceName, "UpdateUser", flow.StepRequires("test.TestService.LookupUser")),
|
||||
flow.NewCallStep("test", pb.TestServiceName, "DeleteUser", flow.StepRequires("test.TestService.UpdateUser")),
|
||||
flow.NewCallStep("test", pb.TestServiceName, "DeleteUser", flow.StepRequires("test.TestService.LookupUser")),
|
||||
flow.NewCallStep("test", pb.TestServiceName, "MailUser", flow.StepRequires("test.TestService.UpdateUser")),
|
||||
}
|
||||
w, err := f.WorkflowCreate(ctx, "test", steps...)
|
||||
|
@@ -1,7 +1,7 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.26.0
|
||||
// protoc v3.19.4
|
||||
// protoc v3.21.12
|
||||
// source: test.proto
|
||||
|
||||
package pb
|
||||
@@ -452,43 +452,43 @@ var file_test_proto_rawDesc = []byte{
|
||||
0x73, 0x70, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x69, 0x72, 0x74, 0x68, 0x64, 0x61, 0x79, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, 0x69, 0x72, 0x74, 0x68, 0x64, 0x61, 0x79, 0x22, 0x19,
|
||||
0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x32, 0x84, 0x04, 0x0a, 0x0b, 0x54, 0x65,
|
||||
0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x7b, 0x0a, 0x0a, 0x4c, 0x6f, 0x6f,
|
||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x32, 0x8d, 0x04, 0x0a, 0x0b, 0x54, 0x65,
|
||||
0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x7d, 0x0a, 0x0a, 0x4c, 0x6f, 0x6f,
|
||||
0x6b, 0x75, 0x70, 0x55, 0x73, 0x65, 0x72, 0x12, 0x13, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4c,
|
||||
0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x74,
|
||||
0x65, 0x73, 0x74, 0x2e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x55, 0x73, 0x65, 0x72, 0x52, 0x73,
|
||||
0x70, 0x22, 0x43, 0xaa, 0x84, 0x9e, 0x03, 0x1f, 0x2a, 0x0a, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70,
|
||||
0x70, 0x22, 0x45, 0xaa, 0x84, 0x9e, 0x03, 0x1f, 0x2a, 0x0a, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70,
|
||||
0x55, 0x73, 0x65, 0x72, 0x42, 0x11, 0x0a, 0x0f, 0x12, 0x0d, 0x0a, 0x0b, 0x2e, 0x74, 0x65, 0x73,
|
||||
0x74, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0xb2, 0xea, 0xff, 0xf9, 0x01, 0x11, 0x12, 0x0f, 0x2f,
|
||||
0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0xba, 0xea,
|
||||
0xff, 0xf9, 0x01, 0x02, 0x08, 0x05, 0x12, 0x7e, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65,
|
||||
0x55, 0x73, 0x65, 0x72, 0x12, 0x13, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x55, 0x70, 0x64, 0x61,
|
||||
0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x74, 0x65, 0x73, 0x74,
|
||||
0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x73, 0x70, 0x22, 0x46,
|
||||
0xaa, 0x84, 0x9e, 0x03, 0x1f, 0x2a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65,
|
||||
0x72, 0x42, 0x11, 0x0a, 0x0f, 0x12, 0x0d, 0x0a, 0x0b, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x45,
|
||||
0x72, 0x72, 0x6f, 0x72, 0xb2, 0xea, 0xff, 0xf9, 0x01, 0x14, 0x1a, 0x0f, 0x2f, 0x76, 0x31, 0x2f,
|
||||
0x75, 0x73, 0x65, 0x72, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x3a, 0x01, 0x2a, 0xba, 0xea,
|
||||
0xff, 0xf9, 0x01, 0x02, 0x08, 0x05, 0x12, 0x7b, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65,
|
||||
0x55, 0x73, 0x65, 0x72, 0x12, 0x13, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x44, 0x65, 0x6c, 0x65,
|
||||
0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x74, 0x65, 0x73, 0x74,
|
||||
0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x73, 0x70, 0x22, 0x43,
|
||||
0xaa, 0x84, 0x9e, 0x03, 0x1f, 0x2a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65,
|
||||
0x72, 0x42, 0x11, 0x0a, 0x0f, 0x12, 0x0d, 0x0a, 0x0b, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x45,
|
||||
0x72, 0x72, 0x6f, 0x72, 0xb2, 0xea, 0xff, 0xf9, 0x01, 0x11, 0x2a, 0x0f, 0x2f, 0x76, 0x31, 0x2f,
|
||||
0x75, 0x73, 0x65, 0x72, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0xba, 0xea, 0xff, 0xf9, 0x01,
|
||||
0x02, 0x08, 0x05, 0x12, 0x7b, 0x0a, 0x08, 0x4d, 0x61, 0x69, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x12,
|
||||
0x11, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x61, 0x69, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x52,
|
||||
0x65, 0x71, 0x1a, 0x11, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x61, 0x69, 0x6c, 0x55, 0x73,
|
||||
0x65, 0x72, 0x52, 0x73, 0x70, 0x22, 0x49, 0xaa, 0x84, 0x9e, 0x03, 0x1d, 0x2a, 0x08, 0x4d, 0x61,
|
||||
0x69, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x42, 0x11, 0x0a, 0x0f, 0x12, 0x0d, 0x0a, 0x0b, 0x2e, 0x74,
|
||||
0x65, 0x73, 0x74, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0xb2, 0xea, 0xff, 0xf9, 0x01, 0x19, 0x22,
|
||||
0x14, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d,
|
||||
0x2f, 0x6d, 0x61, 0x69, 0x6c, 0x3a, 0x01, 0x2a, 0xba, 0xea, 0xff, 0xf9, 0x01, 0x02, 0x08, 0x05,
|
||||
0x42, 0x2b, 0x5a, 0x29, 0x67, 0x6f, 0x2e, 0x75, 0x6e, 0x69, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e,
|
||||
0x6f, 0x72, 0x67, 0x2f, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x2d, 0x74, 0x65, 0x73, 0x74, 0x73, 0x2f,
|
||||
0x66, 0x6c, 0x6f, 0x77, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0xff, 0xf9, 0x01, 0x04, 0x0a, 0x02, 0x35, 0x73, 0x12, 0x80, 0x01, 0x0a, 0x0a, 0x55, 0x70, 0x64,
|
||||
0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x13, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x55,
|
||||
0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x74,
|
||||
0x65, 0x73, 0x74, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x73,
|
||||
0x70, 0x22, 0x48, 0xaa, 0x84, 0x9e, 0x03, 0x1f, 0x2a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65,
|
||||
0x55, 0x73, 0x65, 0x72, 0x42, 0x11, 0x0a, 0x0f, 0x12, 0x0d, 0x0a, 0x0b, 0x2e, 0x74, 0x65, 0x73,
|
||||
0x74, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0xb2, 0xea, 0xff, 0xf9, 0x01, 0x14, 0x1a, 0x0f, 0x2f,
|
||||
0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x3a, 0x01,
|
||||
0x2a, 0xba, 0xea, 0xff, 0xf9, 0x01, 0x04, 0x0a, 0x02, 0x35, 0x73, 0x12, 0x7d, 0x0a, 0x0a, 0x44,
|
||||
0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x13, 0x2e, 0x74, 0x65, 0x73, 0x74,
|
||||
0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x13,
|
||||
0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72,
|
||||
0x52, 0x73, 0x70, 0x22, 0x45, 0xaa, 0x84, 0x9e, 0x03, 0x1f, 0x2a, 0x0a, 0x44, 0x65, 0x6c, 0x65,
|
||||
0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x42, 0x11, 0x0a, 0x0f, 0x12, 0x0d, 0x0a, 0x0b, 0x2e, 0x74,
|
||||
0x65, 0x73, 0x74, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0xb2, 0xea, 0xff, 0xf9, 0x01, 0x11, 0x2a,
|
||||
0x0f, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d,
|
||||
0xba, 0xea, 0xff, 0xf9, 0x01, 0x04, 0x0a, 0x02, 0x35, 0x73, 0x12, 0x7d, 0x0a, 0x08, 0x4d, 0x61,
|
||||
0x69, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x12, 0x11, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x61,
|
||||
0x69, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x74, 0x65, 0x73, 0x74,
|
||||
0x2e, 0x4d, 0x61, 0x69, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x52, 0x73, 0x70, 0x22, 0x4b, 0xaa, 0x84,
|
||||
0x9e, 0x03, 0x1d, 0x2a, 0x08, 0x4d, 0x61, 0x69, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x42, 0x11, 0x0a,
|
||||
0x0f, 0x12, 0x0d, 0x0a, 0x0b, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72,
|
||||
0xb2, 0xea, 0xff, 0xf9, 0x01, 0x19, 0x22, 0x14, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72,
|
||||
0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x6d, 0x61, 0x69, 0x6c, 0x3a, 0x01, 0x2a, 0xba,
|
||||
0xea, 0xff, 0xf9, 0x01, 0x04, 0x0a, 0x02, 0x35, 0x73, 0x42, 0x2b, 0x5a, 0x29, 0x67, 0x6f, 0x2e,
|
||||
0x75, 0x6e, 0x69, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x6d, 0x69, 0x63,
|
||||
0x72, 0x6f, 0x2d, 0x74, 0x65, 0x73, 0x74, 0x73, 0x2f, 0x66, 0x6c, 0x6f, 0x77, 0x2f, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
|
@@ -23,7 +23,7 @@ service TestService {
|
||||
};
|
||||
};
|
||||
option (micro.api.http) = { get: "/v1/user/{name}"; };
|
||||
option (micro.api.micro_method) = { timeout: 5; };
|
||||
option (micro.api.micro_method) = { timeout: "5s"; };
|
||||
};
|
||||
rpc UpdateUser(UpdateUserReq) returns (UpdateUserRsp) {
|
||||
option (micro.openapiv3.openapiv3_operation) = {
|
||||
@@ -37,7 +37,7 @@ service TestService {
|
||||
};
|
||||
};
|
||||
option (micro.api.http) = { put: "/v1/user/{name}"; body:"*"; };
|
||||
option (micro.api.micro_method) = { timeout: 5; };
|
||||
option (micro.api.micro_method) = { timeout: "5s"; };
|
||||
};
|
||||
rpc DeleteUser(DeleteUserReq) returns (DeleteUserRsp) {
|
||||
option (micro.openapiv3.openapiv3_operation) = {
|
||||
@@ -51,7 +51,7 @@ service TestService {
|
||||
};
|
||||
};
|
||||
option (micro.api.http) = { delete: "/v1/user/{name}"; };
|
||||
option (micro.api.micro_method) = { timeout: 5; };
|
||||
option (micro.api.micro_method) = { timeout: "5s"; };
|
||||
};
|
||||
rpc MailUser(MailUserReq) returns (MailUserRsp) {
|
||||
option (micro.openapiv3.openapiv3_operation) = {
|
||||
@@ -65,7 +65,7 @@ service TestService {
|
||||
};
|
||||
};
|
||||
option (micro.api.http) = { post: "/v1/user/{name}/mail"; body:"*"; };
|
||||
option (micro.api.micro_method) = { timeout: 5; };
|
||||
option (micro.api.micro_method) = { timeout: "5s"; };
|
||||
};
|
||||
};
|
||||
|
||||
|
@@ -1,5 +1,7 @@
|
||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||
// protoc-gen-go-micro version: v3.5.3
|
||||
// versions:
|
||||
// - protoc-gen-go-micro v3.5.3
|
||||
// - protoc v3.21.12
|
||||
// source: test.proto
|
||||
|
||||
package pb
|
||||
|
@@ -33,7 +33,8 @@ func (c *testServiceClient) LookupUser(ctx context.Context, req *LookupUserReq,
|
||||
v3.Method(http.MethodGet),
|
||||
v3.Path("/v1/user/{name}"),
|
||||
)
|
||||
opts = append(opts, client.WithRequestTimeout(time.Second*5))
|
||||
td := time.Duration(5000000000)
|
||||
opts = append(opts, client.WithRequestTimeout(td))
|
||||
rsp := &LookupUserRsp{}
|
||||
err := c.c.Call(ctx, c.c.NewRequest(c.name, "TestService.LookupUser", req), rsp, opts...)
|
||||
if err != nil {
|
||||
@@ -53,7 +54,8 @@ func (c *testServiceClient) UpdateUser(ctx context.Context, req *UpdateUserReq,
|
||||
v3.Path("/v1/user/{name}"),
|
||||
v3.Body("*"),
|
||||
)
|
||||
opts = append(opts, client.WithRequestTimeout(time.Second*5))
|
||||
td := time.Duration(5000000000)
|
||||
opts = append(opts, client.WithRequestTimeout(td))
|
||||
rsp := &UpdateUserRsp{}
|
||||
err := c.c.Call(ctx, c.c.NewRequest(c.name, "TestService.UpdateUser", req), rsp, opts...)
|
||||
if err != nil {
|
||||
@@ -72,7 +74,8 @@ func (c *testServiceClient) DeleteUser(ctx context.Context, req *DeleteUserReq,
|
||||
v3.Method(http.MethodDelete),
|
||||
v3.Path("/v1/user/{name}"),
|
||||
)
|
||||
opts = append(opts, client.WithRequestTimeout(time.Second*5))
|
||||
td := time.Duration(5000000000)
|
||||
opts = append(opts, client.WithRequestTimeout(td))
|
||||
rsp := &DeleteUserRsp{}
|
||||
err := c.c.Call(ctx, c.c.NewRequest(c.name, "TestService.DeleteUser", req), rsp, opts...)
|
||||
if err != nil {
|
||||
@@ -92,7 +95,8 @@ func (c *testServiceClient) MailUser(ctx context.Context, req *MailUserReq, opts
|
||||
v3.Path("/v1/user/{name}/mail"),
|
||||
v3.Body("*"),
|
||||
)
|
||||
opts = append(opts, client.WithRequestTimeout(time.Second*5))
|
||||
td := time.Duration(5000000000)
|
||||
opts = append(opts, client.WithRequestTimeout(td))
|
||||
rsp := &MailUserRsp{}
|
||||
err := c.c.Call(ctx, c.c.NewRequest(c.name, "TestService.MailUser", req), rsp, opts...)
|
||||
if err != nil {
|
||||
@@ -107,28 +111,32 @@ type testServiceServer struct {
|
||||
|
||||
func (h *testServiceServer) LookupUser(ctx context.Context, req *LookupUserReq, rsp *LookupUserRsp) error {
|
||||
var cancel context.CancelFunc
|
||||
ctx, cancel = context.WithTimeout(ctx, time.Second*5)
|
||||
td := time.Duration(5000000000)
|
||||
ctx, cancel = context.WithTimeout(ctx, td)
|
||||
defer cancel()
|
||||
return h.TestServiceServer.LookupUser(ctx, req, rsp)
|
||||
}
|
||||
|
||||
func (h *testServiceServer) UpdateUser(ctx context.Context, req *UpdateUserReq, rsp *UpdateUserRsp) error {
|
||||
var cancel context.CancelFunc
|
||||
ctx, cancel = context.WithTimeout(ctx, time.Second*5)
|
||||
td := time.Duration(5000000000)
|
||||
ctx, cancel = context.WithTimeout(ctx, td)
|
||||
defer cancel()
|
||||
return h.TestServiceServer.UpdateUser(ctx, req, rsp)
|
||||
}
|
||||
|
||||
func (h *testServiceServer) DeleteUser(ctx context.Context, req *DeleteUserReq, rsp *DeleteUserRsp) error {
|
||||
var cancel context.CancelFunc
|
||||
ctx, cancel = context.WithTimeout(ctx, time.Second*5)
|
||||
td := time.Duration(5000000000)
|
||||
ctx, cancel = context.WithTimeout(ctx, td)
|
||||
defer cancel()
|
||||
return h.TestServiceServer.DeleteUser(ctx, req, rsp)
|
||||
}
|
||||
|
||||
func (h *testServiceServer) MailUser(ctx context.Context, req *MailUserReq, rsp *MailUserRsp) error {
|
||||
var cancel context.CancelFunc
|
||||
ctx, cancel = context.WithTimeout(ctx, time.Second*5)
|
||||
td := time.Duration(5000000000)
|
||||
ctx, cancel = context.WithTimeout(ctx, td)
|
||||
defer cancel()
|
||||
return h.TestServiceServer.MailUser(ctx, req, rsp)
|
||||
}
|
||||
|
Reference in New Issue
Block a user