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:
authorAlejandro Rodríguez <alejorro70@gmail.com>2017-11-27 19:32:31 +0300
committerAlejandro Rodríguez <alejorro70@gmail.com>2017-11-27 19:32:31 +0300
commit1f9fee6d9fb5af310b5825da84924eb9fa704905 (patch)
treee79f8f3eac439e1a2829e14cd92a4fe3ff4891e7
parentb0d1a2668ade80d453cb0ff7f19dce2661bc00dc (diff)
parent34be3720dec6e703f8ac77d940599bc2517c9e68 (diff)
Merge branch 'testrepo-helper-names' into 'master'
Improve names of repo helpers See merge request gitlab-org/gitaly!467
-rw-r--r--internal/service/commit/find_commits_test.go2
-rw-r--r--internal/service/commit/isancestor_test.go2
-rw-r--r--internal/service/diff/raw_test.go4
-rw-r--r--internal/service/ref/delete_refs_test.go2
-rw-r--r--internal/service/ref/refs_test.go2
-rw-r--r--internal/testhelper/testhelper.go9
6 files changed, 11 insertions, 10 deletions
diff --git a/internal/service/commit/find_commits_test.go b/internal/service/commit/find_commits_test.go
index 846a35bea..42e576652 100644
--- a/internal/service/commit/find_commits_test.go
+++ b/internal/service/commit/find_commits_test.go
@@ -232,7 +232,7 @@ func TestSuccessfulFindCommitsRequestWithAltGitObjectDirs(t *testing.T) {
committerName := "Scrooge McDuck"
committerEmail := "scrooge@mcduck.com"
- testRepoCopy, testRepoCopyPath, cleanupFn := testhelper.SetupMutableTestRepo(t)
+ testRepoCopy, testRepoCopyPath, cleanupFn := testhelper.NewTestRepoWithWorktree(t)
defer cleanupFn()
altObjectsDir := "./alt-objects"
diff --git a/internal/service/commit/isancestor_test.go b/internal/service/commit/isancestor_test.go
index e6ed1bdd9..62f59c11c 100644
--- a/internal/service/commit/isancestor_test.go
+++ b/internal/service/commit/isancestor_test.go
@@ -184,7 +184,7 @@ func TestSuccessfulIsAncestorRequestWithAltGitObjectDirs(t *testing.T) {
committerName := "Scrooge McDuck"
committerEmail := "scrooge@mcduck.com"
- testRepoCopy, testRepoCopyPath, cleanupFn := testhelper.SetupMutableTestRepo(t)
+ testRepoCopy, testRepoCopyPath, cleanupFn := testhelper.NewTestRepoWithWorktree(t)
defer cleanupFn()
altObjectsDir := "./alt-objects"
diff --git a/internal/service/diff/raw_test.go b/internal/service/diff/raw_test.go
index c92408caf..34847b87e 100644
--- a/internal/service/diff/raw_test.go
+++ b/internal/service/diff/raw_test.go
@@ -30,7 +30,7 @@ func TestSuccessfulRawDiffRequest(t *testing.T) {
c, err := client.RawDiff(ctx, rpcRequest)
require.NoError(t, err)
- _, sandboxRepoPath, cleanupFn := testhelper.SetupMutableTestRepo(t)
+ _, sandboxRepoPath, cleanupFn := testhelper.NewTestRepoWithWorktree(t)
defer cleanupFn()
reader := streamio.NewReader(func() ([]byte, error) {
@@ -128,7 +128,7 @@ func TestSuccessfulRawPatchRequest(t *testing.T) {
return response.GetData(), err
})
- _, sandboxRepoPath, cleanupFn := testhelper.SetupMutableTestRepo(t)
+ _, sandboxRepoPath, cleanupFn := testhelper.NewTestRepoWithWorktree(t)
defer cleanupFn()
testhelper.MustRunCommand(t, nil, "git", "-C", sandboxRepoPath, "reset", "--hard", leftCommit)
diff --git a/internal/service/ref/delete_refs_test.go b/internal/service/ref/delete_refs_test.go
index fde7664a0..d3926e71f 100644
--- a/internal/service/ref/delete_refs_test.go
+++ b/internal/service/ref/delete_refs_test.go
@@ -18,7 +18,7 @@ func TestSuccessfulDeleteRefs(t *testing.T) {
client, conn := newRefServiceClient(t, serverSocketPath)
defer conn.Close()
- repo, repoPath, cleanupFn := testhelper.SetupCopyTestRepo(t)
+ repo, repoPath, cleanupFn := testhelper.NewTestRepo(t)
defer cleanupFn()
testhelper.MustRunCommand(t, nil, "git", "-C", repoPath, "update-ref", "refs/delete/a", "b83d6e391c22777fca1ed3012fce84f633d7fed0")
diff --git a/internal/service/ref/refs_test.go b/internal/service/ref/refs_test.go
index b0aa30a75..8299153eb 100644
--- a/internal/service/ref/refs_test.go
+++ b/internal/service/ref/refs_test.go
@@ -353,7 +353,7 @@ func TestSuccessfulFindAllTagsRequest(t *testing.T) {
server, serverSocketPath := runRefServiceServer(t)
defer server.Stop()
- testRepoCopy, testRepoCopyPath, cleanupFn := testhelper.SetupMutableTestRepo(t)
+ testRepoCopy, testRepoCopyPath, cleanupFn := testhelper.NewTestRepoWithWorktree(t)
defer cleanupFn()
committerName := "Scrooge McDuck"
diff --git a/internal/testhelper/testhelper.go b/internal/testhelper/testhelper.go
index 9094c36ef..3756d19b5 100644
--- a/internal/testhelper/testhelper.go
+++ b/internal/testhelper/testhelper.go
@@ -299,13 +299,14 @@ func Context() (context.Context, func()) {
return context.WithCancel(context.Background())
}
-// SetupCopyTestRepo creates a bare copy of the test repository.
-func SetupCopyTestRepo(t *testing.T) (repo *pb.Repository, repoPath string, cleanup func()) {
+// NewTestRepo creates a bare copy of the test repository.
+func NewTestRepo(t *testing.T) (repo *pb.Repository, repoPath string, cleanup func()) {
return cloneTestRepo(t, true)
}
-// SetupMutableTestRepo creates a copy of the test repository apt for changes.
-func SetupMutableTestRepo(t *testing.T) (repo *pb.Repository, repoPath string, cleanup func()) {
+// NewTestRepoWithWorktree creates a copy of the test repository with a
+// worktree. This is allows you to run normal 'non-bare' Git commands.
+func NewTestRepoWithWorktree(t *testing.T) (repo *pb.Repository, repoPath string, cleanup func()) {
return cloneTestRepo(t, false)
}