summaryrefslogtreecommitdiff
path: root/internal/federation/federatingactor_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/federatingactor_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/federatingactor_test.go')
-rw-r--r--internal/federation/federatingactor_test.go14
1 files changed, 4 insertions, 10 deletions
diff --git a/internal/federation/federatingactor_test.go b/internal/federation/federatingactor_test.go
index 0d1d8e37f..f63ecd827 100644
--- a/internal/federation/federatingactor_test.go
+++ b/internal/federation/federatingactor_test.go
@@ -27,10 +27,8 @@ import (
"time"
"github.com/stretchr/testify/suite"
- "github.com/superseriousbusiness/gotosocial/internal/concurrency"
"github.com/superseriousbusiness/gotosocial/internal/federation"
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
- "github.com/superseriousbusiness/gotosocial/internal/messages"
"github.com/superseriousbusiness/gotosocial/testrig"
)
@@ -56,14 +54,12 @@ func (suite *FederatingActorTestSuite) TestSendNoRemoteFollowers() {
)
testActivity := testrig.WrapAPNoteInCreate(testrig.URLMustParse("http://localhost:8080/whatever_some_create"), testrig.URLMustParse(testAccount.URI), time.Now(), testNote)
- fedWorker := concurrency.NewWorkerPool[messages.FromFederator](-1, -1)
-
// setup transport controller with a no-op client so we don't make external calls
httpClient := testrig.NewMockHTTPClient(nil, "../../testrig/media")
- tc := testrig.NewTestTransportController(httpClient, suite.db, fedWorker)
+ tc := testrig.NewTestTransportController(&suite.state, httpClient)
// setup module being tested
- federator := federation.NewFederator(suite.db, testrig.NewTestFederatingDB(suite.db, fedWorker), tc, suite.tc, testrig.NewTestMediaManager(suite.db, suite.storage))
+ federator := federation.NewFederator(suite.db, testrig.NewTestFederatingDB(&suite.state), tc, suite.tc, testrig.NewTestMediaManager(&suite.state))
activity, err := federator.FederatingActor().Send(ctx, testrig.URLMustParse(testAccount.OutboxURI), testActivity)
suite.NoError(err)
@@ -105,12 +101,10 @@ func (suite *FederatingActorTestSuite) TestSendRemoteFollower() {
)
testActivity := testrig.WrapAPNoteInCreate(testrig.URLMustParse("http://localhost:8080/whatever_some_create"), testrig.URLMustParse(testAccount.URI), testrig.TimeMustParse("2022-06-02T12:22:21+02:00"), testNote)
- fedWorker := concurrency.NewWorkerPool[messages.FromFederator](-1, -1)
-
httpClient := testrig.NewMockHTTPClient(nil, "../../testrig/media")
- tc := testrig.NewTestTransportController(httpClient, suite.db, fedWorker)
+ tc := testrig.NewTestTransportController(&suite.state, httpClient)
// setup module being tested
- federator := federation.NewFederator(suite.db, testrig.NewTestFederatingDB(suite.db, fedWorker), tc, suite.tc, testrig.NewTestMediaManager(suite.db, suite.storage))
+ federator := federation.NewFederator(suite.db, testrig.NewTestFederatingDB(&suite.state), tc, suite.tc, testrig.NewTestMediaManager(&suite.state))
activity, err := federator.FederatingActor().Send(ctx, testrig.URLMustParse(testAccount.OutboxURI), testActivity)
suite.NoError(err)