From d5c9c4adc167cdb05e73f5105702cf340293e61c Mon Sep 17 00:00:00 2001 From: Daenney Date: Thu, 22 May 2025 12:26:11 +0200 Subject: [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 Co-committed-by: Daenney --- internal/subscriptions/subscriptions_test.go | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'internal/subscriptions/subscriptions_test.go') diff --git a/internal/subscriptions/subscriptions_test.go b/internal/subscriptions/subscriptions_test.go index b334207e4..8e292209d 100644 --- a/internal/subscriptions/subscriptions_test.go +++ b/internal/subscriptions/subscriptions_test.go @@ -18,7 +18,6 @@ package subscriptions_test import ( - "context" "errors" "testing" "time" @@ -51,7 +50,7 @@ func (suite *SubscriptionsTestSuite) SetupSuite() { func (suite *SubscriptionsTestSuite) TestDomainBlocksCSV() { var ( - ctx = context.Background() + ctx = suite.T().Context() testStructs = testrig.SetupTestStructs(rMediaPath, rTemplatePath) testAccount = suite.testAccounts["admin_account"] subscriptions = subscriptions.New( @@ -131,7 +130,7 @@ func (suite *SubscriptionsTestSuite) TestDomainBlocksCSV() { func (suite *SubscriptionsTestSuite) TestDomainBlocksJSON() { var ( - ctx = context.Background() + ctx = suite.T().Context() testStructs = testrig.SetupTestStructs(rMediaPath, rTemplatePath) testAccount = suite.testAccounts["admin_account"] subscriptions = subscriptions.New( @@ -211,7 +210,7 @@ func (suite *SubscriptionsTestSuite) TestDomainBlocksJSON() { func (suite *SubscriptionsTestSuite) TestDomainBlocksPlain() { var ( - ctx = context.Background() + ctx = suite.T().Context() testStructs = testrig.SetupTestStructs(rMediaPath, rTemplatePath) testAccount = suite.testAccounts["admin_account"] subscriptions = subscriptions.New( @@ -291,7 +290,7 @@ func (suite *SubscriptionsTestSuite) TestDomainBlocksPlain() { func (suite *SubscriptionsTestSuite) TestDomainBlocksCSVCaching() { var ( - ctx = context.Background() + ctx = suite.T().Context() testStructs = testrig.SetupTestStructs(rMediaPath, rTemplatePath) testAccount = suite.testAccounts["admin_account"] subscriptions = subscriptions.New( @@ -367,7 +366,7 @@ func (suite *SubscriptionsTestSuite) TestDomainBlocksCSVCaching() { func (suite *SubscriptionsTestSuite) TestDomainBlocksCSVFutureLastModified() { var ( - ctx = context.Background() + ctx = suite.T().Context() testStructs = testrig.SetupTestStructs(rMediaPath, rTemplatePath) testAccount = suite.testAccounts["admin_account"] subscriptions = subscriptions.New( @@ -439,7 +438,7 @@ func (suite *SubscriptionsTestSuite) TestDomainBlocksCSVFutureLastModified() { func (suite *SubscriptionsTestSuite) TestDomainBlocksCSVGarbageLastModified() { var ( - ctx = context.Background() + ctx = suite.T().Context() testStructs = testrig.SetupTestStructs(rMediaPath, rTemplatePath) testAccount = suite.testAccounts["admin_account"] subscriptions = subscriptions.New( @@ -511,7 +510,7 @@ func (suite *SubscriptionsTestSuite) TestDomainBlocksCSVGarbageLastModified() { func (suite *SubscriptionsTestSuite) TestDomainBlocks404() { var ( - ctx = context.Background() + ctx = suite.T().Context() testStructs = testrig.SetupTestStructs(rMediaPath, rTemplatePath) testAccount = suite.testAccounts["admin_account"] subscriptions = subscriptions.New( @@ -569,7 +568,7 @@ func (suite *SubscriptionsTestSuite) TestDomainBlocks404() { func (suite *SubscriptionsTestSuite) TestDomainBlocksWrongContentTypeCSV() { var ( - ctx = context.Background() + ctx = suite.T().Context() testStructs = testrig.SetupTestStructs(rMediaPath, rTemplatePath) testAccount = suite.testAccounts["admin_account"] subscriptions = subscriptions.New( @@ -627,7 +626,7 @@ func (suite *SubscriptionsTestSuite) TestDomainBlocksWrongContentTypeCSV() { func (suite *SubscriptionsTestSuite) TestDomainBlocksWrongContentTypePlain() { var ( - ctx = context.Background() + ctx = suite.T().Context() testStructs = testrig.SetupTestStructs(rMediaPath, rTemplatePath) testAccount = suite.testAccounts["admin_account"] subscriptions = subscriptions.New( @@ -685,7 +684,7 @@ func (suite *SubscriptionsTestSuite) TestDomainBlocksWrongContentTypePlain() { func (suite *SubscriptionsTestSuite) TestAdoption() { var ( - ctx = context.Background() + ctx = suite.T().Context() testStructs = testrig.SetupTestStructs(rMediaPath, rTemplatePath) testAccount = suite.testAccounts["admin_account"] subscriptions = subscriptions.New( @@ -817,7 +816,7 @@ func (suite *SubscriptionsTestSuite) TestAdoption() { func (suite *SubscriptionsTestSuite) TestDomainAllowsAndBlocks() { var ( - ctx = context.Background() + ctx = suite.T().Context() testStructs = testrig.SetupTestStructs(rMediaPath, rTemplatePath) testAccount = suite.testAccounts["admin_account"] subscriptions = subscriptions.New( -- cgit v1.2.3