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:
authorSami Hiltunen <shiltunen@gitlab.com>2020-10-14 19:23:57 +0300
committerSami Hiltunen <shiltunen@gitlab.com>2020-10-14 19:23:57 +0300
commit4e9663a71ccb3096a69dcfe17957fecdf5558c44 (patch)
treeb11bd64cb9233becd9c837740e3f208be0e0c054
parent7ce0c14391a481226c37fda5d3a753734e825b27 (diff)
parent59adb4afd40f5799f25eaea5edb55aedc0852e62 (diff)
Merge branch 'ps-wiki-uses-locator' into 'master'
Introduce Locator abstraction to wiki service See merge request gitlab-org/gitaly!2646
-rw-r--r--internal/gitaly/service/register.go2
-rw-r--r--internal/gitaly/service/wiki/delete_page_test.go7
-rw-r--r--internal/gitaly/service/wiki/find_file_test.go7
-rw-r--r--internal/gitaly/service/wiki/find_page_test.go33
-rw-r--r--internal/gitaly/service/wiki/get_all_pages_test.go23
-rw-r--r--internal/gitaly/service/wiki/get_page_versions_test.go7
-rw-r--r--internal/gitaly/service/wiki/list_pages_test.go11
-rw-r--r--internal/gitaly/service/wiki/server.go8
-rw-r--r--internal/gitaly/service/wiki/testhelper_test.go10
-rw-r--r--internal/gitaly/service/wiki/update_page_test.go7
-rw-r--r--internal/gitaly/service/wiki/write_page_test.go13
11 files changed, 80 insertions, 48 deletions
diff --git a/internal/gitaly/service/register.go b/internal/gitaly/service/register.go
index c8bab2613..70821d380 100644
--- a/internal/gitaly/service/register.go
+++ b/internal/gitaly/service/register.go
@@ -83,7 +83,7 @@ func RegisterAll(grpcServer *grpc.Server, cfg config.Cfg, rubyServer *rubyserver
gitalypb.RegisterSmartHTTPServiceServer(grpcServer, smarthttp.NewServer(
smarthttp.WithPackfileNegotiationMetrics(smarthttpPackfileNegotiationMetrics),
))
- gitalypb.RegisterWikiServiceServer(grpcServer, wiki.NewServer(rubyServer))
+ gitalypb.RegisterWikiServiceServer(grpcServer, wiki.NewServer(rubyServer, locator))
gitalypb.RegisterConflictsServiceServer(grpcServer, conflicts.NewServer(rubyServer))
gitalypb.RegisterRemoteServiceServer(grpcServer, remote.NewServer(rubyServer, locator))
gitalypb.RegisterServerServiceServer(grpcServer, server.NewServer(cfg.Storages))
diff --git a/internal/gitaly/service/wiki/delete_page_test.go b/internal/gitaly/service/wiki/delete_page_test.go
index 428ba4b7d..084812daf 100644
--- a/internal/gitaly/service/wiki/delete_page_test.go
+++ b/internal/gitaly/service/wiki/delete_page_test.go
@@ -5,6 +5,7 @@ import (
"github.com/stretchr/testify/require"
gitlog "gitlab.com/gitlab-org/gitaly/internal/git/log"
+ "gitlab.com/gitlab-org/gitaly/internal/gitaly/config"
"gitlab.com/gitlab-org/gitaly/internal/testhelper"
"gitlab.com/gitlab-org/gitaly/proto/go/gitalypb"
"google.golang.org/grpc/codes"
@@ -17,7 +18,8 @@ func TestSuccessfulWikiDeletePageRequest(t *testing.T) {
ctx, cancel := testhelper.Context()
defer cancel()
- stop, serverSocketPath := runWikiServiceServer(t)
+ locator := config.NewLocator(config.Config)
+ stop, serverSocketPath := runWikiServiceServer(t, locator)
defer stop()
client, conn := newWikiClient(t, serverSocketPath)
@@ -85,7 +87,8 @@ func TestFailedWikiDeletePageDueToValidations(t *testing.T) {
wikiRepo, _, cleanupFunc := setupWikiRepo(t)
defer cleanupFunc()
- stop, serverSocketPath := runWikiServiceServer(t)
+ locator := config.NewLocator(config.Config)
+ stop, serverSocketPath := runWikiServiceServer(t, locator)
defer stop()
client, conn := newWikiClient(t, serverSocketPath)
diff --git a/internal/gitaly/service/wiki/find_file_test.go b/internal/gitaly/service/wiki/find_file_test.go
index 73e7de7a9..b2d90c680 100644
--- a/internal/gitaly/service/wiki/find_file_test.go
+++ b/internal/gitaly/service/wiki/find_file_test.go
@@ -9,6 +9,7 @@ import (
"testing"
"github.com/stretchr/testify/require"
+ "gitlab.com/gitlab-org/gitaly/internal/gitaly/config"
"gitlab.com/gitlab-org/gitaly/internal/testhelper"
"gitlab.com/gitlab-org/gitaly/proto/go/gitalypb"
"google.golang.org/grpc/codes"
@@ -18,7 +19,8 @@ func TestSuccessfulWikiFindFileRequest(t *testing.T) {
_, wikiRepoPath, cleanupFunc := setupWikiRepo(t)
defer cleanupFunc()
- stop, serverSocketPath := runWikiServiceServer(t)
+ locator := config.NewLocator(config.Config)
+ stop, serverSocketPath := runWikiServiceServer(t, locator)
defer stop()
client, conn := newWikiClient(t, serverSocketPath)
@@ -156,7 +158,8 @@ func TestFailedWikiFindFileDueToValidation(t *testing.T) {
wikiRepo, _, cleanupFunc := setupWikiRepo(t)
defer cleanupFunc()
- stop, serverSocketPath := runWikiServiceServer(t)
+ locator := config.NewLocator(config.Config)
+ stop, serverSocketPath := runWikiServiceServer(t, locator)
defer stop()
client, conn := newWikiClient(t, serverSocketPath)
diff --git a/internal/gitaly/service/wiki/find_page_test.go b/internal/gitaly/service/wiki/find_page_test.go
index 1591ffb53..094377f9e 100644
--- a/internal/gitaly/service/wiki/find_page_test.go
+++ b/internal/gitaly/service/wiki/find_page_test.go
@@ -5,6 +5,7 @@ import (
"testing"
"github.com/stretchr/testify/require"
+ "gitlab.com/gitlab-org/gitaly/internal/gitaly/config"
"gitlab.com/gitlab-org/gitaly/internal/testhelper"
"gitlab.com/gitlab-org/gitaly/proto/go/gitalypb"
"google.golang.org/grpc/codes"
@@ -14,7 +15,8 @@ func TestSuccessfulWikiFindPageRequest(t *testing.T) {
wikiRepo, _, cleanupFunc := setupWikiRepo(t)
defer cleanupFunc()
- stop, serverSocketPath := runWikiServiceServer(t)
+ locator := config.NewLocator(config.Config)
+ stop, serverSocketPath := runWikiServiceServer(t, locator)
defer stop()
client, conn := newWikiClient(t, serverSocketPath)
@@ -29,14 +31,14 @@ func TestSuccessfulWikiFindPageRequest(t *testing.T) {
page7Name := "~Tilde in filename"
page8Name := "~!/Tilde with invalid user"
- page1Commit := createTestWikiPage(t, client, wikiRepo, createWikiPageOpts{title: page1Name})
- createTestWikiPage(t, client, wikiRepo, createWikiPageOpts{title: page2Name})
- createTestWikiPage(t, client, wikiRepo, createWikiPageOpts{title: page3Name})
- createTestWikiPage(t, client, wikiRepo, createWikiPageOpts{title: page4Name, content: []byte("f\xFCr")})
- createTestWikiPage(t, client, wikiRepo, createWikiPageOpts{title: page5Name, forceContentEmpty: true})
- createTestWikiPage(t, client, wikiRepo, createWikiPageOpts{title: page6Name})
- createTestWikiPage(t, client, wikiRepo, createWikiPageOpts{title: page7Name})
- page8Commit := createTestWikiPage(t, client, wikiRepo, createWikiPageOpts{title: page8Name})
+ page1Commit := createTestWikiPage(t, locator, client, wikiRepo, createWikiPageOpts{title: page1Name})
+ createTestWikiPage(t, locator, client, wikiRepo, createWikiPageOpts{title: page2Name})
+ createTestWikiPage(t, locator, client, wikiRepo, createWikiPageOpts{title: page3Name})
+ createTestWikiPage(t, locator, client, wikiRepo, createWikiPageOpts{title: page4Name, content: []byte("f\xFCr")})
+ createTestWikiPage(t, locator, client, wikiRepo, createWikiPageOpts{title: page5Name, forceContentEmpty: true})
+ createTestWikiPage(t, locator, client, wikiRepo, createWikiPageOpts{title: page6Name})
+ createTestWikiPage(t, locator, client, wikiRepo, createWikiPageOpts{title: page7Name})
+ page8Commit := createTestWikiPage(t, locator, client, wikiRepo, createWikiPageOpts{title: page8Name})
latestCommit := page8Commit
testCases := []struct {
@@ -257,7 +259,8 @@ func TestSuccessfulWikiFindPageSameTitleDifferentPathRequest(t *testing.T) {
wikiRepo, _, cleanupFunc := setupWikiRepo(t)
defer cleanupFunc()
- stop, serverSocketPath := runWikiServiceServer(t)
+ locator := config.NewLocator(config.Config)
+ stop, serverSocketPath := runWikiServiceServer(t, locator)
defer stop()
client, conn := newWikiClient(t, serverSocketPath)
@@ -270,8 +273,8 @@ func TestSuccessfulWikiFindPageSameTitleDifferentPathRequest(t *testing.T) {
page2Path := "foo/" + page2Name
page2Content := []byte("content " + page2Name)
- createTestWikiPage(t, client, wikiRepo, createWikiPageOpts{title: page1Name, content: page1Content})
- page2Commit := createTestWikiPage(t, client, wikiRepo, createWikiPageOpts{title: page2Path, content: page2Content})
+ createTestWikiPage(t, locator, client, wikiRepo, createWikiPageOpts{title: page1Name, content: page1Content})
+ page2Commit := createTestWikiPage(t, locator, client, wikiRepo, createWikiPageOpts{title: page2Path, content: page2Content})
testCases := []struct {
desc string
@@ -373,7 +376,8 @@ func TestFailedWikiFindPageDueToValidation(t *testing.T) {
wikiRepo, _, cleanupFunc := setupWikiRepo(t)
defer cleanupFunc()
- stop, serverSocketPath := runWikiServiceServer(t)
+ locator := config.NewLocator(config.Config)
+ stop, serverSocketPath := runWikiServiceServer(t, locator)
defer stop()
client, conn := newWikiClient(t, serverSocketPath)
@@ -439,7 +443,8 @@ func readFullWikiPageFromWikiFindPageClient(t *testing.T, c gitalypb.WikiService
}
func TestInvalidWikiFindPageRequestRevision(t *testing.T) {
- stop, serverSocketPath := runWikiServiceServer(t)
+ locator := config.NewLocator(config.Config)
+ stop, serverSocketPath := runWikiServiceServer(t, locator)
defer stop()
client, conn := newWikiClient(t, serverSocketPath)
diff --git a/internal/gitaly/service/wiki/get_all_pages_test.go b/internal/gitaly/service/wiki/get_all_pages_test.go
index 7952915c2..092a66fd1 100644
--- a/internal/gitaly/service/wiki/get_all_pages_test.go
+++ b/internal/gitaly/service/wiki/get_all_pages_test.go
@@ -5,6 +5,8 @@ import (
"testing"
"github.com/stretchr/testify/require"
+ "gitlab.com/gitlab-org/gitaly/internal/gitaly/config"
+ "gitlab.com/gitlab-org/gitaly/internal/storage"
"gitlab.com/gitlab-org/gitaly/internal/testhelper"
"gitlab.com/gitlab-org/gitaly/proto/go/gitalypb"
"google.golang.org/grpc/codes"
@@ -14,7 +16,8 @@ func TestSuccessfulWikiGetAllPagesRequest(t *testing.T) {
ctx, cancel := testhelper.Context()
defer cancel()
- stop, serverSocketPath := runWikiServiceServer(t)
+ locator := config.NewLocator(config.Config)
+ stop, serverSocketPath := runWikiServiceServer(t, locator)
defer stop()
client, conn := newWikiClient(t, serverSocketPath)
@@ -23,7 +26,7 @@ func TestSuccessfulWikiGetAllPagesRequest(t *testing.T) {
wikiRepo, _, cleanupFunc := setupWikiRepo(t)
defer cleanupFunc()
- expectedPages := createTestWikiPages(t, client, wikiRepo)
+ expectedPages := createTestWikiPages(t, locator, client, wikiRepo)
testcases := []struct {
desc string
@@ -69,7 +72,8 @@ func TestWikiGetAllPagesSorting(t *testing.T) {
ctx, cancel := testhelper.Context()
defer cancel()
- stop, serverSocketPath := runWikiServiceServer(t)
+ locator := config.NewLocator(config.Config)
+ stop, serverSocketPath := runWikiServiceServer(t, locator)
defer stop()
client, conn := newWikiClient(t, serverSocketPath)
@@ -78,7 +82,7 @@ func TestWikiGetAllPagesSorting(t *testing.T) {
wikiRepo, _, cleanupFunc := setupWikiRepo(t)
defer cleanupFunc()
- expectedPages := createTestWikiPages(t, client, wikiRepo)
+ expectedPages := createTestWikiPages(t, locator, client, wikiRepo)
testcasesWithSorting := []struct {
desc string
@@ -177,7 +181,8 @@ func TestWikiGetAllPagesSorting(t *testing.T) {
}
func TestFailedWikiGetAllPagesDueToValidation(t *testing.T) {
- stop, serverSocketPath := runWikiServiceServer(t)
+ locator := config.NewLocator(config.Config)
+ stop, serverSocketPath := runWikiServiceServer(t, locator)
defer stop()
client, conn := newWikiClient(t, serverSocketPath)
@@ -204,13 +209,13 @@ func TestFailedWikiGetAllPagesDueToValidation(t *testing.T) {
}
}
-func createTestWikiPages(t *testing.T, client gitalypb.WikiServiceClient, wikiRepo *gitalypb.Repository) []*gitalypb.WikiPage {
+func createTestWikiPages(t *testing.T, locator storage.Locator, client gitalypb.WikiServiceClient, wikiRepo *gitalypb.Repository) []*gitalypb.WikiPage {
page1Name := "Page 1"
page2Name := "Page 2"
page3Name := "Page 3"
- createTestWikiPage(t, client, wikiRepo, createWikiPageOpts{title: page2Name, forceContentEmpty: true})
- createTestWikiPage(t, client, wikiRepo, createWikiPageOpts{title: page1Name})
- page3Commit := createTestWikiPage(t, client, wikiRepo, createWikiPageOpts{title: page3Name})
+ createTestWikiPage(t, locator, client, wikiRepo, createWikiPageOpts{title: page2Name, forceContentEmpty: true})
+ createTestWikiPage(t, locator, client, wikiRepo, createWikiPageOpts{title: page1Name})
+ page3Commit := createTestWikiPage(t, locator, client, wikiRepo, createWikiPageOpts{title: page3Name})
expectedPage1 := &gitalypb.WikiPage{
Version: &gitalypb.WikiPageVersion{Commit: page3Commit, Format: "markdown"},
Title: []byte(page1Name),
diff --git a/internal/gitaly/service/wiki/get_page_versions_test.go b/internal/gitaly/service/wiki/get_page_versions_test.go
index 09a8ad15a..48d67a439 100644
--- a/internal/gitaly/service/wiki/get_page_versions_test.go
+++ b/internal/gitaly/service/wiki/get_page_versions_test.go
@@ -7,6 +7,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
+ "gitlab.com/gitlab-org/gitaly/internal/gitaly/config"
"gitlab.com/gitlab-org/gitaly/internal/helper/text"
"gitlab.com/gitlab-org/gitaly/internal/testhelper"
"gitlab.com/gitlab-org/gitaly/proto/go/gitalypb"
@@ -19,7 +20,8 @@ func TestWikiGetPageVersionsRequest(t *testing.T) {
ctx, cancel := testhelper.Context()
defer cancel()
- stop, serverSocketPath := runWikiServiceServer(t)
+ locator := config.NewLocator(config.Config)
+ stop, serverSocketPath := runWikiServiceServer(t, locator)
defer stop()
client, conn := newWikiClient(t, serverSocketPath)
@@ -109,7 +111,8 @@ func TestWikiGetPageVersionsPaginationParams(t *testing.T) {
ctx, cancel := testhelper.Context()
defer cancel()
- stop, serverSocketPath := runWikiServiceServer(t)
+ locator := config.NewLocator(config.Config)
+ stop, serverSocketPath := runWikiServiceServer(t, locator)
defer stop()
client, conn := newWikiClient(t, serverSocketPath)
diff --git a/internal/gitaly/service/wiki/list_pages_test.go b/internal/gitaly/service/wiki/list_pages_test.go
index b2e0f164b..621f3a4e2 100644
--- a/internal/gitaly/service/wiki/list_pages_test.go
+++ b/internal/gitaly/service/wiki/list_pages_test.go
@@ -5,6 +5,7 @@ import (
"testing"
"github.com/stretchr/testify/require"
+ "gitlab.com/gitlab-org/gitaly/internal/gitaly/config"
"gitlab.com/gitlab-org/gitaly/internal/testhelper"
"gitlab.com/gitlab-org/gitaly/proto/go/gitalypb"
)
@@ -13,7 +14,8 @@ func TestSuccessfulWikiListPagesRequest(t *testing.T) {
ctx, cancel := testhelper.Context()
defer cancel()
- stop, serverSocketPath := runWikiServiceServer(t)
+ locator := config.NewLocator(config.Config)
+ stop, serverSocketPath := runWikiServiceServer(t, locator)
defer stop()
client, conn := newWikiClient(t, serverSocketPath)
@@ -22,7 +24,7 @@ func TestSuccessfulWikiListPagesRequest(t *testing.T) {
wikiRepo, _, cleanupFunc := setupWikiRepo(t)
defer cleanupFunc()
- expectedPages := createTestWikiPages(t, client, wikiRepo)
+ expectedPages := createTestWikiPages(t, locator, client, wikiRepo)
testcases := []struct {
desc string
@@ -70,7 +72,8 @@ func TestWikiListPagesSorting(t *testing.T) {
ctx, cancel := testhelper.Context()
defer cancel()
- stop, serverSocketPath := runWikiServiceServer(t)
+ locator := config.NewLocator(config.Config)
+ stop, serverSocketPath := runWikiServiceServer(t, locator)
defer stop()
client, conn := newWikiClient(t, serverSocketPath)
@@ -79,7 +82,7 @@ func TestWikiListPagesSorting(t *testing.T) {
wikiRepo, _, cleanupFunc := setupWikiRepo(t)
defer cleanupFunc()
- expectedPages := createTestWikiPages(t, client, wikiRepo)
+ expectedPages := createTestWikiPages(t, locator, client, wikiRepo)
testcasesWithSorting := []struct {
desc string
diff --git a/internal/gitaly/service/wiki/server.go b/internal/gitaly/service/wiki/server.go
index 0b695b005..b43e07749 100644
--- a/internal/gitaly/service/wiki/server.go
+++ b/internal/gitaly/service/wiki/server.go
@@ -2,14 +2,16 @@ package wiki
import (
"gitlab.com/gitlab-org/gitaly/internal/gitaly/rubyserver"
+ "gitlab.com/gitlab-org/gitaly/internal/storage"
"gitlab.com/gitlab-org/gitaly/proto/go/gitalypb"
)
type server struct {
- ruby *rubyserver.Server
+ ruby *rubyserver.Server
+ locator storage.Locator
}
// NewServer creates a new instance of a grpc WikiServiceServer
-func NewServer(rs *rubyserver.Server) gitalypb.WikiServiceServer {
- return &server{ruby: rs}
+func NewServer(rs *rubyserver.Server, locator storage.Locator) gitalypb.WikiServiceServer {
+ return &server{ruby: rs, locator: locator}
}
diff --git a/internal/gitaly/service/wiki/testhelper_test.go b/internal/gitaly/service/wiki/testhelper_test.go
index 0a1ed1e79..cafceaf85 100644
--- a/internal/gitaly/service/wiki/testhelper_test.go
+++ b/internal/gitaly/service/wiki/testhelper_test.go
@@ -14,7 +14,7 @@ import (
gitlog "gitlab.com/gitlab-org/gitaly/internal/git/log"
"gitlab.com/gitlab-org/gitaly/internal/gitaly/config"
"gitlab.com/gitlab-org/gitaly/internal/gitaly/rubyserver"
- "gitlab.com/gitlab-org/gitaly/internal/helper"
+ "gitlab.com/gitlab-org/gitaly/internal/storage"
"gitlab.com/gitlab-org/gitaly/internal/testhelper"
"gitlab.com/gitlab-org/gitaly/proto/go/gitalypb"
"google.golang.org/grpc"
@@ -58,10 +58,10 @@ func testMain(m *testing.M) int {
return m.Run()
}
-func runWikiServiceServer(t *testing.T) (func(), string) {
+func runWikiServiceServer(t *testing.T, locator storage.Locator) (func(), string) {
srv := testhelper.NewServer(t, nil, nil)
- gitalypb.RegisterWikiServiceServer(srv.GrpcServer(), &server{ruby: rubyServer})
+ gitalypb.RegisterWikiServiceServer(srv.GrpcServer(), NewServer(rubyServer, locator))
reflection.Register(srv.GrpcServer())
require.NoError(t, srv.Start())
@@ -185,11 +185,11 @@ func sendBytes(data []byte, chunkSize int, sender func([]byte) error) (int, erro
return i, nil
}
-func createTestWikiPage(t *testing.T, client gitalypb.WikiServiceClient, wikiRepo *gitalypb.Repository, opts createWikiPageOpts) *gitalypb.GitCommit {
+func createTestWikiPage(t *testing.T, locator storage.Locator, client gitalypb.WikiServiceClient, wikiRepo *gitalypb.Repository, opts createWikiPageOpts) *gitalypb.GitCommit {
ctx, cancel := testhelper.Context()
defer cancel()
- wikiRepoPath, err := helper.GetRepoPath(wikiRepo)
+ wikiRepoPath, err := locator.GetRepoPath(wikiRepo)
require.NoError(t, err)
writeWikiPage(t, client, wikiRepo, opts)
head1ID := testhelper.MustRunCommand(t, nil, "git", "-C", wikiRepoPath, "show", "--format=format:%H", "--no-patch", "HEAD")
diff --git a/internal/gitaly/service/wiki/update_page_test.go b/internal/gitaly/service/wiki/update_page_test.go
index 094628826..88d2ade88 100644
--- a/internal/gitaly/service/wiki/update_page_test.go
+++ b/internal/gitaly/service/wiki/update_page_test.go
@@ -6,6 +6,7 @@ import (
"github.com/stretchr/testify/require"
gitlog "gitlab.com/gitlab-org/gitaly/internal/git/log"
+ "gitlab.com/gitlab-org/gitaly/internal/gitaly/config"
"gitlab.com/gitlab-org/gitaly/internal/testhelper"
"gitlab.com/gitlab-org/gitaly/proto/go/gitalypb"
"google.golang.org/grpc/codes"
@@ -18,7 +19,8 @@ func TestSuccessfulWikiUpdatePageRequest(t *testing.T) {
ctx, cancel := testhelper.Context()
defer cancel()
- stop, serverSocketPath := runWikiServiceServer(t)
+ locator := config.NewLocator(config.Config)
+ stop, serverSocketPath := runWikiServiceServer(t, locator)
defer stop()
client, conn := newWikiClient(t, serverSocketPath)
@@ -114,7 +116,8 @@ func TestFailedWikiUpdatePageDueToValidations(t *testing.T) {
wikiRepo, _, cleanupFunc := setupWikiRepo(t)
defer cleanupFunc()
- stop, serverSocketPath := runWikiServiceServer(t)
+ locator := config.NewLocator(config.Config)
+ stop, serverSocketPath := runWikiServiceServer(t, locator)
defer stop()
client, conn := newWikiClient(t, serverSocketPath)
diff --git a/internal/gitaly/service/wiki/write_page_test.go b/internal/gitaly/service/wiki/write_page_test.go
index f9ef38d87..be0e3579e 100644
--- a/internal/gitaly/service/wiki/write_page_test.go
+++ b/internal/gitaly/service/wiki/write_page_test.go
@@ -6,6 +6,7 @@ import (
"github.com/stretchr/testify/require"
gitlog "gitlab.com/gitlab-org/gitaly/internal/git/log"
+ "gitlab.com/gitlab-org/gitaly/internal/gitaly/config"
"gitlab.com/gitlab-org/gitaly/internal/testhelper"
"gitlab.com/gitlab-org/gitaly/proto/go/gitalypb"
"google.golang.org/grpc/codes"
@@ -18,7 +19,8 @@ func TestSuccessfulWikiWritePageRequest(t *testing.T) {
ctx, cancel := testhelper.Context()
defer cancel()
- stop, serverSocketPath := runWikiServiceServer(t)
+ locator := config.NewLocator(config.Config)
+ stop, serverSocketPath := runWikiServiceServer(t, locator)
defer stop()
client, conn := newWikiClient(t, serverSocketPath)
@@ -117,7 +119,8 @@ func TestFailedWikiWritePageDueToDuplicatePage(t *testing.T) {
wikiRepo, _, cleanupFunc := setupWikiRepo(t)
defer cleanupFunc()
- stop, serverSocketPath := runWikiServiceServer(t)
+ locator := config.NewLocator(config.Config)
+ stop, serverSocketPath := runWikiServiceServer(t, locator)
defer stop()
client, conn := newWikiClient(t, serverSocketPath)
@@ -162,7 +165,8 @@ func TestFailedWikiWritePageInPathDueToDuplicatePage(t *testing.T) {
wikiRepo, _, cleanupFunc := setupWikiRepo(t)
defer cleanupFunc()
- stop, serverSocketPath := runWikiServiceServer(t)
+ locator := config.NewLocator(config.Config)
+ stop, serverSocketPath := runWikiServiceServer(t, locator)
defer stop()
client, conn := newWikiClient(t, serverSocketPath)
@@ -206,7 +210,8 @@ func TestFailedWikiWritePageInPathDueToDuplicatePage(t *testing.T) {
func TestFailedWikiWritePageDueToValidations(t *testing.T) {
wikiRepo := &gitalypb.Repository{}
- stop, serverSocketPath := runWikiServiceServer(t)
+ locator := config.NewLocator(config.Config)
+ stop, serverSocketPath := runWikiServiceServer(t, locator)
defer stop()
client, conn := newWikiClient(t, serverSocketPath)