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:
authorPatrick Steinhardt <psteinhardt@gitlab.com>2023-08-11 10:05:23 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2023-08-15 08:17:59 +0300
commit6d56ebc55d67dc9eb7815121de2800ae104fdc04 (patch)
tree35e9ecfe4d150dccfe0edfb168dc966db4d2870a
parentee82c922f159fda1d784fce4206a4c294a8aa0b3 (diff)
tests: Replace usage of `logrus.StandardLogger()`
Replace the usage of `logrus.StandardLogger()` in our tests in favor of `testhelper.NewDiscardingLogger()`.
-rw-r--r--internal/backup/pipeline_test.go9
-rw-r--r--internal/gitaly/storage/storagemgr/partition_manager_test.go3
2 files changed, 5 insertions, 7 deletions
diff --git a/internal/backup/pipeline_test.go b/internal/backup/pipeline_test.go
index b16f658f0..63d2733f7 100644
--- a/internal/backup/pipeline_test.go
+++ b/internal/backup/pipeline_test.go
@@ -7,7 +7,6 @@ import (
"testing"
"time"
- "github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitaly/v16/internal/testhelper"
@@ -18,7 +17,7 @@ func TestLoggingPipeline(t *testing.T) {
t.Parallel()
testPipeline(t, func() Pipeline {
- return NewLoggingPipeline(logrus.StandardLogger())
+ return NewLoggingPipeline(testhelper.NewDiscardingLogger(t))
})
}
@@ -26,7 +25,7 @@ func TestParallelPipeline(t *testing.T) {
t.Parallel()
testPipeline(t, func() Pipeline {
- return NewParallelPipeline(NewLoggingPipeline(logrus.StandardLogger()), 2, 0)
+ return NewParallelPipeline(NewLoggingPipeline(testhelper.NewDiscardingLogger(t)), 2, 0)
})
t.Run("parallelism", func(t *testing.T) {
@@ -65,7 +64,7 @@ func TestParallelPipeline(t *testing.T) {
},
}
var p Pipeline
- p = NewLoggingPipeline(logrus.StandardLogger())
+ p = NewLoggingPipeline(testhelper.NewDiscardingLogger(t))
p = NewParallelPipeline(p, tc.parallel, tc.parallelStorage)
ctx := testhelper.Context(t)
@@ -81,7 +80,7 @@ func TestParallelPipeline(t *testing.T) {
t.Run("context done", func(t *testing.T) {
var strategy MockStrategy
var p Pipeline
- p = NewLoggingPipeline(logrus.StandardLogger())
+ p = NewLoggingPipeline(testhelper.NewDiscardingLogger(t))
p = NewParallelPipeline(p, 0, 0) // make sure worker channels always block
ctx, cancel := context.WithCancel(testhelper.Context(t))
diff --git a/internal/gitaly/storage/storagemgr/partition_manager_test.go b/internal/gitaly/storage/storagemgr/partition_manager_test.go
index 45346466b..4d5eac853 100644
--- a/internal/gitaly/storage/storagemgr/partition_manager_test.go
+++ b/internal/gitaly/storage/storagemgr/partition_manager_test.go
@@ -7,7 +7,6 @@ import (
"path/filepath"
"testing"
- "github.com/sirupsen/logrus"
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitaly/v16/internal/git"
"gitlab.com/gitlab-org/gitaly/v16/internal/git/catfile"
@@ -622,7 +621,7 @@ func TestPartitionManager(t *testing.T) {
txManager := transaction.NewManager(cfg, backchannel.NewRegistry())
housekeepingManager := housekeeping.NewManager(cfg.Prometheus, txManager)
- partitionManager, err := NewPartitionManager(cfg.Storages, cmdFactory, housekeepingManager, localRepoFactory, logrus.StandardLogger())
+ partitionManager, err := NewPartitionManager(cfg.Storages, cmdFactory, housekeepingManager, localRepoFactory, testhelper.NewDiscardingLogger(t))
require.NoError(t, err)
defer func() {