Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use t.Context() instead of context.Background() for test #195

Merged
merged 1 commit into from
Mar 2, 2025

Conversation

catatsuy
Copy link
Owner

@catatsuy catatsuy commented Mar 2, 2025

This pull request includes several updates to the Go version and refactors tests to use the testing context. The most important changes include updating the Go version in the workflow and module files, and refactoring multiple test files to replace context.Background() with t.Context().

Go Version Update:

Test Refactoring:

  • internal/cli/cli_test.go: Refactored the TestUploadSnippet function to use t.Context() instead of context.Background(). [1] [2] [3] [4]
  • internal/slack/client_test.go: Refactored multiple test functions (TestPostText_Success, TestPostText_Fail, TestPostFile_Success, TestPostFile_FailCallFunc, TestPostFile_FailAPINotOK, TestPostFile_FailAPIStatusOK, TestPostFile_FailBrokenJSON, TestUploadToURL_success, TestUploadToURL_fail, TestCompleteUploadExternal_Success) to use t.Context() instead of context.Background(). [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]
  • internal/throttle/exec_test.go: Refactored the TestRun_pipeClose and TestRun_contextDone functions to use t.Context() instead of context.Background(). [1] [2]

@catatsuy catatsuy merged commit a4389fe into master Mar 2, 2025
5 checks passed
@catatsuy catatsuy deleted the feature-use-t-context branch March 2, 2025 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant