mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-29 22:36:14 -06:00
rename actions package
This commit is contained in:
parent
e773bba875
commit
175107f6a3
55 changed files with 116 additions and 116 deletions
|
|
@ -32,7 +32,7 @@ import (
|
||||||
"github.com/KimMachineGun/automemlimit/memlimit"
|
"github.com/KimMachineGun/automemlimit/memlimit"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/superseriousbusiness/gotosocial/cmd/gotosocial/action"
|
"github.com/superseriousbusiness/gotosocial/cmd/gotosocial/action"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
"github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/api"
|
"github.com/superseriousbusiness/gotosocial/internal/api"
|
||||||
apiutil "github.com/superseriousbusiness/gotosocial/internal/api/util"
|
apiutil "github.com/superseriousbusiness/gotosocial/internal/api/util"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/cleaner"
|
"github.com/superseriousbusiness/gotosocial/internal/cleaner"
|
||||||
|
|
@ -168,7 +168,7 @@ var Start action.GTSAction = func(ctx context.Context) error {
|
||||||
|
|
||||||
// Set Actions on state, providing workers to
|
// Set Actions on state, providing workers to
|
||||||
// Actions as well for triggering side effects.
|
// Actions as well for triggering side effects.
|
||||||
state.Actions = actions.New(dbService, &state.Workers)
|
state.AdminActions = admin.New(dbService, &state.Workers)
|
||||||
|
|
||||||
// Ensure necessary database instance prerequisites exist.
|
// Ensure necessary database instance prerequisites exist.
|
||||||
if err := dbService.CreateInstanceAccount(ctx); err != nil {
|
if err := dbService.CreateInstanceAccount(ctx); err != nil {
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
package actions
|
package admin
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
package actions_test
|
package admin_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
@ -75,7 +75,7 @@ func (suite *ActionsTestSuite) TestActionOverlap() {
|
||||||
key2 := action2.Key()
|
key2 := action2.Key()
|
||||||
suite.Equal("account/01H90S1CXQ97J9625C5YBXZWGT", key2)
|
suite.Equal("account/01H90S1CXQ97J9625C5YBXZWGT", key2)
|
||||||
|
|
||||||
errWithCode := testStructs.State.Actions.Run(
|
errWithCode := testStructs.State.AdminActions.Run(
|
||||||
ctx,
|
ctx,
|
||||||
action1,
|
action1,
|
||||||
func(ctx context.Context) gtserror.MultiError {
|
func(ctx context.Context) gtserror.MultiError {
|
||||||
|
|
@ -88,7 +88,7 @@ func (suite *ActionsTestSuite) TestActionOverlap() {
|
||||||
|
|
||||||
// While first action is sleeping, try to
|
// While first action is sleeping, try to
|
||||||
// process another with the same key.
|
// process another with the same key.
|
||||||
errWithCode = testStructs.State.Actions.Run(
|
errWithCode = testStructs.State.AdminActions.Run(
|
||||||
ctx,
|
ctx,
|
||||||
action2,
|
action2,
|
||||||
func(ctx context.Context) gtserror.MultiError {
|
func(ctx context.Context) gtserror.MultiError {
|
||||||
|
|
@ -104,13 +104,13 @@ func (suite *ActionsTestSuite) TestActionOverlap() {
|
||||||
|
|
||||||
// Wait for action to finish.
|
// Wait for action to finish.
|
||||||
if !testrig.WaitFor(func() bool {
|
if !testrig.WaitFor(func() bool {
|
||||||
return testStructs.State.Actions.TotalRunning() == 0
|
return testStructs.State.AdminActions.TotalRunning() == 0
|
||||||
}) {
|
}) {
|
||||||
suite.FailNow("timed out waiting for admin action(s) to finish")
|
suite.FailNow("timed out waiting for admin action(s) to finish")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try again.
|
// Try again.
|
||||||
errWithCode = testStructs.State.Actions.Run(
|
errWithCode = testStructs.State.AdminActions.Run(
|
||||||
ctx,
|
ctx,
|
||||||
action2,
|
action2,
|
||||||
func(ctx context.Context) gtserror.MultiError {
|
func(ctx context.Context) gtserror.MultiError {
|
||||||
|
|
@ -121,7 +121,7 @@ func (suite *ActionsTestSuite) TestActionOverlap() {
|
||||||
|
|
||||||
// Wait for action to finish.
|
// Wait for action to finish.
|
||||||
if !testrig.WaitFor(func() bool {
|
if !testrig.WaitFor(func() bool {
|
||||||
return testStructs.State.Actions.TotalRunning() == 0
|
return testStructs.State.AdminActions.TotalRunning() == 0
|
||||||
}) {
|
}) {
|
||||||
suite.FailNow("timed out waiting for admin action(s) to finish")
|
suite.FailNow("timed out waiting for admin action(s) to finish")
|
||||||
}
|
}
|
||||||
|
|
@ -143,7 +143,7 @@ func (suite *ActionsTestSuite) TestActionWithErrors() {
|
||||||
AccountID: "01H90S1ZZXP4N74H4A9RVW1MRP",
|
AccountID: "01H90S1ZZXP4N74H4A9RVW1MRP",
|
||||||
}
|
}
|
||||||
|
|
||||||
errWithCode := testStructs.State.Actions.Run(
|
errWithCode := testStructs.State.AdminActions.Run(
|
||||||
ctx,
|
ctx,
|
||||||
action,
|
action,
|
||||||
func(ctx context.Context) gtserror.MultiError {
|
func(ctx context.Context) gtserror.MultiError {
|
||||||
|
|
@ -158,7 +158,7 @@ func (suite *ActionsTestSuite) TestActionWithErrors() {
|
||||||
|
|
||||||
// Wait for action to finish.
|
// Wait for action to finish.
|
||||||
if !testrig.WaitFor(func() bool {
|
if !testrig.WaitFor(func() bool {
|
||||||
return testStructs.State.Actions.TotalRunning() == 0
|
return testStructs.State.AdminActions.TotalRunning() == 0
|
||||||
}) {
|
}) {
|
||||||
suite.FailNow("timed out waiting for admin action(s) to finish")
|
suite.FailNow("timed out waiting for admin action(s) to finish")
|
||||||
}
|
}
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
package actions
|
package admin
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
package actions
|
package admin
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
package actions
|
package admin
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
@ -25,7 +25,7 @@ import (
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
"github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/api/activitypub/emoji"
|
"github.com/superseriousbusiness/gotosocial/internal/api/activitypub/emoji"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/email"
|
"github.com/superseriousbusiness/gotosocial/internal/email"
|
||||||
|
|
@ -74,7 +74,7 @@ func (suite *EmojiGetTestSuite) SetupTest() {
|
||||||
|
|
||||||
suite.db = testrig.NewTestDB(&suite.state)
|
suite.db = testrig.NewTestDB(&suite.state)
|
||||||
suite.state.DB = suite.db
|
suite.state.DB = suite.db
|
||||||
suite.state.Actions = actions.New(suite.state.DB, &suite.state.Workers)
|
suite.state.AdminActions = admin.New(suite.state.DB, &suite.state.Workers)
|
||||||
suite.storage = testrig.NewInMemoryStorage()
|
suite.storage = testrig.NewInMemoryStorage()
|
||||||
suite.state.Storage = suite.storage
|
suite.state.Storage = suite.storage
|
||||||
suite.tc = typeutils.NewConverter(&suite.state)
|
suite.tc = typeutils.NewConverter(&suite.state)
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ package users_test
|
||||||
import (
|
import (
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
"github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/api/activitypub/users"
|
"github.com/superseriousbusiness/gotosocial/internal/api/activitypub/users"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/email"
|
"github.com/superseriousbusiness/gotosocial/internal/email"
|
||||||
|
|
@ -85,7 +85,7 @@ func (suite *UserStandardTestSuite) SetupTest() {
|
||||||
|
|
||||||
suite.db = testrig.NewTestDB(&suite.state)
|
suite.db = testrig.NewTestDB(&suite.state)
|
||||||
suite.state.DB = suite.db
|
suite.state.DB = suite.db
|
||||||
suite.state.Actions = actions.New(suite.state.DB, &suite.state.Workers)
|
suite.state.AdminActions = admin.New(suite.state.DB, &suite.state.Workers)
|
||||||
suite.tc = typeutils.NewConverter(&suite.state)
|
suite.tc = typeutils.NewConverter(&suite.state)
|
||||||
|
|
||||||
testrig.StartTimelines(
|
testrig.StartTimelines(
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ import (
|
||||||
"github.com/gin-contrib/sessions/memstore"
|
"github.com/gin-contrib/sessions/memstore"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
"github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/api/auth"
|
"github.com/superseriousbusiness/gotosocial/internal/api/auth"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/config"
|
"github.com/superseriousbusiness/gotosocial/internal/config"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||||
|
|
@ -85,7 +85,7 @@ func (suite *AuthStandardTestSuite) SetupTest() {
|
||||||
|
|
||||||
suite.db = testrig.NewTestDB(&suite.state)
|
suite.db = testrig.NewTestDB(&suite.state)
|
||||||
suite.state.DB = suite.db
|
suite.state.DB = suite.db
|
||||||
suite.state.Actions = actions.New(suite.state.DB, &suite.state.Workers)
|
suite.state.AdminActions = admin.New(suite.state.DB, &suite.state.Workers)
|
||||||
suite.storage = testrig.NewInMemoryStorage()
|
suite.storage = testrig.NewInMemoryStorage()
|
||||||
suite.state.Storage = suite.storage
|
suite.state.Storage = suite.storage
|
||||||
suite.mediaManager = testrig.NewTestMediaManager(&suite.state)
|
suite.mediaManager = testrig.NewTestMediaManager(&suite.state)
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ import (
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
"github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/api/client/accounts"
|
"github.com/superseriousbusiness/gotosocial/internal/api/client/accounts"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/config"
|
"github.com/superseriousbusiness/gotosocial/internal/config"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||||
|
|
@ -86,7 +86,7 @@ func (suite *AccountStandardTestSuite) SetupTest() {
|
||||||
|
|
||||||
suite.db = testrig.NewTestDB(&suite.state)
|
suite.db = testrig.NewTestDB(&suite.state)
|
||||||
suite.state.DB = suite.db
|
suite.state.DB = suite.db
|
||||||
suite.state.Actions = actions.New(suite.state.DB, &suite.state.Workers)
|
suite.state.AdminActions = admin.New(suite.state.DB, &suite.state.Workers)
|
||||||
suite.storage = testrig.NewInMemoryStorage()
|
suite.storage = testrig.NewInMemoryStorage()
|
||||||
suite.state.Storage = suite.storage
|
suite.state.Storage = suite.storage
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ import (
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
adminactions "github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/api/client/admin"
|
"github.com/superseriousbusiness/gotosocial/internal/api/client/admin"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/config"
|
"github.com/superseriousbusiness/gotosocial/internal/config"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||||
|
|
@ -92,7 +92,7 @@ func (suite *AdminStandardTestSuite) SetupTest() {
|
||||||
|
|
||||||
suite.db = testrig.NewTestDB(&suite.state)
|
suite.db = testrig.NewTestDB(&suite.state)
|
||||||
suite.state.DB = suite.db
|
suite.state.DB = suite.db
|
||||||
suite.state.Actions = actions.New(suite.state.DB, &suite.state.Workers)
|
suite.state.AdminActions = adminactions.New(suite.state.DB, &suite.state.Workers)
|
||||||
suite.storage = testrig.NewInMemoryStorage()
|
suite.storage = testrig.NewInMemoryStorage()
|
||||||
suite.state.Storage = suite.storage
|
suite.state.Storage = suite.storage
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
"github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/api/client/bookmarks"
|
"github.com/superseriousbusiness/gotosocial/internal/api/client/bookmarks"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/api/client/statuses"
|
"github.com/superseriousbusiness/gotosocial/internal/api/client/statuses"
|
||||||
apimodel "github.com/superseriousbusiness/gotosocial/internal/api/model"
|
apimodel "github.com/superseriousbusiness/gotosocial/internal/api/model"
|
||||||
|
|
@ -96,7 +96,7 @@ func (suite *BookmarkTestSuite) SetupTest() {
|
||||||
|
|
||||||
suite.db = testrig.NewTestDB(&suite.state)
|
suite.db = testrig.NewTestDB(&suite.state)
|
||||||
suite.state.DB = suite.db
|
suite.state.DB = suite.db
|
||||||
suite.state.Actions = actions.New(suite.state.DB, &suite.state.Workers)
|
suite.state.AdminActions = admin.New(suite.state.DB, &suite.state.Workers)
|
||||||
suite.storage = testrig.NewInMemoryStorage()
|
suite.storage = testrig.NewInMemoryStorage()
|
||||||
suite.state.Storage = suite.storage
|
suite.state.Storage = suite.storage
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ package favourites_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
"github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/api/client/favourites"
|
"github.com/superseriousbusiness/gotosocial/internal/api/client/favourites"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/email"
|
"github.com/superseriousbusiness/gotosocial/internal/email"
|
||||||
|
|
@ -80,7 +80,7 @@ func (suite *FavouritesStandardTestSuite) SetupTest() {
|
||||||
|
|
||||||
suite.db = testrig.NewTestDB(&suite.state)
|
suite.db = testrig.NewTestDB(&suite.state)
|
||||||
suite.state.DB = suite.db
|
suite.state.DB = suite.db
|
||||||
suite.state.Actions = actions.New(suite.state.DB, &suite.state.Workers)
|
suite.state.AdminActions = admin.New(suite.state.DB, &suite.state.Workers)
|
||||||
suite.storage = testrig.NewInMemoryStorage()
|
suite.storage = testrig.NewInMemoryStorage()
|
||||||
suite.state.Storage = suite.storage
|
suite.state.Storage = suite.storage
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
"github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||||
filtersV1 "github.com/superseriousbusiness/gotosocial/internal/api/client/filters/v1"
|
filtersV1 "github.com/superseriousbusiness/gotosocial/internal/api/client/filters/v1"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/config"
|
"github.com/superseriousbusiness/gotosocial/internal/config"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||||
|
|
@ -91,7 +91,7 @@ func (suite *FiltersTestSuite) SetupTest() {
|
||||||
|
|
||||||
suite.db = testrig.NewTestDB(&suite.state)
|
suite.db = testrig.NewTestDB(&suite.state)
|
||||||
suite.state.DB = suite.db
|
suite.state.DB = suite.db
|
||||||
suite.state.Actions = actions.New(suite.state.DB, &suite.state.Workers)
|
suite.state.AdminActions = admin.New(suite.state.DB, &suite.state.Workers)
|
||||||
suite.storage = testrig.NewInMemoryStorage()
|
suite.storage = testrig.NewInMemoryStorage()
|
||||||
suite.state.Storage = suite.storage
|
suite.state.Storage = suite.storage
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
"github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||||
filtersV2 "github.com/superseriousbusiness/gotosocial/internal/api/client/filters/v2"
|
filtersV2 "github.com/superseriousbusiness/gotosocial/internal/api/client/filters/v2"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/config"
|
"github.com/superseriousbusiness/gotosocial/internal/config"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||||
|
|
@ -91,7 +91,7 @@ func (suite *FiltersTestSuite) SetupTest() {
|
||||||
|
|
||||||
suite.db = testrig.NewTestDB(&suite.state)
|
suite.db = testrig.NewTestDB(&suite.state)
|
||||||
suite.state.DB = suite.db
|
suite.state.DB = suite.db
|
||||||
suite.state.Actions = actions.New(suite.state.DB, &suite.state.Workers)
|
suite.state.AdminActions = admin.New(suite.state.DB, &suite.state.Workers)
|
||||||
suite.storage = testrig.NewInMemoryStorage()
|
suite.storage = testrig.NewInMemoryStorage()
|
||||||
suite.state.Storage = suite.storage
|
suite.state.Storage = suite.storage
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
"github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/api/client/followedtags"
|
"github.com/superseriousbusiness/gotosocial/internal/api/client/followedtags"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/config"
|
"github.com/superseriousbusiness/gotosocial/internal/config"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||||
|
|
@ -80,7 +80,7 @@ func (suite *FollowedTagsTestSuite) SetupTest() {
|
||||||
|
|
||||||
suite.db = testrig.NewTestDB(&suite.state)
|
suite.db = testrig.NewTestDB(&suite.state)
|
||||||
suite.state.DB = suite.db
|
suite.state.DB = suite.db
|
||||||
suite.state.Actions = actions.New(suite.state.DB, &suite.state.Workers)
|
suite.state.AdminActions = admin.New(suite.state.DB, &suite.state.Workers)
|
||||||
suite.storage = testrig.NewInMemoryStorage()
|
suite.storage = testrig.NewInMemoryStorage()
|
||||||
suite.state.Storage = suite.storage
|
suite.state.Storage = suite.storage
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ import (
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
"github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/api/client/followrequests"
|
"github.com/superseriousbusiness/gotosocial/internal/api/client/followrequests"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/config"
|
"github.com/superseriousbusiness/gotosocial/internal/config"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||||
|
|
@ -83,7 +83,7 @@ func (suite *FollowRequestStandardTestSuite) SetupTest() {
|
||||||
|
|
||||||
suite.db = testrig.NewTestDB(&suite.state)
|
suite.db = testrig.NewTestDB(&suite.state)
|
||||||
suite.state.DB = suite.db
|
suite.state.DB = suite.db
|
||||||
suite.state.Actions = actions.New(suite.state.DB, &suite.state.Workers)
|
suite.state.AdminActions = admin.New(suite.state.DB, &suite.state.Workers)
|
||||||
suite.storage = testrig.NewInMemoryStorage()
|
suite.storage = testrig.NewInMemoryStorage()
|
||||||
suite.state.Storage = suite.storage
|
suite.state.Storage = suite.storage
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ import (
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
"github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/api/client/instance"
|
"github.com/superseriousbusiness/gotosocial/internal/api/client/instance"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/config"
|
"github.com/superseriousbusiness/gotosocial/internal/config"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||||
|
|
@ -85,7 +85,7 @@ func (suite *InstanceStandardTestSuite) SetupTest() {
|
||||||
|
|
||||||
suite.db = testrig.NewTestDB(&suite.state)
|
suite.db = testrig.NewTestDB(&suite.state)
|
||||||
suite.state.DB = suite.db
|
suite.state.DB = suite.db
|
||||||
suite.state.Actions = actions.New(suite.state.DB, &suite.state.Workers)
|
suite.state.AdminActions = admin.New(suite.state.DB, &suite.state.Workers)
|
||||||
suite.storage = testrig.NewInMemoryStorage()
|
suite.storage = testrig.NewInMemoryStorage()
|
||||||
suite.state.Storage = suite.storage
|
suite.state.Storage = suite.storage
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ package lists_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
"github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/api/client/lists"
|
"github.com/superseriousbusiness/gotosocial/internal/api/client/lists"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/email"
|
"github.com/superseriousbusiness/gotosocial/internal/email"
|
||||||
|
|
@ -86,7 +86,7 @@ func (suite *ListsStandardTestSuite) SetupTest() {
|
||||||
|
|
||||||
suite.db = testrig.NewTestDB(&suite.state)
|
suite.db = testrig.NewTestDB(&suite.state)
|
||||||
suite.state.DB = suite.db
|
suite.state.DB = suite.db
|
||||||
suite.state.Actions = actions.New(suite.state.DB, &suite.state.Workers)
|
suite.state.AdminActions = admin.New(suite.state.DB, &suite.state.Workers)
|
||||||
suite.storage = testrig.NewInMemoryStorage()
|
suite.storage = testrig.NewInMemoryStorage()
|
||||||
suite.state.Storage = suite.storage
|
suite.state.Storage = suite.storage
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ import (
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
"github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/api/client/mutes"
|
"github.com/superseriousbusiness/gotosocial/internal/api/client/mutes"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/config"
|
"github.com/superseriousbusiness/gotosocial/internal/config"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||||
|
|
@ -82,7 +82,7 @@ func (suite *MutesTestSuite) SetupTest() {
|
||||||
|
|
||||||
suite.db = testrig.NewTestDB(&suite.state)
|
suite.db = testrig.NewTestDB(&suite.state)
|
||||||
suite.state.DB = suite.db
|
suite.state.DB = suite.db
|
||||||
suite.state.Actions = actions.New(suite.state.DB, &suite.state.Workers)
|
suite.state.AdminActions = admin.New(suite.state.DB, &suite.state.Workers)
|
||||||
suite.storage = testrig.NewInMemoryStorage()
|
suite.storage = testrig.NewInMemoryStorage()
|
||||||
suite.state.Storage = suite.storage
|
suite.state.Storage = suite.storage
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ package notifications_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
"github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/api/client/notifications"
|
"github.com/superseriousbusiness/gotosocial/internal/api/client/notifications"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/email"
|
"github.com/superseriousbusiness/gotosocial/internal/email"
|
||||||
|
|
@ -82,7 +82,7 @@ func (suite *NotificationsTestSuite) SetupTest() {
|
||||||
|
|
||||||
suite.db = testrig.NewTestDB(&suite.state)
|
suite.db = testrig.NewTestDB(&suite.state)
|
||||||
suite.state.DB = suite.db
|
suite.state.DB = suite.db
|
||||||
suite.state.Actions = actions.New(suite.state.DB, &suite.state.Workers)
|
suite.state.AdminActions = admin.New(suite.state.DB, &suite.state.Workers)
|
||||||
suite.storage = testrig.NewInMemoryStorage()
|
suite.storage = testrig.NewInMemoryStorage()
|
||||||
suite.state.Storage = suite.storage
|
suite.state.Storage = suite.storage
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ package polls_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
"github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/api/client/polls"
|
"github.com/superseriousbusiness/gotosocial/internal/api/client/polls"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/email"
|
"github.com/superseriousbusiness/gotosocial/internal/email"
|
||||||
|
|
@ -77,7 +77,7 @@ func (suite *PollsStandardTestSuite) SetupTest() {
|
||||||
|
|
||||||
suite.db = testrig.NewTestDB(&suite.state)
|
suite.db = testrig.NewTestDB(&suite.state)
|
||||||
suite.state.DB = suite.db
|
suite.state.DB = suite.db
|
||||||
suite.state.Actions = actions.New(suite.state.DB, &suite.state.Workers)
|
suite.state.AdminActions = admin.New(suite.state.DB, &suite.state.Workers)
|
||||||
suite.storage = testrig.NewInMemoryStorage()
|
suite.storage = testrig.NewInMemoryStorage()
|
||||||
suite.state.Storage = suite.storage
|
suite.state.Storage = suite.storage
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ package reports_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
"github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/api/client/reports"
|
"github.com/superseriousbusiness/gotosocial/internal/api/client/reports"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/email"
|
"github.com/superseriousbusiness/gotosocial/internal/email"
|
||||||
|
|
@ -77,7 +77,7 @@ func (suite *ReportsStandardTestSuite) SetupTest() {
|
||||||
|
|
||||||
suite.db = testrig.NewTestDB(&suite.state)
|
suite.db = testrig.NewTestDB(&suite.state)
|
||||||
suite.state.DB = suite.db
|
suite.state.DB = suite.db
|
||||||
suite.state.Actions = actions.New(suite.state.DB, &suite.state.Workers)
|
suite.state.AdminActions = admin.New(suite.state.DB, &suite.state.Workers)
|
||||||
suite.storage = testrig.NewInMemoryStorage()
|
suite.storage = testrig.NewInMemoryStorage()
|
||||||
suite.state.Storage = suite.storage
|
suite.state.Storage = suite.storage
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ import (
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
"github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/api/client/search"
|
"github.com/superseriousbusiness/gotosocial/internal/api/client/search"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/config"
|
"github.com/superseriousbusiness/gotosocial/internal/config"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||||
|
|
@ -81,7 +81,7 @@ func (suite *SearchStandardTestSuite) SetupTest() {
|
||||||
|
|
||||||
suite.db = testrig.NewTestDB(&suite.state)
|
suite.db = testrig.NewTestDB(&suite.state)
|
||||||
suite.state.DB = suite.db
|
suite.state.DB = suite.db
|
||||||
suite.state.Actions = actions.New(suite.state.DB, &suite.state.Workers)
|
suite.state.AdminActions = admin.New(suite.state.DB, &suite.state.Workers)
|
||||||
suite.storage = testrig.NewInMemoryStorage()
|
suite.storage = testrig.NewInMemoryStorage()
|
||||||
suite.state.Storage = suite.storage
|
suite.state.Storage = suite.storage
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
"github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/api/client/statuses"
|
"github.com/superseriousbusiness/gotosocial/internal/api/client/statuses"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/email"
|
"github.com/superseriousbusiness/gotosocial/internal/email"
|
||||||
|
|
@ -193,7 +193,7 @@ func (suite *StatusStandardTestSuite) SetupTest() {
|
||||||
|
|
||||||
suite.db = testrig.NewTestDB(&suite.state)
|
suite.db = testrig.NewTestDB(&suite.state)
|
||||||
suite.state.DB = suite.db
|
suite.state.DB = suite.db
|
||||||
suite.state.Actions = actions.New(suite.state.DB, &suite.state.Workers)
|
suite.state.AdminActions = admin.New(suite.state.DB, &suite.state.Workers)
|
||||||
suite.storage = testrig.NewInMemoryStorage()
|
suite.storage = testrig.NewInMemoryStorage()
|
||||||
suite.state.Storage = suite.storage
|
suite.state.Storage = suite.storage
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ import (
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
"github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/api/client/streaming"
|
"github.com/superseriousbusiness/gotosocial/internal/api/client/streaming"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/email"
|
"github.com/superseriousbusiness/gotosocial/internal/email"
|
||||||
|
|
@ -93,7 +93,7 @@ func (suite *StreamingTestSuite) SetupTest() {
|
||||||
|
|
||||||
suite.db = testrig.NewTestDB(&suite.state)
|
suite.db = testrig.NewTestDB(&suite.state)
|
||||||
suite.state.DB = suite.db
|
suite.state.DB = suite.db
|
||||||
suite.state.Actions = actions.New(suite.state.DB, &suite.state.Workers)
|
suite.state.AdminActions = admin.New(suite.state.DB, &suite.state.Workers)
|
||||||
suite.storage = testrig.NewInMemoryStorage()
|
suite.storage = testrig.NewInMemoryStorage()
|
||||||
suite.state.Storage = suite.storage
|
suite.state.Storage = suite.storage
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ import (
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
"github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/api/client/tags"
|
"github.com/superseriousbusiness/gotosocial/internal/api/client/tags"
|
||||||
apimodel "github.com/superseriousbusiness/gotosocial/internal/api/model"
|
apimodel "github.com/superseriousbusiness/gotosocial/internal/api/model"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/config"
|
"github.com/superseriousbusiness/gotosocial/internal/config"
|
||||||
|
|
@ -88,7 +88,7 @@ func (suite *TagsTestSuite) SetupTest() {
|
||||||
|
|
||||||
suite.db = testrig.NewTestDB(&suite.state)
|
suite.db = testrig.NewTestDB(&suite.state)
|
||||||
suite.state.DB = suite.db
|
suite.state.DB = suite.db
|
||||||
suite.state.Actions = actions.New(suite.state.DB, &suite.state.Workers)
|
suite.state.AdminActions = admin.New(suite.state.DB, &suite.state.Workers)
|
||||||
suite.storage = testrig.NewInMemoryStorage()
|
suite.storage = testrig.NewInMemoryStorage()
|
||||||
suite.state.Storage = suite.storage
|
suite.state.Storage = suite.storage
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ import (
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
"github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/api/client/user"
|
"github.com/superseriousbusiness/gotosocial/internal/api/client/user"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/federation"
|
"github.com/superseriousbusiness/gotosocial/internal/federation"
|
||||||
|
|
@ -73,7 +73,7 @@ func (suite *UserStandardTestSuite) SetupTest() {
|
||||||
|
|
||||||
suite.db = testrig.NewTestDB(&suite.state)
|
suite.db = testrig.NewTestDB(&suite.state)
|
||||||
suite.state.DB = suite.db
|
suite.state.DB = suite.db
|
||||||
suite.state.Actions = actions.New(suite.state.DB, &suite.state.Workers)
|
suite.state.AdminActions = admin.New(suite.state.DB, &suite.state.Workers)
|
||||||
suite.storage = testrig.NewInMemoryStorage()
|
suite.storage = testrig.NewInMemoryStorage()
|
||||||
suite.state.Storage = suite.storage
|
suite.state.Storage = suite.storage
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ package fileserver_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
"github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/api/fileserver"
|
"github.com/superseriousbusiness/gotosocial/internal/api/fileserver"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/email"
|
"github.com/superseriousbusiness/gotosocial/internal/email"
|
||||||
|
|
@ -99,7 +99,7 @@ func (suite *FileserverTestSuite) SetupTest() {
|
||||||
|
|
||||||
suite.db = testrig.NewTestDB(&suite.state)
|
suite.db = testrig.NewTestDB(&suite.state)
|
||||||
suite.state.DB = suite.db
|
suite.state.DB = suite.db
|
||||||
suite.state.Actions = actions.New(suite.state.DB, &suite.state.Workers)
|
suite.state.AdminActions = admin.New(suite.state.DB, &suite.state.Workers)
|
||||||
|
|
||||||
testrig.StandardDBSetup(suite.db, nil)
|
testrig.StandardDBSetup(suite.db, nil)
|
||||||
testrig.StandardStorageSetup(suite.storage, "../../../testrig/media")
|
testrig.StandardStorageSetup(suite.storage, "../../../testrig/media")
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ package webfinger_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
"github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/api/wellknown/webfinger"
|
"github.com/superseriousbusiness/gotosocial/internal/api/wellknown/webfinger"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/email"
|
"github.com/superseriousbusiness/gotosocial/internal/email"
|
||||||
|
|
@ -80,7 +80,7 @@ func (suite *WebfingerStandardTestSuite) SetupTest() {
|
||||||
|
|
||||||
suite.db = testrig.NewTestDB(&suite.state)
|
suite.db = testrig.NewTestDB(&suite.state)
|
||||||
suite.state.DB = suite.db
|
suite.state.DB = suite.db
|
||||||
suite.state.Actions = actions.New(suite.state.DB, &suite.state.Workers)
|
suite.state.AdminActions = admin.New(suite.state.DB, &suite.state.Workers)
|
||||||
suite.tc = typeutils.NewConverter(&suite.state)
|
suite.tc = typeutils.NewConverter(&suite.state)
|
||||||
|
|
||||||
testrig.StartTimelines(
|
testrig.StartTimelines(
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
"github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/cleaner"
|
"github.com/superseriousbusiness/gotosocial/internal/cleaner"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/filter/visibility"
|
"github.com/superseriousbusiness/gotosocial/internal/filter/visibility"
|
||||||
|
|
@ -68,7 +68,7 @@ func (suite *MediaTestSuite) SetupTest() {
|
||||||
suite.db = testrig.NewTestDB(&suite.state)
|
suite.db = testrig.NewTestDB(&suite.state)
|
||||||
suite.storage = testrig.NewInMemoryStorage()
|
suite.storage = testrig.NewInMemoryStorage()
|
||||||
suite.state.DB = suite.db
|
suite.state.DB = suite.db
|
||||||
suite.state.Actions = actions.New(suite.state.DB, &suite.state.Workers)
|
suite.state.AdminActions = admin.New(suite.state.DB, &suite.state.Workers)
|
||||||
suite.state.Storage = suite.storage
|
suite.state.Storage = suite.storage
|
||||||
|
|
||||||
testrig.StandardStorageSetup(suite.storage, "../../testrig/media")
|
testrig.StandardStorageSetup(suite.storage, "../../testrig/media")
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ package dereferencing_test
|
||||||
import (
|
import (
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
"github.com/superseriousbusiness/activity/streams/vocab"
|
"github.com/superseriousbusiness/activity/streams/vocab"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
"github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/federation/dereferencing"
|
"github.com/superseriousbusiness/gotosocial/internal/federation/dereferencing"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/filter/interaction"
|
"github.com/superseriousbusiness/gotosocial/internal/filter/interaction"
|
||||||
|
|
@ -78,7 +78,7 @@ func (suite *DereferencerStandardTestSuite) SetupTest() {
|
||||||
suite.client = testrig.NewMockHTTPClient(nil, "../../../testrig/media")
|
suite.client = testrig.NewMockHTTPClient(nil, "../../../testrig/media")
|
||||||
suite.storage = testrig.NewInMemoryStorage()
|
suite.storage = testrig.NewInMemoryStorage()
|
||||||
suite.state.DB = suite.db
|
suite.state.DB = suite.db
|
||||||
suite.state.Actions = actions.New(suite.state.DB, &suite.state.Workers)
|
suite.state.AdminActions = admin.New(suite.state.DB, &suite.state.Workers)
|
||||||
suite.state.Storage = suite.storage
|
suite.state.Storage = suite.storage
|
||||||
|
|
||||||
visFilter := visibility.NewFilter(&suite.state)
|
visFilter := visibility.NewFilter(&suite.state)
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
"github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/federation/federatingdb"
|
"github.com/superseriousbusiness/gotosocial/internal/federation/federatingdb"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/filter/visibility"
|
"github.com/superseriousbusiness/gotosocial/internal/filter/visibility"
|
||||||
|
|
@ -92,7 +92,7 @@ func (suite *FederatingDBTestSuite) SetupTest() {
|
||||||
testrig.StandardDBSetup(suite.db, suite.testAccounts)
|
testrig.StandardDBSetup(suite.db, suite.testAccounts)
|
||||||
|
|
||||||
suite.state.DB = suite.db
|
suite.state.DB = suite.db
|
||||||
suite.state.Actions = actions.New(suite.state.DB, &suite.state.Workers)
|
suite.state.AdminActions = admin.New(suite.state.DB, &suite.state.Workers)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (suite *FederatingDBTestSuite) TearDownTest() {
|
func (suite *FederatingDBTestSuite) TearDownTest() {
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ package media_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
"github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/filter/visibility"
|
"github.com/superseriousbusiness/gotosocial/internal/filter/visibility"
|
||||||
gtsmodel "github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
|
gtsmodel "github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
|
||||||
|
|
@ -54,7 +54,7 @@ func (suite *MediaStandardTestSuite) SetupTest() {
|
||||||
suite.db = testrig.NewTestDB(&suite.state)
|
suite.db = testrig.NewTestDB(&suite.state)
|
||||||
suite.storage = testrig.NewInMemoryStorage()
|
suite.storage = testrig.NewInMemoryStorage()
|
||||||
suite.state.DB = suite.db
|
suite.state.DB = suite.db
|
||||||
suite.state.Actions = actions.New(suite.state.DB, &suite.state.Workers)
|
suite.state.AdminActions = admin.New(suite.state.DB, &suite.state.Workers)
|
||||||
suite.state.Storage = suite.storage
|
suite.state.Storage = suite.storage
|
||||||
|
|
||||||
testrig.StandardStorageSetup(suite.storage, "../../testrig/media")
|
testrig.StandardStorageSetup(suite.storage, "../../testrig/media")
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
"github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/oauth"
|
"github.com/superseriousbusiness/gotosocial/internal/oauth"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/state"
|
"github.com/superseriousbusiness/gotosocial/internal/state"
|
||||||
|
|
@ -55,7 +55,7 @@ func (suite *PgClientStoreTestSuite) SetupTest() {
|
||||||
testrig.InitTestConfig()
|
testrig.InitTestConfig()
|
||||||
suite.db = testrig.NewTestDB(&suite.state)
|
suite.db = testrig.NewTestDB(&suite.state)
|
||||||
suite.state.DB = suite.db
|
suite.state.DB = suite.db
|
||||||
suite.state.Actions = actions.New(suite.state.DB, &suite.state.Workers)
|
suite.state.AdminActions = admin.New(suite.state.DB, &suite.state.Workers)
|
||||||
testrig.StandardDBSetup(suite.db, nil)
|
testrig.StandardDBSetup(suite.db, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
"github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/email"
|
"github.com/superseriousbusiness/gotosocial/internal/email"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/federation"
|
"github.com/superseriousbusiness/gotosocial/internal/federation"
|
||||||
|
|
@ -94,7 +94,7 @@ func (suite *AccountStandardTestSuite) SetupTest() {
|
||||||
|
|
||||||
suite.db = testrig.NewTestDB(&suite.state)
|
suite.db = testrig.NewTestDB(&suite.state)
|
||||||
suite.state.DB = suite.db
|
suite.state.DB = suite.db
|
||||||
suite.state.Actions = actions.New(suite.state.DB, &suite.state.Workers)
|
suite.state.AdminActions = admin.New(suite.state.DB, &suite.state.Workers)
|
||||||
suite.tc = typeutils.NewConverter(&suite.state)
|
suite.tc = typeutils.NewConverter(&suite.state)
|
||||||
|
|
||||||
testrig.StartTimelines(
|
testrig.StartTimelines(
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ func (suite *AccountTestSuite) TestAccountActionSuspend() {
|
||||||
|
|
||||||
// Wait for action to finish.
|
// Wait for action to finish.
|
||||||
if !testrig.WaitFor(func() bool {
|
if !testrig.WaitFor(func() bool {
|
||||||
return suite.state.Actions.TotalRunning() == 0
|
return suite.state.AdminActions.TotalRunning() == 0
|
||||||
}) {
|
}) {
|
||||||
suite.FailNow("timed out waiting for admin action(s) to finish")
|
suite.FailNow("timed out waiting for admin action(s) to finish")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ func (p *Processor) accountActionSuspend(
|
||||||
) (string, gtserror.WithCode) {
|
) (string, gtserror.WithCode) {
|
||||||
actionID := id.NewULID()
|
actionID := id.NewULID()
|
||||||
|
|
||||||
errWithCode := p.state.Actions.Run(
|
errWithCode := p.state.AdminActions.Run(
|
||||||
ctx,
|
ctx,
|
||||||
>smodel.AdminAction{
|
>smodel.AdminAction{
|
||||||
ID: actionID,
|
ID: actionID,
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ package admin_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
adminactions "github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/cleaner"
|
"github.com/superseriousbusiness/gotosocial/internal/cleaner"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/email"
|
"github.com/superseriousbusiness/gotosocial/internal/email"
|
||||||
|
|
@ -91,7 +91,7 @@ func (suite *AdminStandardTestSuite) SetupTest() {
|
||||||
|
|
||||||
suite.db = testrig.NewTestDB(&suite.state)
|
suite.db = testrig.NewTestDB(&suite.state)
|
||||||
suite.state.DB = suite.db
|
suite.state.DB = suite.db
|
||||||
suite.state.Actions = actions.New(suite.state.DB, &suite.state.Workers)
|
suite.state.AdminActions = adminactions.New(suite.state.DB, &suite.state.Workers)
|
||||||
suite.tc = typeutils.NewConverter(&suite.state)
|
suite.tc = typeutils.NewConverter(&suite.state)
|
||||||
|
|
||||||
testrig.StartTimelines(
|
testrig.StartTimelines(
|
||||||
|
|
|
||||||
|
|
@ -76,10 +76,10 @@ func (p *Processor) createDomainAllow(
|
||||||
AccountID: adminAcct.ID,
|
AccountID: adminAcct.ID,
|
||||||
}
|
}
|
||||||
|
|
||||||
if errWithCode := p.state.Actions.Run(
|
if errWithCode := p.state.AdminActions.Run(
|
||||||
ctx,
|
ctx,
|
||||||
action,
|
action,
|
||||||
p.state.Actions.DomainAllowF(action.ID, domainAllow),
|
p.state.AdminActions.DomainAllowF(action.ID, domainAllow),
|
||||||
); errWithCode != nil {
|
); errWithCode != nil {
|
||||||
return nil, action.ID, errWithCode
|
return nil, action.ID, errWithCode
|
||||||
}
|
}
|
||||||
|
|
@ -132,10 +132,10 @@ func (p *Processor) deleteDomainAllow(
|
||||||
AccountID: adminAcct.ID,
|
AccountID: adminAcct.ID,
|
||||||
}
|
}
|
||||||
|
|
||||||
if errWithCode := p.state.Actions.Run(
|
if errWithCode := p.state.AdminActions.Run(
|
||||||
ctx,
|
ctx,
|
||||||
action,
|
action,
|
||||||
p.state.Actions.DomainUnallowF(action.ID, domainAllow),
|
p.state.AdminActions.DomainUnallowF(action.ID, domainAllow),
|
||||||
); errWithCode != nil {
|
); errWithCode != nil {
|
||||||
return nil, action.ID, errWithCode
|
return nil, action.ID, errWithCode
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -77,10 +77,10 @@ func (p *Processor) createDomainBlock(
|
||||||
Text: domainBlock.PrivateComment,
|
Text: domainBlock.PrivateComment,
|
||||||
}
|
}
|
||||||
|
|
||||||
if errWithCode := p.state.Actions.Run(
|
if errWithCode := p.state.AdminActions.Run(
|
||||||
ctx,
|
ctx,
|
||||||
action,
|
action,
|
||||||
p.state.Actions.DomainBlockF(action.ID, domainBlock),
|
p.state.AdminActions.DomainBlockF(action.ID, domainBlock),
|
||||||
); errWithCode != nil {
|
); errWithCode != nil {
|
||||||
return nil, action.ID, errWithCode
|
return nil, action.ID, errWithCode
|
||||||
}
|
}
|
||||||
|
|
@ -133,10 +133,10 @@ func (p *Processor) deleteDomainBlock(
|
||||||
AccountID: adminAcct.ID,
|
AccountID: adminAcct.ID,
|
||||||
}
|
}
|
||||||
|
|
||||||
if errWithCode := p.state.Actions.Run(
|
if errWithCode := p.state.AdminActions.Run(
|
||||||
ctx,
|
ctx,
|
||||||
action,
|
action,
|
||||||
p.state.Actions.DomainUnblockF(action.ID, domainBlock),
|
p.state.AdminActions.DomainUnblockF(action.ID, domainBlock),
|
||||||
); errWithCode != nil {
|
); errWithCode != nil {
|
||||||
return nil, action.ID, errWithCode
|
return nil, action.ID, errWithCode
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -48,10 +48,10 @@ func (p *Processor) DomainKeysExpire(
|
||||||
AccountID: adminAcct.ID,
|
AccountID: adminAcct.ID,
|
||||||
}
|
}
|
||||||
|
|
||||||
if errWithCode := p.state.Actions.Run(
|
if errWithCode := p.state.AdminActions.Run(
|
||||||
ctx,
|
ctx,
|
||||||
action,
|
action,
|
||||||
p.state.Actions.DomainKeysExpireF(domain),
|
p.state.AdminActions.DomainKeysExpireF(domain),
|
||||||
); errWithCode != nil {
|
); errWithCode != nil {
|
||||||
return action.ID, errWithCode
|
return action.ID, errWithCode
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -186,7 +186,7 @@ func (suite *DomainBlockTestSuite) awaitAction(actionID string) {
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
if !testrig.WaitFor(func() bool {
|
if !testrig.WaitFor(func() bool {
|
||||||
return suite.state.Actions.TotalRunning() == 0
|
return suite.state.AdminActions.TotalRunning() == 0
|
||||||
}) {
|
}) {
|
||||||
suite.FailNow("timed out waiting for admin action(s) to finish")
|
suite.FailNow("timed out waiting for admin action(s) to finish")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
"github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||||
dbtest "github.com/superseriousbusiness/gotosocial/internal/db/test"
|
dbtest "github.com/superseriousbusiness/gotosocial/internal/db/test"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/email"
|
"github.com/superseriousbusiness/gotosocial/internal/email"
|
||||||
|
|
@ -104,7 +104,7 @@ func (suite *ConversationsTestSuite) SetupTest() {
|
||||||
|
|
||||||
suite.db = testrig.NewTestDB(&suite.state)
|
suite.db = testrig.NewTestDB(&suite.state)
|
||||||
suite.state.DB = suite.db
|
suite.state.DB = suite.db
|
||||||
suite.state.Actions = actions.New(suite.state.DB, &suite.state.Workers)
|
suite.state.AdminActions = admin.New(suite.state.DB, &suite.state.Workers)
|
||||||
suite.tc = typeutils.NewConverter(&suite.state)
|
suite.tc = typeutils.NewConverter(&suite.state)
|
||||||
suite.filter = visibility.NewFilter(&suite.state)
|
suite.filter = visibility.NewFilter(&suite.state)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ package media_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
"github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/filter/visibility"
|
"github.com/superseriousbusiness/gotosocial/internal/filter/visibility"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
|
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
|
||||||
|
|
@ -76,7 +76,7 @@ func (suite *MediaStandardTestSuite) SetupTest() {
|
||||||
|
|
||||||
suite.db = testrig.NewTestDB(&suite.state)
|
suite.db = testrig.NewTestDB(&suite.state)
|
||||||
suite.state.DB = suite.db
|
suite.state.DB = suite.db
|
||||||
suite.state.Actions = actions.New(suite.state.DB, &suite.state.Workers)
|
suite.state.AdminActions = admin.New(suite.state.DB, &suite.state.Workers)
|
||||||
suite.tc = typeutils.NewConverter(&suite.state)
|
suite.tc = typeutils.NewConverter(&suite.state)
|
||||||
suite.storage = testrig.NewInMemoryStorage()
|
suite.storage = testrig.NewInMemoryStorage()
|
||||||
suite.state.Storage = suite.storage
|
suite.state.Storage = suite.storage
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
"github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/cleaner"
|
"github.com/superseriousbusiness/gotosocial/internal/cleaner"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/email"
|
"github.com/superseriousbusiness/gotosocial/internal/email"
|
||||||
|
|
@ -104,7 +104,7 @@ func (suite *ProcessingStandardTestSuite) SetupTest() {
|
||||||
|
|
||||||
suite.db = testrig.NewTestDB(&suite.state)
|
suite.db = testrig.NewTestDB(&suite.state)
|
||||||
suite.state.DB = suite.db
|
suite.state.DB = suite.db
|
||||||
suite.state.Actions = actions.New(suite.state.DB, &suite.state.Workers)
|
suite.state.AdminActions = admin.New(suite.state.DB, &suite.state.Workers)
|
||||||
suite.testActivities = testrig.NewTestActivities(suite.testAccounts)
|
suite.testActivities = testrig.NewTestActivities(suite.testAccounts)
|
||||||
suite.storage = testrig.NewInMemoryStorage()
|
suite.storage = testrig.NewInMemoryStorage()
|
||||||
suite.state.Storage = suite.storage
|
suite.state.Storage = suite.storage
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ package status_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
"github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/federation"
|
"github.com/superseriousbusiness/gotosocial/internal/federation"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/filter/interaction"
|
"github.com/superseriousbusiness/gotosocial/internal/filter/interaction"
|
||||||
|
|
@ -85,7 +85,7 @@ func (suite *StatusStandardTestSuite) SetupTest() {
|
||||||
suite.db = testrig.NewTestDB(&suite.state)
|
suite.db = testrig.NewTestDB(&suite.state)
|
||||||
suite.typeConverter = typeutils.NewConverter(&suite.state)
|
suite.typeConverter = typeutils.NewConverter(&suite.state)
|
||||||
suite.state.DB = suite.db
|
suite.state.DB = suite.db
|
||||||
suite.state.Actions = actions.New(suite.state.DB, &suite.state.Workers)
|
suite.state.AdminActions = admin.New(suite.state.DB, &suite.state.Workers)
|
||||||
|
|
||||||
suite.tc = testrig.NewTestTransportController(&suite.state, testrig.NewMockHTTPClient(nil, "../../../testrig/media"))
|
suite.tc = testrig.NewTestTransportController(&suite.state, testrig.NewMockHTTPClient(nil, "../../../testrig/media"))
|
||||||
suite.storage = testrig.NewInMemoryStorage()
|
suite.storage = testrig.NewInMemoryStorage()
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ package stream_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
"github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
|
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/oauth"
|
"github.com/superseriousbusiness/gotosocial/internal/oauth"
|
||||||
|
|
@ -51,7 +51,7 @@ func (suite *StreamTestSuite) SetupTest() {
|
||||||
suite.testTokens = testrig.NewTestTokens()
|
suite.testTokens = testrig.NewTestTokens()
|
||||||
suite.db = testrig.NewTestDB(&suite.state)
|
suite.db = testrig.NewTestDB(&suite.state)
|
||||||
suite.state.DB = suite.db
|
suite.state.DB = suite.db
|
||||||
suite.state.Actions = actions.New(suite.state.DB, &suite.state.Workers)
|
suite.state.AdminActions = admin.New(suite.state.DB, &suite.state.Workers)
|
||||||
suite.oauthServer = testrig.NewTestOauthServer(suite.db)
|
suite.oauthServer = testrig.NewTestOauthServer(suite.db)
|
||||||
suite.streamProcessor = stream.New(&suite.state, suite.oauthServer)
|
suite.streamProcessor = stream.New(&suite.state, suite.oauthServer)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ package timeline_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
"github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/filter/visibility"
|
"github.com/superseriousbusiness/gotosocial/internal/filter/visibility"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
|
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
|
||||||
|
|
@ -56,7 +56,7 @@ func (suite *TimelineStandardTestSuite) SetupTest() {
|
||||||
|
|
||||||
suite.db = testrig.NewTestDB(&suite.state)
|
suite.db = testrig.NewTestDB(&suite.state)
|
||||||
suite.state.DB = suite.db
|
suite.state.DB = suite.db
|
||||||
suite.state.Actions = actions.New(suite.state.DB, &suite.state.Workers)
|
suite.state.AdminActions = admin.New(suite.state.DB, &suite.state.Workers)
|
||||||
|
|
||||||
suite.timeline = timeline.New(
|
suite.timeline = timeline.New(
|
||||||
&suite.state,
|
&suite.state,
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ package user_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
"github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/email"
|
"github.com/superseriousbusiness/gotosocial/internal/email"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
|
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
|
||||||
|
|
@ -50,7 +50,7 @@ func (suite *UserStandardTestSuite) SetupTest() {
|
||||||
|
|
||||||
suite.db = testrig.NewTestDB(&suite.state)
|
suite.db = testrig.NewTestDB(&suite.state)
|
||||||
suite.state.DB = suite.db
|
suite.state.DB = suite.db
|
||||||
suite.state.Actions = actions.New(suite.state.DB, &suite.state.Workers)
|
suite.state.AdminActions = admin.New(suite.state.DB, &suite.state.Workers)
|
||||||
|
|
||||||
suite.sentEmails = make(map[string]string)
|
suite.sentEmails = make(map[string]string)
|
||||||
suite.emailSender = testrig.NewEmailSender("../../../web/template/", suite.sentEmails)
|
suite.emailSender = testrig.NewEmailSender("../../../web/template/", suite.sentEmails)
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ package state
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"codeberg.org/gruf/go-mutexes"
|
"codeberg.org/gruf/go-mutexes"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
"github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/cache"
|
"github.com/superseriousbusiness/gotosocial/internal/cache"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/storage"
|
"github.com/superseriousbusiness/gotosocial/internal/storage"
|
||||||
|
|
@ -68,7 +68,7 @@ type State struct {
|
||||||
|
|
||||||
// Struct to manage running admin
|
// Struct to manage running admin
|
||||||
// actions (and locks thereupon).
|
// actions (and locks thereupon).
|
||||||
Actions *actions.Actions
|
AdminActions *admin.Actions
|
||||||
|
|
||||||
// prevent pass-by-value.
|
// prevent pass-by-value.
|
||||||
_ nocopy
|
_ nocopy
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ import (
|
||||||
"codeberg.org/gruf/go-kv"
|
"codeberg.org/gruf/go-kv"
|
||||||
|
|
||||||
"github.com/miekg/dns"
|
"github.com/miekg/dns"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
"github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||||
apimodel "github.com/superseriousbusiness/gotosocial/internal/api/model"
|
apimodel "github.com/superseriousbusiness/gotosocial/internal/api/model"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/config"
|
"github.com/superseriousbusiness/gotosocial/internal/config"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||||
|
|
@ -434,7 +434,7 @@ func (s *Subscriptions) processDomainPermission(
|
||||||
var (
|
var (
|
||||||
insertF func() error
|
insertF func() error
|
||||||
action *gtsmodel.AdminAction
|
action *gtsmodel.AdminAction
|
||||||
actionF actions.AdminActionF
|
actionF admin.AdminActionF
|
||||||
)
|
)
|
||||||
|
|
||||||
if permSub.PermissionType == gtsmodel.DomainPermissionBlock {
|
if permSub.PermissionType == gtsmodel.DomainPermissionBlock {
|
||||||
|
|
@ -458,7 +458,7 @@ func (s *Subscriptions) processDomainPermission(
|
||||||
Type: gtsmodel.AdminActionSuspend,
|
Type: gtsmodel.AdminActionSuspend,
|
||||||
AccountID: permSub.CreatedByAccountID,
|
AccountID: permSub.CreatedByAccountID,
|
||||||
}
|
}
|
||||||
actionF = s.state.Actions.DomainBlockF(action.ID, domainBlock)
|
actionF = s.state.AdminActions.DomainBlockF(action.ID, domainBlock)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// Prepare to insert + process an allow.
|
// Prepare to insert + process an allow.
|
||||||
|
|
@ -481,7 +481,7 @@ func (s *Subscriptions) processDomainPermission(
|
||||||
Type: gtsmodel.AdminActionUnsuspend,
|
Type: gtsmodel.AdminActionUnsuspend,
|
||||||
AccountID: permSub.CreatedByAccountID,
|
AccountID: permSub.CreatedByAccountID,
|
||||||
}
|
}
|
||||||
actionF = s.state.Actions.DomainAllowF(action.ID, domainAllow)
|
actionF = s.state.AdminActions.DomainAllowF(action.ID, domainAllow)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Insert the new perm in the db.
|
// Insert the new perm in the db.
|
||||||
|
|
@ -493,7 +493,7 @@ func (s *Subscriptions) processDomainPermission(
|
||||||
|
|
||||||
// Run admin action to process
|
// Run admin action to process
|
||||||
// side effects of permission.
|
// side effects of permission.
|
||||||
err = s.state.Actions.Run(ctx, action, actionF)
|
err = s.state.AdminActions.Run(ctx, action, actionF)
|
||||||
|
|
||||||
case existingPerm.GetSubscriptionID() != "" || *permSub.AdoptOrphans:
|
case existingPerm.GetSubscriptionID() != "" || *permSub.AdoptOrphans:
|
||||||
// Perm exists but we should adopt/take
|
// Perm exists but we should adopt/take
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
"github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/email"
|
"github.com/superseriousbusiness/gotosocial/internal/email"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/federation"
|
"github.com/superseriousbusiness/gotosocial/internal/federation"
|
||||||
|
|
@ -75,7 +75,7 @@ func (suite *TransportTestSuite) SetupTest() {
|
||||||
|
|
||||||
suite.db = testrig.NewTestDB(&suite.state)
|
suite.db = testrig.NewTestDB(&suite.state)
|
||||||
suite.state.DB = suite.db
|
suite.state.DB = suite.db
|
||||||
suite.state.Actions = actions.New(suite.state.DB, &suite.state.Workers)
|
suite.state.AdminActions = admin.New(suite.state.DB, &suite.state.Workers)
|
||||||
suite.storage = testrig.NewInMemoryStorage()
|
suite.storage = testrig.NewInMemoryStorage()
|
||||||
suite.state.Storage = suite.storage
|
suite.state.Storage = suite.storage
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ package typeutils_test
|
||||||
import (
|
import (
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
"github.com/superseriousbusiness/activity/streams/vocab"
|
"github.com/superseriousbusiness/activity/streams/vocab"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
"github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/filter/visibility"
|
"github.com/superseriousbusiness/gotosocial/internal/filter/visibility"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
|
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
|
||||||
|
|
@ -500,7 +500,7 @@ func (suite *TypeUtilsTestSuite) SetupTest() {
|
||||||
|
|
||||||
suite.db = testrig.NewTestDB(&suite.state)
|
suite.db = testrig.NewTestDB(&suite.state)
|
||||||
suite.state.DB = suite.db
|
suite.state.DB = suite.db
|
||||||
suite.state.Actions = actions.New(suite.state.DB, &suite.state.Workers)
|
suite.state.AdminActions = admin.New(suite.state.DB, &suite.state.Workers)
|
||||||
storage := testrig.NewInMemoryStorage()
|
storage := testrig.NewInMemoryStorage()
|
||||||
suite.state.Storage = storage
|
suite.state.Storage = storage
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
package testrig
|
package testrig
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
"github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/cleaner"
|
"github.com/superseriousbusiness/gotosocial/internal/cleaner"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/email"
|
"github.com/superseriousbusiness/gotosocial/internal/email"
|
||||||
"github.com/superseriousbusiness/gotosocial/internal/filter/interaction"
|
"github.com/superseriousbusiness/gotosocial/internal/filter/interaction"
|
||||||
|
|
@ -60,7 +60,7 @@ func SetupTestStructs(
|
||||||
|
|
||||||
db := NewTestDB(&state)
|
db := NewTestDB(&state)
|
||||||
state.DB = db
|
state.DB = db
|
||||||
state.Actions = actions.New(db, &state.Workers)
|
state.AdminActions = admin.New(db, &state.Workers)
|
||||||
|
|
||||||
storage := NewInMemoryStorage()
|
storage := NewInMemoryStorage()
|
||||||
state.Storage = storage
|
state.Storage = storage
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue