diff options
| author | 2025-05-22 12:26:11 +0200 | |
|---|---|---|
| committer | 2025-05-22 12:26:11 +0200 | |
| commit | d5c9c4adc167cdb05e73f5105702cf340293e61c (patch) | |
| tree | 1d21fe376099864900837eba675a965517f98e5d /internal/processing/admin/domainpermission_test.go | |
| parent | [feature] Allow exposing allows, implement `/api/v1/domain_blocks` and `/api/... (diff) | |
| download | gotosocial-d5c9c4adc167cdb05e73f5105702cf340293e61c.tar.xz | |
[chore] Upgrade to Go 1.24 (#4187)
* Set `go.mod` to 1.24 now that it's been out for 3 months.
* Update all the test to use `testing.T.Context()`.
Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4187
Co-authored-by: Daenney <git@noreply.sourcery.dny.nu>
Co-committed-by: Daenney <git@noreply.sourcery.dny.nu>
Diffstat (limited to 'internal/processing/admin/domainpermission_test.go')
| -rw-r--r-- | internal/processing/admin/domainpermission_test.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/internal/processing/admin/domainpermission_test.go b/internal/processing/admin/domainpermission_test.go index f53c241b6..fccb9e10f 100644 --- a/internal/processing/admin/domainpermission_test.go +++ b/internal/processing/admin/domainpermission_test.go @@ -82,7 +82,7 @@ func (suite *DomainBlockTestSuite) runDomainPermTest(t domainPermTest) { config.SetInstanceFederationMode(t.instanceFederationMode) for _, action := range t.actions { - ctx, cancel := context.WithCancel(context.Background()) + ctx, cancel := context.WithCancel(suite.T().Context()) defer cancel() // Run the desired action. @@ -102,7 +102,7 @@ func (suite *DomainBlockTestSuite) runDomainPermTest(t domainPermTest) { // Check expected results // against each account. accounts, err := suite.db.GetInstanceAccounts( - context.Background(), + suite.T().Context(), action.domain, "", 0, ) @@ -123,7 +123,7 @@ func (suite *DomainBlockTestSuite) createDomainPerm( permissionType gtsmodel.DomainPermissionType, domain string, ) (*apimodel.DomainPermission, string) { - ctx := context.Background() + ctx := suite.T().Context() apiPerm, actionID, errWithCode := suite.adminProcessor.DomainPermissionCreate( ctx, @@ -148,7 +148,7 @@ func (suite *DomainBlockTestSuite) deleteDomainPerm( domain string, ) (*apimodel.DomainPermission, string) { var ( - ctx = context.Background() + ctx = suite.T().Context() domainPermission gtsmodel.DomainPermission ) @@ -183,7 +183,7 @@ func (suite *DomainBlockTestSuite) deleteDomainPerm( // waits for given actionID to be completed. func (suite *DomainBlockTestSuite) awaitAction(actionID string) { - ctx := context.Background() + ctx := suite.T().Context() if !testrig.WaitFor(func() bool { return suite.state.AdminActions.TotalRunning() == 0 |
