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>2023-08-22 14:46:13 +0300
committerSami Hiltunen <shiltunen@gitlab.com>2023-08-31 09:29:18 +0300
commit97b4c2fdfb7fe78be017fd3819a1849039a02377 (patch)
treea8c1b8f1835227cb45f7d8c56148fe2dae97d165 /internal/cache
parenta3dedd2661cada20c703b79d93c6fbbb62d48f90 (diff)
Replace NewLogger calls with SharedLogger calls in tests
This commit wires the tests to call SharedLogger instead of NewLogger so they'll use the test case's shared logger. This way the log output is printed to the same logger and is ordered.
Diffstat (limited to 'internal/cache')
-rw-r--r--internal/cache/diskcache_test.go4
-rw-r--r--internal/cache/walker_test.go8
2 files changed, 6 insertions, 6 deletions
diff --git a/internal/cache/diskcache_test.go b/internal/cache/diskcache_test.go
index 35ff6bc34..c2795b4fd 100644
--- a/internal/cache/diskcache_test.go
+++ b/internal/cache/diskcache_test.go
@@ -58,7 +58,7 @@ func TestStreamDBNaiveKeyer(t *testing.T) {
})
gittest.WriteCommit(t, cfg, repoPath2, gittest.WithMessage("two"), gittest.WithBranch("master"))
- logger := testhelper.NewLogger(t)
+ logger := testhelper.SharedLogger(t)
locator := config.NewLocator(cfg)
req1 := &gitalypb.InfoRefsRequest{
@@ -167,7 +167,7 @@ func TestLoserCount(t *testing.T) {
cfg := cfgBuilder.Build(t)
locator := config.NewLocator(cfg)
- cache := New(cfg, locator, testhelper.NewLogger(t))
+ cache := New(cfg, locator, testhelper.SharedLogger(t))
req := &gitalypb.InfoRefsRequest{
Repository: &gitalypb.Repository{
diff --git a/internal/cache/walker_test.go b/internal/cache/walker_test.go
index 925b2e106..f9b176f6c 100644
--- a/internal/cache/walker_test.go
+++ b/internal/cache/walker_test.go
@@ -52,7 +52,7 @@ func TestDiskCacheObjectWalker(t *testing.T) {
}
}
- cache := New(cfg, locator, testhelper.NewLogger(t), withDisabledMoveAndClear())
+ cache := New(cfg, locator, testhelper.SharedLogger(t), withDisabledMoveAndClear())
require.NoError(t, cache.StartWalkers())
defer cache.StopWalkers()
@@ -81,7 +81,7 @@ func TestDiskCacheInitialClear(t *testing.T) {
require.NoError(t, os.MkdirAll(filepath.Dir(canary), perm.SharedDir))
require.NoError(t, os.WriteFile(canary, []byte("chirp chirp"), perm.PublicFile))
- cache := New(cfg, locator, testhelper.NewLogger(t), withDisabledWalker())
+ cache := New(cfg, locator, testhelper.SharedLogger(t), withDisabledWalker())
require.NoError(t, cache.StartWalkers())
defer cache.StopWalkers()
@@ -91,7 +91,7 @@ func TestDiskCacheInitialClear(t *testing.T) {
func TestCleanWalkDirNotExists(t *testing.T) {
cfg := testcfg.Build(t)
- cache := New(cfg, config.NewLocator(cfg), testhelper.NewLogger(t))
+ cache := New(cfg, config.NewLocator(cfg), testhelper.SharedLogger(t))
err := cache.cleanWalk("/path/that/does/not/exist")
assert.NoError(t, err, "cleanWalk returned an error for a non existing directory")
@@ -124,7 +124,7 @@ func TestCleanWalkEmptyDirs(t *testing.T) {
}
cfg := testcfg.Build(t)
- cache := New(cfg, config.NewLocator(cfg), testhelper.NewLogger(t))
+ cache := New(cfg, config.NewLocator(cfg), testhelper.SharedLogger(t))
require.NoError(t, cache.cleanWalk(tmp))