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
path: root/cmd
diff options
context:
space:
mode:
authorPatrick Steinhardt <psteinhardt@gitlab.com>2023-09-14 10:36:42 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2023-09-18 15:05:40 +0300
commit85d054935371ff90c74dcad5c0f0aafce38fc32e (patch)
treed1ec602fcfba322882e8dadf53d826d3ab514e5f /cmd
parente0dd71b9d9fdc634ea75bfcae6f24112ad5dec25 (diff)
tests: Stop using `NullLogger` in favor of our own internal logger
Stop using logrus' `NullLogger` in favor of our own internal logger that can be set up with the testhelper package.
Diffstat (limited to 'cmd')
-rw-r--r--cmd/gitaly-hooks/hooks_test.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/cmd/gitaly-hooks/hooks_test.go b/cmd/gitaly-hooks/hooks_test.go
index 25cd7937f..ead3f1a7b 100644
--- a/cmd/gitaly-hooks/hooks_test.go
+++ b/cmd/gitaly-hooks/hooks_test.go
@@ -11,7 +11,6 @@ import (
"strings"
"testing"
- "github.com/sirupsen/logrus/hooks/test"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitaly/v16/internal/command"
@@ -167,7 +166,7 @@ func testHooksPrePostReceive(t *testing.T, cfg config.Cfg, repo *gitalypb.Reposi
gitlabUser, gitlabPassword := "gitlab_user-1234", "gitlabsecret9887"
httpProxy, httpsProxy, noProxy := "http://test.example.com:8080", "https://test.example.com:8080", "*"
- logger, _ := test.NewNullLogger()
+ logger := testhelper.NewLogger(t)
c := gitlab.TestServerOptions{
User: gitlabUser,
@@ -356,7 +355,7 @@ func TestHooksPostReceiveFailed(t *testing.T) {
glProtocol := "ssh"
changes := "oldhead newhead"
- logger, _ := test.NewNullLogger()
+ logger := testhelper.NewLogger(t)
ctx := testhelper.Context(t)
cfg := testcfg.Build(t, testcfg.WithBase(config.Cfg{Auth: auth.Config{Token: "abc123"}}))
@@ -478,7 +477,7 @@ func TestHooksNotAllowed(t *testing.T) {
glProtocol := "ssh"
changes := "oldhead newhead"
- logger, _ := test.NewNullLogger()
+ logger := testhelper.NewLogger(t)
ctx := testhelper.Context(t)
cfg := testcfg.Build(t, testcfg.WithBase(config.Cfg{Auth: auth.Config{Token: "abc123"}}))
@@ -610,7 +609,8 @@ func TestGitalyHooksPackObjects(t *testing.T) {
SkipCreationViaService: true,
})
- logger, hook := test.NewNullLogger()
+ logger := testhelper.NewLogger(t)
+ hook := testhelper.AddLoggerHook(logger)
runHookServiceServer(t, cfg, false, testserver.WithLogger(logger))
testcfg.BuildGitalyHooks(t, cfg)