diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2023-01-20 12:48:34 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2023-01-30 17:11:03 +0300 |
commit | c697318a0c0f6e6358df1484ea071c1a33da829b (patch) | |
tree | 0b7ae593ce8b13b1858cb866ce2d4fdb83a70044 | |
parent | 7853a878b74e44fee0475d3bee302cb53321938e (diff) |
smarthttp: Convert InfoRefs tests to use unseeded repositories
Convert the InfoRefs tests to use unseeded repositories.
-rw-r--r-- | internal/gitaly/service/smarthttp/inforefs_test.go | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/internal/gitaly/service/smarthttp/inforefs_test.go b/internal/gitaly/service/smarthttp/inforefs_test.go index 8d6301f4c..6615bb6b5 100644 --- a/internal/gitaly/service/smarthttp/inforefs_test.go +++ b/internal/gitaly/service/smarthttp/inforefs_test.go @@ -170,19 +170,15 @@ func TestInfoRefsUploadPack_partialClone(t *testing.T) { t.Parallel() cfg := testcfg.Build(t) - cfg.SocketPath = runSmartHTTPServer(t, cfg) ctx := testhelper.Context(t) - repo, _ := gittest.CreateRepository(t, ctx, cfg, gittest.CreateRepositoryConfig{ - Seed: gittest.SeedGitLabTest, - }) + repo, repoPath := gittest.CreateRepository(t, ctx, cfg) + gittest.WriteCommit(t, cfg, repoPath, gittest.WithBranch("main")) - request := &gitalypb.InfoRefsRequest{ + partialResponse, err := makeInfoRefsUploadPackRequest(t, ctx, cfg.SocketPath, cfg.Auth.Token, &gitalypb.InfoRefsRequest{ Repository: repo, - } - - partialResponse, err := makeInfoRefsUploadPackRequest(t, ctx, cfg.SocketPath, cfg.Auth.Token, request) + }) require.NoError(t, err) partialRefs := stats.ReferenceDiscovery{} err = partialRefs.Parse(bytes.NewReader(partialResponse)) @@ -230,19 +226,15 @@ func TestInfoRefsUploadPack_gitProtocol(t *testing.T) { }) cfg.SocketPath = server.Address() - repo, _ := gittest.CreateRepository(t, ctx, cfg, gittest.CreateRepositoryConfig{ - Seed: gittest.SeedGitLabTest, - }) - - rpcRequest := &gitalypb.InfoRefsRequest{ - Repository: repo, - GitProtocol: git.ProtocolV2, - } + repo, _ := gittest.CreateRepository(t, ctx, cfg) client, conn := newSmartHTTPClient(t, server.Address(), cfg.Auth.Token) defer testhelper.MustClose(t, conn) - c, err := client.InfoRefsUploadPack(ctx, rpcRequest) + c, err := client.InfoRefsUploadPack(ctx, &gitalypb.InfoRefsRequest{ + Repository: repo, + GitProtocol: git.ProtocolV2, + }) require.NoError(t, err) for { @@ -310,10 +302,10 @@ func TestInfoRefsReceivePack_hiddenRefs(t *testing.T) { cfg.SocketPath = runSmartHTTPServer(t, cfg) ctx := testhelper.Context(t) - repoProto, _ := gittest.CreateRepository(t, ctx, cfg, gittest.CreateRepositoryConfig{ - Seed: gittest.SeedGitLabTest, - }) + repoProto, repoPath := gittest.CreateRepository(t, ctx, cfg) repo := localrepo.NewTestRepo(t, cfg, repoProto) + gittest.WriteCommit(t, cfg, repoPath, gittest.WithBranch("main")) + txManager := transaction.NewManager(cfg, backchannel.NewRegistry()) pool, err := objectpool.Create( |