diff options
author | Alejandro Rodríguez <alejorro70@gmail.com> | 2017-12-23 00:54:14 +0300 |
---|---|---|
committer | Alejandro Rodríguez <alejorro70@gmail.com> | 2017-12-27 17:42:21 +0300 |
commit | 030c0781532423cc983bfc233c6ba5bc551c7af8 (patch) | |
tree | 7e4f56e18c0ff515676d1f0a13855d22c0ea1dec /internal/testhelper | |
parent | 06ebc31e525a83ff662017adfe28a5077a826c2f (diff) |
Implement RepositoryService.ChangeStorage RPC
Diffstat (limited to 'internal/testhelper')
-rw-r--r-- | internal/testhelper/testhelper.go | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/internal/testhelper/testhelper.go b/internal/testhelper/testhelper.go index e0e6251c4..3107824e5 100644 --- a/internal/testhelper/testhelper.go +++ b/internal/testhelper/testhelper.go @@ -360,3 +360,28 @@ func cloneTestRepo(t *testing.T, bare bool) (repo *pb.Repository, repoPath strin return repo, repoPath, func() { os.RemoveAll(repoPath) } } + +// ConfigureGitalySSH configures the gitaly-ssh command for tests +func ConfigureGitalySSH() { + var err error + + config.Config.BinDir, err = filepath.Abs("testdata/gitaly-libexec") + if err != nil { + log.Fatal(err) + } + + goBuildArgs := []string{ + "build", + "-o", + path.Join(config.Config.BinDir, "gitaly-ssh"), + "gitlab.com/gitlab-org/gitaly/cmd/gitaly-ssh", + } + MustRunCommand(nil, nil, "go", goBuildArgs...) +} + +// GetRepositoryRefs gives a list of each repository ref as a string +func GetRepositoryRefs(t *testing.T, repoPath string) string { + refs := MustRunCommand(t, nil, "git", "-C", repoPath, "for-each-ref") + + return string(refs) +} |