mirror of
https://github.com/grafana/grafana.git
synced 2025-08-03 03:13:49 +08:00
Logging: Unify logging fakes (#48822)
This commit is contained in:
@ -13,6 +13,9 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/grafana/grafana/pkg/api/dtos"
|
||||
"github.com/grafana/grafana/pkg/api/response"
|
||||
"github.com/grafana/grafana/pkg/api/routing"
|
||||
@ -28,8 +31,6 @@ import (
|
||||
"github.com/grafana/grafana/pkg/services/secrets/fakes"
|
||||
secretsManager "github.com/grafana/grafana/pkg/services/secrets/manager"
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func fakeSetIndexViewData(t *testing.T) {
|
||||
@ -65,22 +66,6 @@ func getBody(resp *httptest.ResponseRecorder) (string, error) {
|
||||
return string(responseData), nil
|
||||
}
|
||||
|
||||
type FakeLogger struct {
|
||||
log.Logger
|
||||
}
|
||||
|
||||
func (fl *FakeLogger) Debug(testMessage string, ctx ...interface{}) {
|
||||
}
|
||||
|
||||
func (fl *FakeLogger) Info(testMessage string, ctx ...interface{}) {
|
||||
}
|
||||
|
||||
func (fl *FakeLogger) Warn(testMessage string, ctx ...interface{}) {
|
||||
}
|
||||
|
||||
func (fl *FakeLogger) Error(testMessage string, ctx ...interface{}) {
|
||||
}
|
||||
|
||||
type redirectCase struct {
|
||||
desc string
|
||||
url string
|
||||
@ -332,7 +317,7 @@ func TestLoginPostRedirect(t *testing.T) {
|
||||
fakeViewIndex(t)
|
||||
sc := setupScenarioContext(t, "/login")
|
||||
hs := &HTTPServer{
|
||||
log: &FakeLogger{},
|
||||
log: log.NewNopLogger(),
|
||||
Cfg: setting.NewCfg(),
|
||||
HooksService: &hooks.HooksService{},
|
||||
License: &licensing.OSSLicensingService{},
|
||||
|
Reference in New Issue
Block a user