Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <psteinhardt@gitlab.com>2022-07-26 09:55:01 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2022-07-27 06:53:01 +0300
commit7450270ce96450d1533fa8b1ba8ed356da2995e3 (patch)
tree8d2ba83a2858c7da3d5281c3d270498df292b276
parent4bdc5e2ec2f3127c3ca8eb40d93edb0cee55175f (diff)
proxy: Move `TestMain()` into test helper file
Move the `TestMain()` function into our test helper file and rename the file to `testhelper_test.go` like it is customary in our codebase.
-rw-r--r--internal/praefect/grpc-proxy/proxy/handler_ext_test.go4
-rw-r--r--internal/praefect/grpc-proxy/proxy/testhelper_test.go (renamed from internal/praefect/grpc-proxy/proxy/helper_test.go)5
2 files changed, 5 insertions, 4 deletions
diff --git a/internal/praefect/grpc-proxy/proxy/handler_ext_test.go b/internal/praefect/grpc-proxy/proxy/handler_ext_test.go
index 2610a6132..98dcd2ca7 100644
--- a/internal/praefect/grpc-proxy/proxy/handler_ext_test.go
+++ b/internal/praefect/grpc-proxy/proxy/handler_ext_test.go
@@ -48,10 +48,6 @@ const (
countListResponses = 20
)
-func TestMain(m *testing.M) {
- testhelper.Run(m)
-}
-
// asserting service is implemented on the server side and serves as a handler for stuff
type assertingService struct {
pb.UnimplementedTestServiceServer
diff --git a/internal/praefect/grpc-proxy/proxy/helper_test.go b/internal/praefect/grpc-proxy/proxy/testhelper_test.go
index d025c9c3a..850d9df10 100644
--- a/internal/praefect/grpc-proxy/proxy/helper_test.go
+++ b/internal/praefect/grpc-proxy/proxy/testhelper_test.go
@@ -10,10 +10,15 @@ import (
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitaly/v15/internal/praefect/grpc-proxy/proxy"
testservice "gitlab.com/gitlab-org/gitaly/v15/internal/praefect/grpc-proxy/testdata"
+ "gitlab.com/gitlab-org/gitaly/v15/internal/testhelper"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
)
+func TestMain(m *testing.M) {
+ testhelper.Run(m)
+}
+
func newListener(tb testing.TB) net.Listener {
listener, err := net.Listen("tcp", "127.0.0.1:0")
require.NoError(tb, err, "must be able to allocate a port for listener")