diff options
author | Sami Hiltunen <shiltunen@gitlab.com> | 2023-08-22 13:08:46 +0300 |
---|---|---|
committer | Sami Hiltunen <shiltunen@gitlab.com> | 2023-08-31 09:28:29 +0300 |
commit | efe1a5d80ba3e4c80522fa731b575fa84ca908e4 (patch) | |
tree | 53576f4b183c03ec958736caeeea8043e67c1fc8 /internal/cache | |
parent | 644d8262c09ef5436c4b3915f7da98be3c048caa (diff) |
Replace use of NewDiscardingLogEntry with the recording logger
Gitaly now has a helper for recording log output and outputting it
only in tests. Replace the usage of the discarding logger with the
recording logger. These changes are search and replace so these call
sites didn't even need a log entry to begin with but rather use a
FieldLogger.
NewDiscardingLogEntry is removed as it is no longer used.
Diffstat (limited to 'internal/cache')
-rw-r--r-- | internal/cache/diskcache_test.go | 4 | ||||
-rw-r--r-- | internal/cache/walker_test.go | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/internal/cache/diskcache_test.go b/internal/cache/diskcache_test.go index 3c97d9eb6..35ff6bc34 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.NewDiscardingLogEntry(t) + logger := testhelper.NewLogger(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.NewDiscardingLogEntry(t)) + cache := New(cfg, locator, testhelper.NewLogger(t)) req := &gitalypb.InfoRefsRequest{ Repository: &gitalypb.Repository{ diff --git a/internal/cache/walker_test.go b/internal/cache/walker_test.go index 7b71ca73d..925b2e106 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.NewDiscardingLogEntry(t), withDisabledMoveAndClear()) + cache := New(cfg, locator, testhelper.NewLogger(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.NewDiscardingLogEntry(t), withDisabledWalker()) + cache := New(cfg, locator, testhelper.NewLogger(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.NewDiscardingLogEntry(t)) + cache := New(cfg, config.NewLocator(cfg), testhelper.NewLogger(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.NewDiscardingLogEntry(t)) + cache := New(cfg, config.NewLocator(cfg), testhelper.NewLogger(t)) require.NoError(t, cache.cleanWalk(tmp)) |