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:
authorPaul Okstad <pokstad@gitlab.com>2019-04-03 00:49:42 +0300
committerPaul Okstad <pokstad@gitlab.com>2019-04-03 00:49:42 +0300
commit82eb1451157c5f0d7f1889b7a5b8fe5b10740a61 (patch)
tree2203571ccc472125bf91ee897b1f191268cf9004
parente7126c48b6dfdf3144e6c61cceaf47487cd9cae1 (diff)
parent7aeaca3f832a7c8ddc15b27724893b4a5a01b609 (diff)
Merge branch 'remove-test-code' into 'master'
Remove test dependency in main binaries Closes #1584 See merge request gitlab-org/gitaly!1171
-rw-r--r--changelogs/unreleased/remove-test-code.yml5
-rw-r--r--internal/git/objectpool/test_helper.go19
-rw-r--r--internal/service/repository/pre_fetch_test.go13
3 files changed, 16 insertions, 21 deletions
diff --git a/changelogs/unreleased/remove-test-code.yml b/changelogs/unreleased/remove-test-code.yml
new file mode 100644
index 000000000..fef1eb77c
--- /dev/null
+++ b/changelogs/unreleased/remove-test-code.yml
@@ -0,0 +1,5 @@
+---
+title: Remove test dependency in main binaries
+merge_request: 1171
+author:
+type: fixed
diff --git a/internal/git/objectpool/test_helper.go b/internal/git/objectpool/test_helper.go
deleted file mode 100644
index effa1c9c3..000000000
--- a/internal/git/objectpool/test_helper.go
+++ /dev/null
@@ -1,19 +0,0 @@
-package objectpool
-
-import (
- "testing"
-
- "github.com/stretchr/testify/require"
- "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb"
- "gitlab.com/gitlab-org/gitaly/internal/testhelper"
-)
-
-// NewTestObjectPool creates a new object pool
-func NewTestObjectPool(t *testing.T) (*ObjectPool, *gitalypb.Repository) {
- repo, _, relativePath := testhelper.CreateRepo(t, testhelper.GitlabTestStoragePath())
-
- pool, err := NewObjectPool("default", relativePath)
- require.NoError(t, err)
-
- return pool, repo
-}
diff --git a/internal/service/repository/pre_fetch_test.go b/internal/service/repository/pre_fetch_test.go
index d461b7b2a..7460c5b8e 100644
--- a/internal/service/repository/pre_fetch_test.go
+++ b/internal/service/repository/pre_fetch_test.go
@@ -57,7 +57,7 @@ func TestPreFetch(t *testing.T) {
testRepo, testRepoPath, cleanupFn := testhelper.NewTestRepo(t)
defer cleanupFn()
- pool, poolRepo := objectpool.NewTestObjectPool(t)
+ pool, poolRepo := NewTestObjectPool(t)
defer pool.Remove(ctx)
require.NoError(t, pool.Create(ctx, testRepo))
@@ -86,6 +86,15 @@ func TestPreFetch(t *testing.T) {
testhelper.MustRunCommand(t, nil, "git", "-C", forkRepoPath, "show-ref", "feature")
}
+func NewTestObjectPool(t *testing.T) (*objectpool.ObjectPool, *gitalypb.Repository) {
+ repo, _, relativePath := testhelper.CreateRepo(t, testhelper.GitlabTestStoragePath())
+
+ pool, err := objectpool.NewObjectPool("default", relativePath)
+ require.NoError(t, err)
+
+ return pool, repo
+}
+
func TestPreFetchValidationError(t *testing.T) {
t.Skip("PreFetch is unsafe https://gitlab.com/gitlab-org/gitaly/issues/1552")
@@ -101,7 +110,7 @@ func TestPreFetchValidationError(t *testing.T) {
testRepo, _, cleanupFn := testhelper.NewTestRepo(t)
defer cleanupFn()
- pool, poolRepo := objectpool.NewTestObjectPool(t)
+ pool, poolRepo := NewTestObjectPool(t)
defer pool.Remove(ctx)
require.NoError(t, pool.Create(ctx, testRepo))