diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2022-11-10 09:58:43 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2022-11-14 11:07:31 +0300 |
commit | c375a4d3077f7f4c4aa58f1e97e252f0e12fd444 (patch) | |
tree | fc9fc92a6dcfc192fd5ab1b3314c467ef95e296f | |
parent | 95555c9598c659ca3d904ba4e5093c38d36c4e61 (diff) |
praefect: Drop mock service previously used for our tests
Remove the mock service that has previously been used by our Praefect
tests.
-rw-r--r-- | Makefile | 1 | ||||
-rw-r--r-- | internal/praefect/mock/mock.pb.go | 181 | ||||
-rw-r--r-- | internal/praefect/mock/mock.proto | 44 | ||||
-rw-r--r-- | internal/praefect/mock/mock_grpc.pb.go | 184 | ||||
-rw-r--r-- | internal/praefect/mocksvc_test.go | 33 |
5 files changed, 0 insertions, 443 deletions
@@ -485,7 +485,6 @@ proto: ${PROTOC} ${PROTOC_GEN_GO} ${PROTOC_GEN_GO_GRPC} ${PROTOC_GEN_GITALY_PROT ${PROTOC} ${SHARED_PROTOC_OPTS} -I ${SOURCE_DIR}/proto -I ${PROTOC_INSTALL_DIR}/include --go_out=${SOURCE_DIR}/proto/go/gitalypb --gitaly-protolist_out=proto_dir=${SOURCE_DIR}/proto,gitalypb_dir=${SOURCE_DIR}/proto/go/gitalypb:${SOURCE_DIR} --go-grpc_out=${SOURCE_DIR}/proto/go/gitalypb ${SOURCE_DIR}/proto/*.proto @ # this part is related to the generation of sources from testing proto files ${PROTOC} ${SHARED_PROTOC_OPTS} -I ${SOURCE_DIR}/proto -I ${SOURCE_DIR}/internal -I ${PROTOC_INSTALL_DIR}/include --go_out=${SOURCE_DIR}/internal --go-grpc_out=${SOURCE_DIR}/internal \ - ${SOURCE_DIR}/internal/praefect/mock/mock.proto \ ${SOURCE_DIR}/internal/middleware/cache/testdata/stream.proto ${PROTOC} ${SHARED_PROTOC_OPTS} -I ${SOURCE_DIR}/proto -I ${SOURCE_DIR}/tools -I ${PROTOC_INSTALL_DIR}/include --go_out=${SOURCE_DIR}/tools --go-grpc_out=${SOURCE_DIR}/tools ${SOURCE_DIR}/tools/protoc-gen-gitaly-lint/testdata/*.proto diff --git a/internal/praefect/mock/mock.pb.go b/internal/praefect/mock/mock.pb.go deleted file mode 100644 index a1c3db3cc..000000000 --- a/internal/praefect/mock/mock.pb.go +++ /dev/null @@ -1,181 +0,0 @@ -// -//This file is a mock gRPC service used for validating the various types of -//gRPC methods that Praefect is expected to reverse proxy. It is intended to keep -//tests simple and keep Praefect decoupled from specific gRPC services. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc v3.21.7 -// source: praefect/mock/mock.proto - -package mock - -import ( - gitalypb "gitlab.com/gitlab-org/gitaly/v15/proto/go/gitalypb" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - emptypb "google.golang.org/protobuf/types/known/emptypb" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type RepoRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Repo *gitalypb.Repository `protobuf:"bytes,1,opt,name=repo,proto3" json:"repo,omitempty"` -} - -func (x *RepoRequest) Reset() { - *x = RepoRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_praefect_mock_mock_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RepoRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RepoRequest) ProtoMessage() {} - -func (x *RepoRequest) ProtoReflect() protoreflect.Message { - mi := &file_praefect_mock_mock_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RepoRequest.ProtoReflect.Descriptor instead. -func (*RepoRequest) Descriptor() ([]byte, []int) { - return file_praefect_mock_mock_proto_rawDescGZIP(), []int{0} -} - -func (x *RepoRequest) GetRepo() *gitalypb.Repository { - if x != nil { - return x.Repo - } - return nil -} - -var File_praefect_mock_mock_proto protoreflect.FileDescriptor - -var file_praefect_mock_mock_proto_rawDesc = []byte{ - 0x0a, 0x18, 0x70, 0x72, 0x61, 0x65, 0x66, 0x65, 0x63, 0x74, 0x2f, 0x6d, 0x6f, 0x63, 0x6b, 0x2f, - 0x6d, 0x6f, 0x63, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x6d, 0x6f, 0x63, 0x6b, - 0x1a, 0x0c, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0a, - 0x6c, 0x69, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, - 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3b, 0x0a, 0x0b, 0x52, 0x65, 0x70, 0x6f, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2c, 0x0a, 0x04, 0x72, 0x65, 0x70, 0x6f, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, 0x2e, 0x52, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x42, 0x04, 0x98, 0xc6, 0x2c, 0x01, 0x52, 0x04, - 0x72, 0x65, 0x70, 0x6f, 0x32, 0xe9, 0x01, 0x0a, 0x0d, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x46, 0x0a, 0x11, 0x52, 0x65, 0x70, 0x6f, 0x41, 0x63, - 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x55, 0x6e, 0x61, 0x72, 0x79, 0x12, 0x11, 0x2e, 0x6d, 0x6f, - 0x63, 0x6b, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x06, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x02, 0x12, 0x45, - 0x0a, 0x10, 0x52, 0x65, 0x70, 0x6f, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x6f, 0x72, 0x55, 0x6e, 0x61, - 0x72, 0x79, 0x12, 0x11, 0x2e, 0x6d, 0x6f, 0x63, 0x6b, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x06, 0xfa, - 0x97, 0x28, 0x02, 0x08, 0x01, 0x12, 0x49, 0x0a, 0x14, 0x52, 0x65, 0x70, 0x6f, 0x4d, 0x61, 0x69, - 0x6e, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x55, 0x6e, 0x61, 0x72, 0x79, 0x12, 0x11, 0x2e, - 0x6d, 0x6f, 0x63, 0x6b, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x06, 0xfa, 0x97, 0x28, 0x02, 0x08, 0x03, - 0x42, 0x39, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x6c, 0x61, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, - 0x69, 0x74, 0x6c, 0x61, 0x62, 0x2d, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x79, - 0x2f, 0x76, 0x31, 0x35, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, - 0x61, 0x65, 0x66, 0x65, 0x63, 0x74, 0x2f, 0x6d, 0x6f, 0x63, 0x6b, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, -} - -var ( - file_praefect_mock_mock_proto_rawDescOnce sync.Once - file_praefect_mock_mock_proto_rawDescData = file_praefect_mock_mock_proto_rawDesc -) - -func file_praefect_mock_mock_proto_rawDescGZIP() []byte { - file_praefect_mock_mock_proto_rawDescOnce.Do(func() { - file_praefect_mock_mock_proto_rawDescData = protoimpl.X.CompressGZIP(file_praefect_mock_mock_proto_rawDescData) - }) - return file_praefect_mock_mock_proto_rawDescData -} - -var file_praefect_mock_mock_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_praefect_mock_mock_proto_goTypes = []interface{}{ - (*RepoRequest)(nil), // 0: mock.RepoRequest - (*gitalypb.Repository)(nil), // 1: gitaly.Repository - (*emptypb.Empty)(nil), // 2: google.protobuf.Empty -} -var file_praefect_mock_mock_proto_depIdxs = []int32{ - 1, // 0: mock.RepoRequest.repo:type_name -> gitaly.Repository - 0, // 1: mock.SimpleService.RepoAccessorUnary:input_type -> mock.RepoRequest - 0, // 2: mock.SimpleService.RepoMutatorUnary:input_type -> mock.RepoRequest - 0, // 3: mock.SimpleService.RepoMaintenanceUnary:input_type -> mock.RepoRequest - 2, // 4: mock.SimpleService.RepoAccessorUnary:output_type -> google.protobuf.Empty - 2, // 5: mock.SimpleService.RepoMutatorUnary:output_type -> google.protobuf.Empty - 2, // 6: mock.SimpleService.RepoMaintenanceUnary:output_type -> google.protobuf.Empty - 4, // [4:7] is the sub-list for method output_type - 1, // [1:4] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_praefect_mock_mock_proto_init() } -func file_praefect_mock_mock_proto_init() { - if File_praefect_mock_mock_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_praefect_mock_mock_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RepoRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_praefect_mock_mock_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_praefect_mock_mock_proto_goTypes, - DependencyIndexes: file_praefect_mock_mock_proto_depIdxs, - MessageInfos: file_praefect_mock_mock_proto_msgTypes, - }.Build() - File_praefect_mock_mock_proto = out.File - file_praefect_mock_mock_proto_rawDesc = nil - file_praefect_mock_mock_proto_goTypes = nil - file_praefect_mock_mock_proto_depIdxs = nil -} diff --git a/internal/praefect/mock/mock.proto b/internal/praefect/mock/mock.proto deleted file mode 100644 index 166c9d8bd..000000000 --- a/internal/praefect/mock/mock.proto +++ /dev/null @@ -1,44 +0,0 @@ -/* -This file is a mock gRPC service used for validating the various types of -gRPC methods that Praefect is expected to reverse proxy. It is intended to keep -tests simple and keep Praefect decoupled from specific gRPC services. -*/ -syntax = "proto3"; - -package mock; - -option go_package = "gitlab.com/gitlab-org/gitaly/v15/internal/praefect/mock"; - -import "shared.proto"; -import "lint.proto"; -import "google/protobuf/empty.proto"; - -message RepoRequest { - gitaly.Repository repo = 1 [(gitaly.target_repository)=true]; -} - -service SimpleService { - // RepoAccessorUnary is a unary RPC that accesses a repo - rpc RepoAccessorUnary(RepoRequest) returns (google.protobuf.Empty) { - option (gitaly.op_type) = { - op: ACCESSOR - scope_level: REPOSITORY - }; - } - - // RepoMutatorUnary is a unary RPC that mutates a repo - rpc RepoMutatorUnary(RepoRequest) returns (google.protobuf.Empty) { - option (gitaly.op_type) = { - op: MUTATOR - scope_level: REPOSITORY - }; - } - - // RepoMaintenanceUnary is a unary RPC that maintains a repo - rpc RepoMaintenanceUnary(RepoRequest) returns (google.protobuf.Empty) { - option (gitaly.op_type) = { - op: MAINTENANCE - scope_level: REPOSITORY - }; - } -} diff --git a/internal/praefect/mock/mock_grpc.pb.go b/internal/praefect/mock/mock_grpc.pb.go deleted file mode 100644 index 6722f13ae..000000000 --- a/internal/praefect/mock/mock_grpc.pb.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v3.21.7 -// source: praefect/mock/mock.proto - -package mock - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - emptypb "google.golang.org/protobuf/types/known/emptypb" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -// SimpleServiceClient is the client API for SimpleService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type SimpleServiceClient interface { - // RepoAccessorUnary is a unary RPC that accesses a repo - RepoAccessorUnary(ctx context.Context, in *RepoRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - // RepoMutatorUnary is a unary RPC that mutates a repo - RepoMutatorUnary(ctx context.Context, in *RepoRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - // RepoMaintenanceUnary is a unary RPC that maintains a repo - RepoMaintenanceUnary(ctx context.Context, in *RepoRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) -} - -type simpleServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewSimpleServiceClient(cc grpc.ClientConnInterface) SimpleServiceClient { - return &simpleServiceClient{cc} -} - -func (c *simpleServiceClient) RepoAccessorUnary(ctx context.Context, in *RepoRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/mock.SimpleService/RepoAccessorUnary", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *simpleServiceClient) RepoMutatorUnary(ctx context.Context, in *RepoRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/mock.SimpleService/RepoMutatorUnary", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *simpleServiceClient) RepoMaintenanceUnary(ctx context.Context, in *RepoRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/mock.SimpleService/RepoMaintenanceUnary", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// SimpleServiceServer is the server API for SimpleService service. -// All implementations must embed UnimplementedSimpleServiceServer -// for forward compatibility -type SimpleServiceServer interface { - // RepoAccessorUnary is a unary RPC that accesses a repo - RepoAccessorUnary(context.Context, *RepoRequest) (*emptypb.Empty, error) - // RepoMutatorUnary is a unary RPC that mutates a repo - RepoMutatorUnary(context.Context, *RepoRequest) (*emptypb.Empty, error) - // RepoMaintenanceUnary is a unary RPC that maintains a repo - RepoMaintenanceUnary(context.Context, *RepoRequest) (*emptypb.Empty, error) - mustEmbedUnimplementedSimpleServiceServer() -} - -// UnimplementedSimpleServiceServer must be embedded to have forward compatible implementations. -type UnimplementedSimpleServiceServer struct { -} - -func (UnimplementedSimpleServiceServer) RepoAccessorUnary(context.Context, *RepoRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method RepoAccessorUnary not implemented") -} -func (UnimplementedSimpleServiceServer) RepoMutatorUnary(context.Context, *RepoRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method RepoMutatorUnary not implemented") -} -func (UnimplementedSimpleServiceServer) RepoMaintenanceUnary(context.Context, *RepoRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method RepoMaintenanceUnary not implemented") -} -func (UnimplementedSimpleServiceServer) mustEmbedUnimplementedSimpleServiceServer() {} - -// UnsafeSimpleServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to SimpleServiceServer will -// result in compilation errors. -type UnsafeSimpleServiceServer interface { - mustEmbedUnimplementedSimpleServiceServer() -} - -func RegisterSimpleServiceServer(s grpc.ServiceRegistrar, srv SimpleServiceServer) { - s.RegisterService(&SimpleService_ServiceDesc, srv) -} - -func _SimpleService_RepoAccessorUnary_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RepoRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SimpleServiceServer).RepoAccessorUnary(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/mock.SimpleService/RepoAccessorUnary", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SimpleServiceServer).RepoAccessorUnary(ctx, req.(*RepoRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _SimpleService_RepoMutatorUnary_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RepoRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SimpleServiceServer).RepoMutatorUnary(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/mock.SimpleService/RepoMutatorUnary", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SimpleServiceServer).RepoMutatorUnary(ctx, req.(*RepoRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _SimpleService_RepoMaintenanceUnary_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RepoRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SimpleServiceServer).RepoMaintenanceUnary(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/mock.SimpleService/RepoMaintenanceUnary", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SimpleServiceServer).RepoMaintenanceUnary(ctx, req.(*RepoRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// SimpleService_ServiceDesc is the grpc.ServiceDesc for SimpleService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var SimpleService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "mock.SimpleService", - HandlerType: (*SimpleServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "RepoAccessorUnary", - Handler: _SimpleService_RepoAccessorUnary_Handler, - }, - { - MethodName: "RepoMutatorUnary", - Handler: _SimpleService_RepoMutatorUnary_Handler, - }, - { - MethodName: "RepoMaintenanceUnary", - Handler: _SimpleService_RepoMaintenanceUnary_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "praefect/mock/mock.proto", -} diff --git a/internal/praefect/mocksvc_test.go b/internal/praefect/mocksvc_test.go deleted file mode 100644 index de6caff2e..000000000 --- a/internal/praefect/mocksvc_test.go +++ /dev/null @@ -1,33 +0,0 @@ -//go:build !gitaly_test_sha256 - -package praefect - -import ( - "context" - - "gitlab.com/gitlab-org/gitaly/v15/internal/praefect/mock" - "google.golang.org/protobuf/types/known/emptypb" -) - -type ( - repoAccessorUnaryFunc func(context.Context, *mock.RepoRequest) (*emptypb.Empty, error) - repoMutatorUnaryFunc func(context.Context, *mock.RepoRequest) (*emptypb.Empty, error) -) - -// mockSvc is an implementation of mock.SimpleServer for testing purposes. The -// gRPC stub can be updated by running `make proto`. -type mockSvc struct { - mock.UnimplementedSimpleServiceServer - repoAccessorUnary repoAccessorUnaryFunc - repoMutatorUnary repoMutatorUnaryFunc -} - -// RepoAccessorUnary is implemented by a callback -func (m *mockSvc) RepoAccessorUnary(ctx context.Context, req *mock.RepoRequest) (*emptypb.Empty, error) { - return m.repoAccessorUnary(ctx, req) -} - -// RepoMutatorUnary is implemented by a callback -func (m *mockSvc) RepoMutatorUnary(ctx context.Context, req *mock.RepoRequest) (*emptypb.Empty, error) { - return m.repoMutatorUnary(ctx, req) -} |