diff --git a/.github/workflows/integration-blog.yml b/.github/workflows/integration-blog.yml index 493929e..94f5fab 100644 --- a/.github/workflows/integration-blog.yml +++ b/.github/workflows/integration-blog.yml @@ -47,10 +47,10 @@ jobs: - name: Build container run: | - bash services/tests/image/test-docker.sh + bash services/test/image/test-docker.sh - name: Test Blog services - working-directory: services/tests + working-directory: services/test/integration run: | go clean -testcache && GOMAXPROCS=4 go test -timeout 15m --tags=blog -v ./... diff --git a/blob-store/README.md b/test/blob-store/README.md similarity index 100% rename from blob-store/README.md rename to test/blob-store/README.md diff --git a/blob-store/main.go b/test/blob-store/main.go similarity index 100% rename from blob-store/main.go rename to test/blob-store/main.go diff --git a/conf/README.md b/test/conf/README.md similarity index 100% rename from conf/README.md rename to test/conf/README.md diff --git a/conf/main.go b/test/conf/main.go similarity index 100% rename from conf/main.go rename to test/conf/main.go diff --git a/events/README.md b/test/events/README.md similarity index 100% rename from events/README.md rename to test/events/README.md diff --git a/events/main.go b/test/events/main.go similarity index 100% rename from events/main.go rename to test/events/main.go diff --git a/tests/image/.dockerignore b/test/image/.dockerignore similarity index 100% rename from tests/image/.dockerignore rename to test/image/.dockerignore diff --git a/tests/image/Dockerfile b/test/image/Dockerfile similarity index 95% rename from tests/image/Dockerfile rename to test/image/Dockerfile index ad91e5c..5dadca9 100644 --- a/tests/image/Dockerfile +++ b/test/image/Dockerfile @@ -20,7 +20,7 @@ RUN apk add --update ca-certificates openssl tar && \ rm -Rf etcd-v3.4.7-linux-amd64* /var/cache/apk/* VOLUME /data EXPOSE 2379 2380 4001 7001 -ADD services/tests/image/run-etcd.sh /bin/run.sh +ADD services/test/image/run-etcd.sh /bin/run.sh # Speeding up tests by predownloading and building dependencies for services used. RUN mkdir services diff --git a/tests/image/run-etcd.sh b/test/image/run-etcd.sh similarity index 100% rename from tests/image/run-etcd.sh rename to test/image/run-etcd.sh diff --git a/test/image/test-docker.sh b/test/image/test-docker.sh new file mode 100755 index 0000000..ec52736 --- /dev/null +++ b/test/image/test-docker.sh @@ -0,0 +1,5 @@ +cp services/test/image/.dockerignore . +pushd micro +GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build +popd +DOCKER_BUILDKIT=1 docker build -t micro -f test/image/Dockerfile . diff --git a/tests/integration/README.md b/test/integration/README.md similarity index 100% rename from tests/integration/README.md rename to test/integration/README.md diff --git a/tests/integration/blog/blog_test.go b/test/integration/blog/blog_test.go similarity index 100% rename from tests/integration/blog/blog_test.go rename to test/integration/blog/blog_test.go diff --git a/kv/README.md b/test/kv/README.md similarity index 100% rename from kv/README.md rename to test/kv/README.md diff --git a/kv/handler/handler.go b/test/kv/handler/handler.go similarity index 98% rename from kv/handler/handler.go rename to test/kv/handler/handler.go index 7a99894..4d6f697 100644 --- a/kv/handler/handler.go +++ b/test/kv/handler/handler.go @@ -8,7 +8,7 @@ import ( log "github.com/micro/go-micro/v3/logger" store "github.com/micro/micro/v3/service/store" - pb "github.com/micro/services/kv/proto" + pb "github.com/micro/services/test/kv/proto" ) type Example struct{} diff --git a/kv/main.go b/test/kv/main.go similarity index 79% rename from kv/main.go rename to test/kv/main.go index 358dd3c..167e3e2 100644 --- a/kv/main.go +++ b/test/kv/main.go @@ -1,7 +1,7 @@ package main import ( - "github.com/micro/services/kv/handler" + "github.com/micro/services/test/kv/handler" "github.com/micro/micro/v3/service" ) diff --git a/kv/proto/example.pb.go b/test/kv/proto/example.pb.go similarity index 100% rename from kv/proto/example.pb.go rename to test/kv/proto/example.pb.go diff --git a/kv/proto/example.pb.micro.go b/test/kv/proto/example.pb.micro.go similarity index 100% rename from kv/proto/example.pb.micro.go rename to test/kv/proto/example.pb.micro.go diff --git a/kv/proto/example.proto b/test/kv/proto/example.proto similarity index 100% rename from kv/proto/example.proto rename to test/kv/proto/example.proto diff --git a/logger/README.md b/test/logger/README.md similarity index 100% rename from logger/README.md rename to test/logger/README.md diff --git a/logger/main.go b/test/logger/main.go similarity index 100% rename from logger/main.go rename to test/logger/main.go diff --git a/pubsub/README.md b/test/pubsub/README.md similarity index 100% rename from pubsub/README.md rename to test/pubsub/README.md diff --git a/pubsub/main.go b/test/pubsub/main.go similarity index 94% rename from pubsub/main.go rename to test/pubsub/main.go index 745bf77..6da6b16 100644 --- a/pubsub/main.go +++ b/test/pubsub/main.go @@ -7,7 +7,7 @@ import ( "github.com/micro/micro/v3/service" "github.com/micro/micro/v3/service/logger" - pb "github.com/micro/services/pubsub/proto" + pb "github.com/micro/services/test/pubsub/proto" ) // Pub will publish messages every second diff --git a/pubsub/proto/pubsub.pb.go b/test/pubsub/proto/pubsub.pb.go similarity index 100% rename from pubsub/proto/pubsub.pb.go rename to test/pubsub/proto/pubsub.pb.go diff --git a/pubsub/proto/pubsub.pb.micro.go b/test/pubsub/proto/pubsub.pb.micro.go similarity index 100% rename from pubsub/proto/pubsub.pb.micro.go rename to test/pubsub/proto/pubsub.pb.micro.go diff --git a/pubsub/proto/pubsub.proto b/test/pubsub/proto/pubsub.proto similarity index 100% rename from pubsub/proto/pubsub.proto rename to test/pubsub/proto/pubsub.proto diff --git a/routes/README.md b/test/routes/README.md similarity index 100% rename from routes/README.md rename to test/routes/README.md diff --git a/routes/proto/stream.pb.go b/test/routes/proto/stream.pb.go similarity index 100% rename from routes/proto/stream.pb.go rename to test/routes/proto/stream.pb.go diff --git a/routes/proto/stream.pb.micro.go b/test/routes/proto/stream.pb.micro.go similarity index 100% rename from routes/proto/stream.pb.micro.go rename to test/routes/proto/stream.pb.micro.go diff --git a/routes/proto/stream.proto b/test/routes/proto/stream.proto similarity index 100% rename from routes/proto/stream.proto rename to test/routes/proto/stream.proto diff --git a/routes/routes-client/main.go b/test/routes/routes-client/main.go similarity index 98% rename from routes/routes-client/main.go rename to test/routes/routes-client/main.go index e1fc06b..d892c81 100644 --- a/routes/routes-client/main.go +++ b/test/routes/routes-client/main.go @@ -8,7 +8,7 @@ import ( "github.com/micro/micro/v3/service" "github.com/micro/micro/v3/service/logger" - pb "github.com/micro/services/routes/proto" + pb "github.com/micro/services/test/routes/proto" ) func main() { diff --git a/routes/routes-server/handler/handler.go b/test/routes/routes-server/handler/handler.go similarity index 98% rename from routes/routes-server/handler/handler.go rename to test/routes/routes-server/handler/handler.go index 6e02dfc..e6a0613 100644 --- a/routes/routes-server/handler/handler.go +++ b/test/routes/routes-server/handler/handler.go @@ -7,7 +7,7 @@ import ( "time" "github.com/golang/protobuf/proto" - pb "github.com/micro/services/routes/proto" + pb "github.com/micro/services/test/routes/proto" ) // RouteGuide implements the route guide handler interface diff --git a/routes/routes-server/handler/util.go b/test/routes/routes-server/handler/util.go similarity index 96% rename from routes/routes-server/handler/util.go rename to test/routes/routes-server/handler/util.go index 1e8e681..47b3274 100644 --- a/routes/routes-server/handler/util.go +++ b/test/routes/routes-server/handler/util.go @@ -4,7 +4,7 @@ import ( "fmt" "math" - pb "github.com/micro/services/routes/proto" + pb "github.com/micro/services/test/routes/proto" ) func toRadians(num float64) float64 { diff --git a/routes/routes-server/main.go b/test/routes/routes-server/main.go similarity index 99% rename from routes/routes-server/main.go rename to test/routes/routes-server/main.go index 030d821..f8dfabd 100644 --- a/routes/routes-server/main.go +++ b/test/routes/routes-server/main.go @@ -7,8 +7,8 @@ import ( "github.com/micro/micro/v3/service" "github.com/micro/micro/v3/service/logger" - pb "github.com/micro/services/routes/proto" - "github.com/micro/services/routes/routes-server/handler" + pb "github.com/micro/services/test/routes/proto" + "github.com/micro/services/test/routes/routes-server/handler" ) func main() { diff --git a/template/.gitignore b/test/template/.gitignore similarity index 100% rename from template/.gitignore rename to test/template/.gitignore diff --git a/template/Dockerfile b/test/template/Dockerfile similarity index 100% rename from template/Dockerfile rename to test/template/Dockerfile diff --git a/template/Makefile b/test/template/Makefile similarity index 100% rename from template/Makefile rename to test/template/Makefile diff --git a/template/README.md b/test/template/README.md similarity index 100% rename from template/README.md rename to test/template/README.md diff --git a/template/cmd/template/main.go b/test/template/cmd/template/main.go similarity index 87% rename from template/cmd/template/main.go rename to test/template/cmd/template/main.go index 3948e07..a23ef7f 100644 --- a/template/cmd/template/main.go +++ b/test/template/cmd/template/main.go @@ -1,7 +1,7 @@ package main import ( - "github.com/micro/services/template/handler" + "github.com/micro/services/test/template/handler" "github.com/micro/micro/v3/service" "github.com/micro/micro/v3/service/logger" diff --git a/template/generate.go b/test/template/generate.go similarity index 100% rename from template/generate.go rename to test/template/generate.go diff --git a/template/handler/idiomatic.go b/test/template/handler/idiomatic.go similarity index 95% rename from template/handler/idiomatic.go rename to test/template/handler/idiomatic.go index 4b2be89..3ba96bd 100644 --- a/template/handler/idiomatic.go +++ b/test/template/handler/idiomatic.go @@ -5,7 +5,7 @@ import ( log "github.com/micro/micro/v3/service/logger" - idiomatic "github.com/micro/services/template/proto" + idiomatic "github.com/micro/services/test/template/proto" ) type Idiomatic struct{} diff --git a/template/proto/idiomatic.pb.go b/test/template/proto/idiomatic.pb.go similarity index 100% rename from template/proto/idiomatic.pb.go rename to test/template/proto/idiomatic.pb.go diff --git a/template/proto/idiomatic.pb.micro.go b/test/template/proto/idiomatic.pb.micro.go similarity index 100% rename from template/proto/idiomatic.pb.micro.go rename to test/template/proto/idiomatic.pb.micro.go diff --git a/template/proto/idiomatic.proto b/test/template/proto/idiomatic.proto similarity index 100% rename from template/proto/idiomatic.proto rename to test/template/proto/idiomatic.proto diff --git a/tests/README.md b/tests/README.md deleted file mode 100644 index ec051b9..0000000 --- a/tests/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# Tests Service - -The tests service is for end to end testing - -## Overview - -This is a future service for end to end testing which either comes pre-built with integration tests in the -integration sub directory or with tests which are register via an endpoint Tests.Register for a callback -which then conforms to our testing API. - - diff --git a/tests/handler/handler.go b/tests/handler/handler.go deleted file mode 100644 index 8932073..0000000 --- a/tests/handler/handler.go +++ /dev/null @@ -1,14 +0,0 @@ -package handler - -import ( - "context" - - pb "github.com/m3o/services/tests/proto" -) - -type Tests struct{} - -func (t *Tests) Register(ctx context.Context, req *pb.RegisterRequest, rsp *pb.RegisterResponse) error { - // TODO register the test to be run periodically - return nil -} diff --git a/tests/image/test-docker.sh b/tests/image/test-docker.sh deleted file mode 100755 index ecb83a9..0000000 --- a/tests/image/test-docker.sh +++ /dev/null @@ -1,5 +0,0 @@ -cp services/tests/image/.dockerignore . -pushd micro -GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -popd -DOCKER_BUILDKIT=1 docker build -t micro -f services/tests/image/Dockerfile . diff --git a/tests/main.go b/tests/main.go deleted file mode 100644 index 76be2b0..0000000 --- a/tests/main.go +++ /dev/null @@ -1,19 +0,0 @@ -package main - -import ( - "github.com/m3o/services/tests/handler" - "github.com/micro/go-micro/v3/logger" - "github.com/micro/micro/v3/service" -) - -func main() { - service := service.New( - service.Name("tests"), - ) - - service.Handle(new(handler.Tests)) - - if err := service.Run(); err != nil { - logger.Fatal(err) - } -} diff --git a/tests/proto/tests.pb.go b/tests/proto/tests.pb.go deleted file mode 100644 index 3e82699..0000000 --- a/tests/proto/tests.pb.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: tests/proto/tests.proto - -package go_micro_service_tests - -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -type Test struct { - // name of the test - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // service to call back - Service string `protobuf:"bytes,2,opt,name=service,proto3" json:"service,omitempty"` - // endpoint to call back - Endpoint string `protobuf:"bytes,3,opt,name=endpoint,proto3" json:"endpoint,omitempty"` - // how often to run the test in seconds - Interval int64 `protobuf:"varint,4,opt,name=interval,proto3" json:"interval,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Test) Reset() { *m = Test{} } -func (m *Test) String() string { return proto.CompactTextString(m) } -func (*Test) ProtoMessage() {} -func (*Test) Descriptor() ([]byte, []int) { - return fileDescriptor_8daabec0b76982a6, []int{0} -} - -func (m *Test) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Test.Unmarshal(m, b) -} -func (m *Test) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Test.Marshal(b, m, deterministic) -} -func (m *Test) XXX_Merge(src proto.Message) { - xxx_messageInfo_Test.Merge(m, src) -} -func (m *Test) XXX_Size() int { - return xxx_messageInfo_Test.Size(m) -} -func (m *Test) XXX_DiscardUnknown() { - xxx_messageInfo_Test.DiscardUnknown(m) -} - -var xxx_messageInfo_Test proto.InternalMessageInfo - -func (m *Test) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *Test) GetService() string { - if m != nil { - return m.Service - } - return "" -} - -func (m *Test) GetEndpoint() string { - if m != nil { - return m.Endpoint - } - return "" -} - -func (m *Test) GetInterval() int64 { - if m != nil { - return m.Interval - } - return 0 -} - -type RegisterRequest struct { - Tests []*Test `protobuf:"bytes,1,rep,name=tests,proto3" json:"tests,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RegisterRequest) Reset() { *m = RegisterRequest{} } -func (m *RegisterRequest) String() string { return proto.CompactTextString(m) } -func (*RegisterRequest) ProtoMessage() {} -func (*RegisterRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8daabec0b76982a6, []int{1} -} - -func (m *RegisterRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RegisterRequest.Unmarshal(m, b) -} -func (m *RegisterRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RegisterRequest.Marshal(b, m, deterministic) -} -func (m *RegisterRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_RegisterRequest.Merge(m, src) -} -func (m *RegisterRequest) XXX_Size() int { - return xxx_messageInfo_RegisterRequest.Size(m) -} -func (m *RegisterRequest) XXX_DiscardUnknown() { - xxx_messageInfo_RegisterRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_RegisterRequest proto.InternalMessageInfo - -func (m *RegisterRequest) GetTests() []*Test { - if m != nil { - return m.Tests - } - return nil -} - -type RegisterResponse struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RegisterResponse) Reset() { *m = RegisterResponse{} } -func (m *RegisterResponse) String() string { return proto.CompactTextString(m) } -func (*RegisterResponse) ProtoMessage() {} -func (*RegisterResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8daabec0b76982a6, []int{2} -} - -func (m *RegisterResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RegisterResponse.Unmarshal(m, b) -} -func (m *RegisterResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RegisterResponse.Marshal(b, m, deterministic) -} -func (m *RegisterResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_RegisterResponse.Merge(m, src) -} -func (m *RegisterResponse) XXX_Size() int { - return xxx_messageInfo_RegisterResponse.Size(m) -} -func (m *RegisterResponse) XXX_DiscardUnknown() { - xxx_messageInfo_RegisterResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_RegisterResponse proto.InternalMessageInfo - -func init() { - proto.RegisterType((*Test)(nil), "go.micro.service.tests.Test") - proto.RegisterType((*RegisterRequest)(nil), "go.micro.service.tests.RegisterRequest") - proto.RegisterType((*RegisterResponse)(nil), "go.micro.service.tests.RegisterResponse") -} - -func init() { proto.RegisterFile("tests/proto/tests.proto", fileDescriptor_8daabec0b76982a6) } - -var fileDescriptor_8daabec0b76982a6 = []byte{ - // 217 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x90, 0x41, 0x4b, 0x03, 0x31, - 0x10, 0x85, 0x8d, 0xbb, 0xd5, 0x3a, 0x1e, 0x94, 0x39, 0x68, 0x28, 0x1e, 0x96, 0x5c, 0xcc, 0x29, - 0x85, 0xf5, 0x37, 0xf8, 0x07, 0x82, 0x77, 0xa9, 0x75, 0xa8, 0x81, 0x36, 0x59, 0x33, 0xb1, 0xbf, - 0x5f, 0x32, 0xeb, 0xae, 0x20, 0x8a, 0xb7, 0xf7, 0xf2, 0x1e, 0xf3, 0x3e, 0x02, 0xb7, 0x85, 0xb8, - 0xf0, 0x7a, 0xc8, 0xa9, 0xa4, 0xb5, 0x68, 0x27, 0x1a, 0x6f, 0x76, 0xc9, 0x1d, 0xc2, 0x36, 0x27, - 0xc7, 0x94, 0x8f, 0x61, 0x4b, 0x4e, 0x52, 0xb3, 0x87, 0xf6, 0x89, 0xb8, 0x20, 0x42, 0x1b, 0x37, - 0x07, 0xd2, 0xaa, 0x53, 0xf6, 0xc2, 0x8b, 0x46, 0x0d, 0xe7, 0x5f, 0x65, 0x7d, 0x2a, 0xcf, 0x93, - 0xc5, 0x15, 0x2c, 0x29, 0xbe, 0x0e, 0x29, 0xc4, 0xa2, 0x1b, 0x89, 0x66, 0x5f, 0xb3, 0x10, 0x0b, - 0xe5, 0xe3, 0x66, 0xaf, 0xdb, 0x4e, 0xd9, 0xc6, 0xcf, 0xde, 0x3c, 0xc2, 0x95, 0xa7, 0x5d, 0xe0, - 0x42, 0xd9, 0xd3, 0xfb, 0x47, 0x1d, 0xee, 0x61, 0x21, 0x24, 0x5a, 0x75, 0x8d, 0xbd, 0xec, 0xef, - 0xdc, 0xef, 0xa0, 0xae, 0x52, 0xfa, 0xb1, 0x6a, 0x10, 0xae, 0xbf, 0xcf, 0xf0, 0x90, 0x22, 0x53, - 0xff, 0x06, 0x8b, 0x5a, 0x61, 0x7c, 0x86, 0xe5, 0x14, 0xe2, 0xfd, 0x5f, 0xd7, 0x7e, 0x50, 0xac, - 0xec, 0xff, 0xc5, 0x71, 0xc7, 0x9c, 0xbc, 0x9c, 0xc9, 0x8f, 0x3e, 0x7c, 0x06, 0x00, 0x00, 0xff, - 0xff, 0x2d, 0xa4, 0xe4, 0x69, 0x6c, 0x01, 0x00, 0x00, -} diff --git a/tests/proto/tests.pb.micro.go b/tests/proto/tests.pb.micro.go deleted file mode 100644 index 87107a4..0000000 --- a/tests/proto/tests.pb.micro.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by protoc-gen-micro. DO NOT EDIT. -// source: tests/proto/tests.proto - -package go_micro_service_tests - -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - math "math" -) - -import ( - context "context" - api "github.com/micro/go-micro/v3/api" - client "github.com/micro/go-micro/v3/client" - server "github.com/micro/go-micro/v3/server" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -// Reference imports to suppress errors if they are not otherwise used. -var _ api.Endpoint -var _ context.Context -var _ client.Option -var _ server.Option - -// Api Endpoints for Tests service - -func NewTestsEndpoints() []*api.Endpoint { - return []*api.Endpoint{} -} - -// Client API for Tests service - -type TestsService interface { - // enables registering an endpoint for callback to run tests - Register(ctx context.Context, in *RegisterRequest, opts ...client.CallOption) (*RegisterResponse, error) -} - -type testsService struct { - c client.Client - name string -} - -func NewTestsService(name string, c client.Client) TestsService { - return &testsService{ - c: c, - name: name, - } -} - -func (c *testsService) Register(ctx context.Context, in *RegisterRequest, opts ...client.CallOption) (*RegisterResponse, error) { - req := c.c.NewRequest(c.name, "Tests.Register", in) - out := new(RegisterResponse) - err := c.c.Call(ctx, req, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// Server API for Tests service - -type TestsHandler interface { - // enables registering an endpoint for callback to run tests - Register(context.Context, *RegisterRequest, *RegisterResponse) error -} - -func RegisterTestsHandler(s server.Server, hdlr TestsHandler, opts ...server.HandlerOption) error { - type tests interface { - Register(ctx context.Context, in *RegisterRequest, out *RegisterResponse) error - } - type Tests struct { - tests - } - h := &testsHandler{hdlr} - return s.Handle(s.NewHandler(&Tests{h}, opts...)) -} - -type testsHandler struct { - TestsHandler -} - -func (h *testsHandler) Register(ctx context.Context, in *RegisterRequest, out *RegisterResponse) error { - return h.TestsHandler.Register(ctx, in, out) -} diff --git a/tests/proto/tests.proto b/tests/proto/tests.proto deleted file mode 100644 index 4370703..0000000 --- a/tests/proto/tests.proto +++ /dev/null @@ -1,26 +0,0 @@ -syntax = "proto3"; - -package go.micro.service.tests; - -service Tests { - // enables registering an endpoint for callback to run tests - rpc Register(RegisterRequest) returns (RegisterResponse) {}; -} - -message Test { - // name of the test - string name = 1; - // service to call back - string service = 2; - // endpoint to call back - string endpoint = 3; - // how often to run the test in seconds - int64 interval = 4; - // TODO: data to include in the callback -} - -message RegisterRequest { - repeated Test tests = 1; -} - -message RegisterResponse {}