test suites should also directly use the global logrus logger

This commit is contained in:
R. Aidan Campbell 2021-10-10 14:55:24 -07:00
commit 9ab16632de
No known key found for this signature in database
GPG key ID: 0985399E9CD6A99B
31 changed files with 39 additions and 72 deletions

View file

@ -21,7 +21,6 @@ package account_test
import (
"git.iim.gay/grufwub/go-store/kv"
"github.com/go-fed/activity/pub"
"github.com/sirupsen/logrus"
"github.com/stretchr/testify/suite"
"github.com/superseriousbusiness/gotosocial/internal/config"
"github.com/superseriousbusiness/gotosocial/internal/db"
@ -41,7 +40,6 @@ type AccountStandardTestSuite struct {
suite.Suite
config *config.Config
db db.DB
log *logrus.Logger
tc typeutils.TypeConverter
storage *kv.KVStore
mediaHandler media.Handler
@ -77,7 +75,7 @@ func (suite *AccountStandardTestSuite) SetupSuite() {
func (suite *AccountStandardTestSuite) SetupTest() {
suite.config = testrig.NewTestConfig()
suite.db = testrig.NewTestDB()
suite.log = testrig.NewTestLog()
testrig.InitTestLog()
suite.tc = testrig.NewTestTypeConverter(suite.db)
suite.storage = testrig.NewTestStorage()
suite.mediaHandler = testrig.NewTestMediaHandler(suite.db, suite.storage)

View file

@ -28,7 +28,6 @@ import (
"git.iim.gay/grufwub/go-store/kv"
"github.com/go-fed/activity/streams"
"github.com/sirupsen/logrus"
"github.com/stretchr/testify/suite"
"github.com/superseriousbusiness/gotosocial/internal/config"
"github.com/superseriousbusiness/gotosocial/internal/db"
@ -48,7 +47,6 @@ type ProcessingStandardTestSuite struct {
suite.Suite
config *config.Config
db db.DB
log *logrus.Logger
storage *kv.KVStore
typeconverter typeutils.TypeConverter
transportController transport.Controller
@ -100,7 +98,7 @@ func (suite *ProcessingStandardTestSuite) SetupSuite() {
func (suite *ProcessingStandardTestSuite) SetupTest() {
suite.config = testrig.NewTestConfig()
suite.db = testrig.NewTestDB()
suite.log = testrig.NewTestLog()
testrig.InitTestLog()
suite.storage = testrig.NewTestStorage()
suite.typeconverter = testrig.NewTestTypeConverter(suite.db)

View file

@ -19,7 +19,6 @@
package status_test
import (
"github.com/sirupsen/logrus"
"github.com/stretchr/testify/suite"
"github.com/superseriousbusiness/gotosocial/internal/config"
"github.com/superseriousbusiness/gotosocial/internal/db"
@ -34,7 +33,6 @@ type StatusStandardTestSuite struct {
suite.Suite
config *config.Config
db db.DB
log *logrus.Logger
typeConverter typeutils.TypeConverter
fromClientAPIChan chan messages.FromClientAPI

View file

@ -67,7 +67,7 @@ func (suite *UtilTestSuite) SetupSuite() {
func (suite *UtilTestSuite) SetupTest() {
suite.config = testrig.NewTestConfig()
suite.db = testrig.NewTestDB()
suite.log = testrig.NewTestLog()
testrig.InitTestLog()
suite.typeConverter = testrig.NewTestTypeConverter(suite.db)
suite.fromClientAPIChan = make(chan messages.FromClientAPI, 100)
suite.status = status.New(suite.db, suite.typeConverter, suite.config, suite.fromClientAPIChan)

View file

@ -19,7 +19,6 @@
package streaming_test
import (
"github.com/sirupsen/logrus"
"github.com/stretchr/testify/suite"
"github.com/superseriousbusiness/gotosocial/internal/db"
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
@ -34,7 +33,6 @@ type StreamingTestSuite struct {
testTokens map[string]*gtsmodel.Token
db db.DB
oauthServer oauth.Server
log *logrus.Logger
streamingProcessor streaming.Processor
}
@ -44,7 +42,7 @@ func (suite *StreamingTestSuite) SetupTest() {
suite.testTokens = testrig.NewTestTokens()
suite.db = testrig.NewTestDB()
suite.oauthServer = testrig.NewTestOauthServer(suite.db)
suite.log = testrig.NewTestLog()
testrig.InitTestLog()
suite.streamingProcessor = streaming.New(suite.db, suite.oauthServer)
testrig.StandardDBSetup(suite.db, suite.testAccounts)