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>2023-02-08 15:37:15 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2023-02-16 10:48:02 +0300
commit65e9dbc954daf4c4e44a9eb925b48adac9978668 (patch)
treebd7e01fa473cc3a92b1fa14af00cf87bb6aa1bcc
parentb345e387f859617a93cff19ab4119d839471f923 (diff)
remote: Remove helper to setup server with seeded repository
All tests for the remote service server start from an empty repository that gets seeded at runtime. Remove the unneeded helper function to set up the remote service server with a seeded repository.
-rw-r--r--internal/gitaly/service/remote/find_remote_repository_test.go2
-rw-r--r--internal/gitaly/service/remote/find_remote_root_ref_test.go2
-rw-r--r--internal/gitaly/service/remote/testhelper_test.go15
-rw-r--r--internal/gitaly/service/remote/update_remote_mirror_test.go2
4 files changed, 4 insertions, 17 deletions
diff --git a/internal/gitaly/service/remote/find_remote_repository_test.go b/internal/gitaly/service/remote/find_remote_repository_test.go
index 3488522fb..4ac5bc254 100644
--- a/internal/gitaly/service/remote/find_remote_repository_test.go
+++ b/internal/gitaly/service/remote/find_remote_repository_test.go
@@ -19,7 +19,7 @@ func TestFindRemoteRepository(t *testing.T) {
t.Parallel()
ctx := testhelper.Context(t)
- cfg, _, _, client := setupRemoteService(t, ctx)
+ cfg, client := setupRemoteService(t, ctx)
gitCmdFactory := gittest.NewCommandFactory(t, cfg)
type setupData struct {
diff --git a/internal/gitaly/service/remote/find_remote_root_ref_test.go b/internal/gitaly/service/remote/find_remote_root_ref_test.go
index cd61d48f0..03faf1c36 100644
--- a/internal/gitaly/service/remote/find_remote_root_ref_test.go
+++ b/internal/gitaly/service/remote/find_remote_root_ref_test.go
@@ -22,7 +22,7 @@ func TestFindRemoteRootRef(t *testing.T) {
t.Parallel()
ctx := testhelper.Context(t)
- cfg, _, _, client := setupRemoteService(t, ctx)
+ cfg, client := setupRemoteService(t, ctx)
gitCmdFactory := gittest.NewCommandFactory(t, cfg)
// Even though FindRemoteRootRef does theoretically not require a local repository it is
diff --git a/internal/gitaly/service/remote/testhelper_test.go b/internal/gitaly/service/remote/testhelper_test.go
index 3172d9984..8a3a0d93b 100644
--- a/internal/gitaly/service/remote/testhelper_test.go
+++ b/internal/gitaly/service/remote/testhelper_test.go
@@ -6,7 +6,6 @@ import (
"context"
"testing"
- "gitlab.com/gitlab-org/gitaly/v15/internal/git/gittest"
"gitlab.com/gitlab-org/gitaly/v15/internal/gitaly/config"
"gitlab.com/gitlab-org/gitaly/v15/internal/gitaly/service"
"gitlab.com/gitlab-org/gitaly/v15/internal/gitaly/service/repository"
@@ -22,7 +21,7 @@ func TestMain(m *testing.M) {
testhelper.Run(m)
}
-func setupRemoteServiceWithoutRepo(t *testing.T, ctx context.Context, opts ...testserver.GitalyServerOpt) (config.Cfg, gitalypb.RemoteServiceClient) {
+func setupRemoteService(t *testing.T, ctx context.Context, opts ...testserver.GitalyServerOpt) (config.Cfg, gitalypb.RemoteServiceClient) {
t.Helper()
cfg := testcfg.Build(t)
@@ -55,18 +54,6 @@ func setupRemoteServiceWithoutRepo(t *testing.T, ctx context.Context, opts ...te
return cfg, client
}
-func setupRemoteService(t *testing.T, ctx context.Context, opts ...testserver.GitalyServerOpt) (config.Cfg, *gitalypb.Repository, string, gitalypb.RemoteServiceClient) {
- t.Helper()
-
- cfg, client := setupRemoteServiceWithoutRepo(t, ctx, opts...)
-
- repo, repoPath := gittest.CreateRepository(t, ctx, cfg, gittest.CreateRepositoryConfig{
- Seed: gittest.SeedGitLabTest,
- })
-
- return cfg, repo, repoPath, client
-}
-
func newRemoteClient(t *testing.T, serverSocketPath string) (gitalypb.RemoteServiceClient, *grpc.ClientConn) {
t.Helper()
diff --git a/internal/gitaly/service/remote/update_remote_mirror_test.go b/internal/gitaly/service/remote/update_remote_mirror_test.go
index 39b9ca09e..23b652c1a 100644
--- a/internal/gitaly/service/remote/update_remote_mirror_test.go
+++ b/internal/gitaly/service/remote/update_remote_mirror_test.go
@@ -721,7 +721,7 @@ func TestUpdateRemoteMirror_Validations(t *testing.T) {
t.Parallel()
ctx := testhelper.Context(t)
- cfg, client := setupRemoteServiceWithoutRepo(t, ctx)
+ cfg, client := setupRemoteService(t, ctx)
testCases := []struct {
expectedErr error