Add chasm.Context.ExecutionKey() method#8533
Merged
Merged
Conversation
yycptt
approved these changes
Oct 24, 2025
Member
yycptt
left a comment
There was a problem hiding this comment.
Thanks for the renaming and new docstring!
11c55a7 to
1deea1a
Compare
1deea1a to
cd4c58a
Compare
yycptt
approved these changes
Oct 24, 2025
| ) | ||
|
|
||
| // MockNodeBackend is a lightweight manual mock for the NodeBackend interface. | ||
| // Methods may be stubbed by assigning the corresponding Handle fields. Call history |
Member
There was a problem hiding this comment.
Suggested change
| // Methods may be stubbed by assigning the corresponding Handle fields. Call history | |
| // Methods may be stubbed by assigning the corresponding Handle fields. Update call history |
| // Methods may be stubbed by assigning the corresponding Handle fields. Call history | ||
| // is recorded in the struct fields (thread-safe). | ||
| type MockNodePureTask struct { | ||
| HandleExecutePureTask func(baseCtx context.Context, taskAttributes TaskAttributes, taskInstance any) (bool, error) |
Member
There was a problem hiding this comment.
I think Execute only returns an error
| } | ||
| nodeBackend.EXPECT().CurrentVersionedTransition().Return(currentVT).AnyTimes() | ||
| nodeBackend.EXPECT().AddTasks(gomock.Any()).Return().AnyTimes() | ||
| nodeBackend.HandleIsWorkflow = func() bool { return false } |
Member
There was a problem hiding this comment.
nit: not needed and duplicates L91
| TransitionCount: 1, | ||
| nodeBackend.HandleNextTransitionCount = func() int64 { return 2 } | ||
| nodeBackend.HandleGetCurrentVersion = func() int64 { return 1 } | ||
| nodeBackend.HandleGetWorkflowKey = tv.Any().WorkflowKey |
Member
There was a problem hiding this comment.
nit: maybe tv.Any().WorkflowKey can be the default?
| HandleCurrentVersionedTransition: func() *persistencespb.VersionedTransition { | ||
| return &persistencespb.VersionedTransition{ | ||
| NamespaceFailoverVersion: 1, | ||
| TransitionCount: 2, |
Member
There was a problem hiding this comment.
Suggested change
| TransitionCount: 2, | |
| TransitionCount: 1, |
Comment on lines
-1903
to
-1906
| s.nodeBackend.EXPECT().UpdateWorkflowStateStatus( | ||
| enumsspb.WORKFLOW_EXECUTION_STATE_COMPLETED, | ||
| enumspb.WORKFLOW_EXECUTION_STATUS_TERMINATED, | ||
| ).Return(true, nil).Times(1) |
Member
There was a problem hiding this comment.
I do want to validate those Update calls and the state & status parameter.
Comment on lines
-2512
to
-2515
| s.nodeBackend.EXPECT().UpdateWorkflowStateStatus( | ||
| enumsspb.WORKFLOW_EXECUTION_STATE_COMPLETED, | ||
| enumspb.WORKFLOW_EXECUTION_STATUS_TERMINATED, | ||
| ).Return(true, nil).Times(1) |
|
|
||
| func (s *nodeSuite) TestExecuteImmediatePureTask() { | ||
| tv := testvars.New(s.T()) | ||
| // tv := testvars.New(s.T()) |
5 tasks
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.
What changed?
context.goto use better struct names and unexport concepts that should not be exported