Migrate tests/activity_test.go to testEnv#9678
Closed
chaptersix wants to merge 4 commits intotemporalio:mainfrom
Closed
Migrate tests/activity_test.go to testEnv#9678chaptersix wants to merge 4 commits intotemporalio:mainfrom
chaptersix wants to merge 4 commits intotemporalio:mainfrom
Conversation
Convert ActivityTestSuite and ActivityClientTestSuite from suite-based testing (FunctionalTestBase + testify suite.Run) to function-based testcore.NewEnv() pattern. Convert helper method mockWorkflowWithErrorActivity to package-level function.
Add default cases to switch statements to satisfy enforce-switch-style. Restructure goroutines to move require assertions back to the test goroutine, satisfying the go-require lint rule. Add context-based cancellation to channel operations in activity handlers so goroutines don't hang if the test fails early.
Add default cases to switch statements to satisfy enforce-switch-style. Restructure goroutines to move require assertions back to the test goroutine, satisfying the go-require lint rule. Add context-based cancellation to channel operations in activity handlers and test goroutines so they don't hang if the test fails early.
Contributor
Author
|
hard to track the changes via diff. will need to take a closer look later. |
Move each test body from inline t.Run closures to standalone package-level functions taking *testcore.TestEnv. This avoids the extra indentation level that was inflating the diff vs main. Mark TestActivityTestSuite as MustRunSequential since it contains timing-sensitive cancellation and heartbeat tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ActivityTestSuiteandActivityClientTestSuitefrom suite-based testing (FunctionalTestBase+ testifysuite.Run) to function-basedtestcore.NewEnv()patternmockWorkflowWithErrorActivityhelper from receiver method to package-level functionTest plan
make lintpasses cleango test -run TestActivityTestSuite ./tests/...-- 9/9 passgo test -run TestActivityClientTestSuite ./tests/...-- 5/5 pass