diff options
Diffstat (limited to 'internal/service/ref/testhelper_test.go')
-rw-r--r-- | internal/service/ref/testhelper_test.go | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/internal/service/ref/testhelper_test.go b/internal/service/ref/testhelper_test.go index 2faeb3d0e..0dd3b9018 100644 --- a/internal/service/ref/testhelper_test.go +++ b/internal/service/ref/testhelper_test.go @@ -2,7 +2,6 @@ package ref import ( "bytes" - "net" "os" "testing" @@ -92,21 +91,15 @@ func testMain(m *testing.M) int { return m.Run() } -func runRefServiceServer(t *testing.T) (*grpc.Server, string) { - serverSocketPath := testhelper.GetTemporaryGitalySocketFileName() - grpcServer := testhelper.NewTestGrpcServer(t, nil, nil) +func runRefServiceServer(t *testing.T) (func(), string) { + srv := testhelper.NewServer(t, nil, nil) - listener, err := net.Listen("unix", serverSocketPath) - if err != nil { - t.Fatal(err) - } - - gitalypb.RegisterRefServiceServer(grpcServer, &server{}) - reflection.Register(grpcServer) + gitalypb.RegisterRefServiceServer(srv.GrpcServer(), &server{}) + reflection.Register(srv.GrpcServer()) - go grpcServer.Serve(listener) + require.NoError(t, srv.Start()) - return grpcServer, "unix://" + serverSocketPath + return srv.Stop, "unix://" + srv.Socket() } func newRefServiceClient(t *testing.T, serverSocketPath string) (gitalypb.RefServiceClient, *grpc.ClientConn) { |