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:
authorJames Fargher <proglottis@gmail.com>2021-04-27 01:42:32 +0300
committerJames Fargher <proglottis@gmail.com>2021-04-27 01:42:32 +0300
commit2a8ce2b89c336659e5d5768ab6054881856651c6 (patch)
tree63ea6f2e298fdcee0bb2a4f06f97db4c6c221de0
parent585cfd46d6be12237b640d19cbd730f3065e0ecc (diff)
parent4b22c0fec0b88fb534fed609c2d465ee552fe9f0 (diff)
Merge branch 'ps-rm-config-tempdir' into 'master'
Remove config.Config from tempdir package See merge request gitlab-org/gitaly!3377
-rw-r--r--internal/tempdir/tempdir_test.go19
1 files changed, 8 insertions, 11 deletions
diff --git a/internal/tempdir/tempdir_test.go b/internal/tempdir/tempdir_test.go
index fef06b361..4342e724e 100644
--- a/internal/tempdir/tempdir_test.go
+++ b/internal/tempdir/tempdir_test.go
@@ -13,6 +13,7 @@ import (
"gitlab.com/gitlab-org/gitaly/internal/git/gittest"
"gitlab.com/gitlab-org/gitaly/internal/gitaly/config"
"gitlab.com/gitlab-org/gitaly/internal/testhelper"
+ "gitlab.com/gitlab-org/gitaly/internal/testhelper/testcfg"
"gitlab.com/gitlab-org/gitaly/proto/go/gitalypb"
)
@@ -20,10 +21,8 @@ func TestNewAsRepositorySuccess(t *testing.T) {
ctx, cancel := testhelper.Context()
defer cancel()
- repo, _, cleanup := gittest.CloneRepo(t)
- defer cleanup()
-
- locator := config.NewLocator(config.Config)
+ cfg, repo, _ := testcfg.BuildWithRepo(t)
+ locator := config.NewLocator(cfg)
tempRepo, tempDir, err := NewAsRepository(ctx, repo, locator)
require.NoError(t, err)
require.NotEqual(t, repo, tempRepo)
@@ -104,19 +103,17 @@ func TestCleanSuccess(t *testing.T) {
}
func TestCleanTempDir(t *testing.T) {
+ cfg := testcfg.Build(t, testcfg.WithStorages("first", "second"))
+ gittest.CloneRepoAtStorage(t, cfg.Storages[0], t.Name())
+
logrus.SetLevel(logrus.InfoLevel)
logrus.SetOutput(ioutil.Discard)
hook := test.NewGlobal()
- storages := append(config.Config.Storages[:], config.Storage{
- Name: "default",
- Path: "testdata/clean",
- })
-
- cleanTempDir(storages)
+ cleanTempDir(cfg.Storages)
- require.Equal(t, 2, len(hook.Entries))
+ require.Equal(t, 2, len(hook.Entries), hook.Entries)
require.Equal(t, "finished tempdir cleaner walk", hook.LastEntry().Message)
}