summaryrefslogtreecommitdiff
path: root/internal/federation/federator_test.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2023-03-01 18:26:53 +0000
committerLibravatar GitHub <noreply@github.com>2023-03-01 18:26:53 +0000
commitbaf933cb9f3e1053bdb61b90d7027efe9fad1bc2 (patch)
tree3f2a76851d58517ca3dece2bacd6aceefd8dfb96 /internal/federation/federator_test.go
parent[feature] Federate pinned posts (aka `featuredCollection`) in and out (#1560) (diff)
downloadgotosocial-baf933cb9f3e1053bdb61b90d7027efe9fad1bc2.tar.xz
[chore] move client/federator workerpools to Workers{} (#1575)
* replace concurrency worker pools with base models in State.Workers, update code and tests accordingly * improve code comment * change back testrig default log level * un-comment-out TestAnnounceTwice() and fix --------- Signed-off-by: kim <grufwub@gmail.com> Reviewed-by: tobi
Diffstat (limited to 'internal/federation/federator_test.go')
-rw-r--r--internal/federation/federator_test.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/internal/federation/federator_test.go b/internal/federation/federator_test.go
index da6038ace..8a045aa1f 100644
--- a/internal/federation/federator_test.go
+++ b/internal/federation/federator_test.go
@@ -23,6 +23,7 @@ import (
"github.com/superseriousbusiness/gotosocial/internal/db"
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
+ "github.com/superseriousbusiness/gotosocial/internal/state"
"github.com/superseriousbusiness/gotosocial/internal/storage"
"github.com/superseriousbusiness/gotosocial/internal/typeutils"
"github.com/superseriousbusiness/gotosocial/testrig"
@@ -32,6 +33,7 @@ type FederatorStandardTestSuite struct {
suite.Suite
db db.DB
storage *storage.Driver
+ state state.State
tc typeutils.TypeConverter
testAccounts map[string]*gtsmodel.Account
testStatuses map[string]*gtsmodel.Status
@@ -42,8 +44,9 @@ type FederatorStandardTestSuite struct {
// SetupSuite sets some variables on the suite that we can use as consts (more or less) throughout
func (suite *FederatorStandardTestSuite) SetupSuite() {
// setup standard items
+ testrig.StartWorkers(&suite.state)
suite.storage = testrig.NewInMemoryStorage()
- suite.tc = testrig.NewTestTypeConverter(suite.db)
+ suite.state.Storage = suite.storage
suite.testAccounts = testrig.NewTestAccounts()
suite.testStatuses = testrig.NewTestStatuses()
suite.testTombstones = testrig.NewTestTombstones()
@@ -52,7 +55,10 @@ func (suite *FederatorStandardTestSuite) SetupSuite() {
func (suite *FederatorStandardTestSuite) SetupTest() {
testrig.InitTestConfig()
testrig.InitTestLog()
- suite.db = testrig.NewTestDB()
+ suite.state.Caches.Init()
+ suite.db = testrig.NewTestDB(&suite.state)
+ suite.tc = testrig.NewTestTypeConverter(suite.db)
+ suite.state.DB = suite.db
suite.testActivities = testrig.NewTestActivities(suite.testAccounts)
testrig.StandardDBSetup(suite.db, suite.testAccounts)
}