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/db/bundb/application_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'internal/db/bundb/application_test.go') diff --git a/internal/db/bundb/application_test.go b/internal/db/bundb/application_test.go index 858cb15b6..a9ef80ce4 100644 --- a/internal/db/bundb/application_test.go +++ b/internal/db/bundb/application_test.go @@ -36,7 +36,7 @@ func (suite *ApplicationTestSuite) TestGetApplicationBy() { t := suite.T() // Create a new context for this test. - ctx, cncl := context.WithCancel(context.Background()) + ctx, cncl := context.WithCancel(suite.T().Context()) defer cncl() // Sentinel error to mark avoiding a test case. @@ -86,7 +86,7 @@ func (suite *ApplicationTestSuite) TestDeleteApplicationBy() { t := suite.T() // Create a new context for this test. - ctx, cncl := context.WithCancel(context.Background()) + ctx, cncl := context.WithCancel(suite.T().Context()) defer cncl() for _, app := range suite.testApplications { @@ -117,7 +117,7 @@ func (suite *ApplicationTestSuite) TestDeleteApplicationBy() { } func (suite *ApplicationTestSuite) TestGetAllTokens() { - tokens, err := suite.db.GetAllTokens(context.Background()) + tokens, err := suite.db.GetAllTokens(suite.T().Context()) if err != nil { suite.FailNow(err.Error()) } @@ -125,7 +125,7 @@ func (suite *ApplicationTestSuite) TestGetAllTokens() { } func (suite *ApplicationTestSuite) TestDeleteTokensByClientID() { - ctx := context.Background() + ctx := suite.T().Context() // Delete tokens by each app. for _, app := range suite.testApplications { @@ -147,7 +147,7 @@ func (suite *ApplicationTestSuite) TestDeleteTokensByUnknownClientID() { // Should not return ErrNoRows even though // the client with given ID doesn't exist. if err := suite.state.DB.DeleteTokensByClientID( - context.Background(), + suite.T().Context(), "01JPJ4NCGH6GHY7ZVYBHNP55XS", ); err != nil { suite.FailNow(err.Error()) -- cgit v1.2.3