Skip to content

Commit

Permalink
Use external gRPC test server implementation (#59)
Browse files Browse the repository at this point in the history
Signed-off-by: Igor Shishkin <me@teran.dev>
  • Loading branch information
teran authored Jul 15, 2024
1 parent 5235563 commit 6d00538
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 71 deletions.
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ require (
github.com/sirupsen/logrus v1.9.3
github.com/stretchr/testify v1.9.0
github.com/teran/go-docker-testsuite v0.0.6
github.com/teran/go-grpctest v0.0.6
github.com/teran/go-ptr v1.1.0
github.com/teran/go-time v0.0.2
golang.org/x/sync v0.7.0
google.golang.org/grpc v1.65.0
google.golang.org/protobuf v1.34.2
)

require (
Expand Down Expand Up @@ -87,6 +89,5 @@ require (
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,8 @@ github.com/teran/echo-grpc-server v0.0.0-20240512211903-7c0d3d091c93 h1:kiYDPhhM
github.com/teran/echo-grpc-server v0.0.0-20240512211903-7c0d3d091c93/go.mod h1:ffluio+EtHNzo+6Pd4d0FnEXHnkMZhOTOiWS0FkpbzA=
github.com/teran/go-docker-testsuite v0.0.6 h1:itW2lpW2tzLMgFBbHDGGCfop+eCy7Lroq/PTq1j5iNs=
github.com/teran/go-docker-testsuite v0.0.6/go.mod h1:KO9qMSZPAXkaceW10dAmDBL04bWSItnn0f9p16p/YzE=
github.com/teran/go-grpctest v0.0.6 h1:q34p64c8icQq5TFgLsDa9VM8BThhesN43XTS8PJAh38=
github.com/teran/go-grpctest v0.0.6/go.mod h1:rNcMrEhPlNH7DFpQbcyl2vFzvfrx4UsxGuf3i/W77d0=
github.com/teran/go-ptr v1.1.0 h1:c/5SPr+FB4zfmmKVB+KTCNKpgC/zWKBY5JHReL84lKU=
github.com/teran/go-ptr v1.1.0/go.mod h1:2gyUP12bjbvBfyXm/NflOYJHONy415pNVeSTOZHna+A=
github.com/teran/go-random v0.0.1 h1:WQ3cF7UUQb/Q0oGAKcYeLeUIcMzD4vSs18oU1pkU/Mo=
Expand Down
5 changes: 3 additions & 2 deletions presenter/manager/grpc/handlers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"time"

"github.com/stretchr/testify/suite"
grpctest "github.com/teran/go-grpctest"

v1pb "github.com/teran/archived/presenter/manager/grpc/proto/v1"
"github.com/teran/archived/service"
Expand Down Expand Up @@ -87,15 +88,15 @@ type manageHandlersTestSuite struct {

svcMock *service.Mock
handlers ManageServerInterface
srv testServer
srv grpctest.Server

client v1pb.ManageServiceClient
}

func (s *manageHandlersTestSuite) SetupTest() {
s.svcMock = service.NewMock()
s.handlers = New(s.svcMock)
s.srv = newTestServer()
s.srv = grpctest.New()
s.handlers.Register(s.srv.Server())

err := s.srv.Run()
Expand Down
68 changes: 0 additions & 68 deletions presenter/manager/grpc/testserver.go

This file was deleted.

0 comments on commit 6d00538

Please sign in to comment.