-
Notifications
You must be signed in to change notification settings - Fork 55
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
IWF-103: Require every commandId to exist for ANY_COMMAND_COMBINATION_COMPLETED #423
Conversation
75cb3b2
to
8241e7b
Compare
8241e7b
to
3bb3920
Compare
service/interpreter/activityImpl.go
Outdated
@@ -224,12 +225,42 @@ func checkCommandRequestFromWaitUntilResponse(resp *iwfidl.WorkflowStateStartRes | |||
return err | |||
} | |||
} | |||
// Check if each command in the combinations has a matching command in one of the lists | |||
if !areAllCommandCombinationsIdsValid(commandReq) { | |||
return fmt.Errorf("ANY_COMMAND_COMBINATION_COMPLETED can only be used when every command has an commandId that is found in TimerCommands, SignalCommands or InterStateChannelCommands") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
InterStateChannelCommands
has been renamed to InternalChannelCommand
. There are still many places in server that hasn't updated. But all the API and error message that it returned should be using the new name for consistency.
The code looks good. In next meeting, probably we can do unit tests together. I have been lazy to write unit tests but I think it's important. But it's also possible to write integ tests --
Actually, I did write some unit tests, also for golang sdk and samples: https://github.com/indeedeng/iwf/blob/main/service/common/log/loggerimpl/logger_test.go https://github.com/indeedeng/iwf-golang-sdk/tree/main/iwftest https://github.com/indeedeng/iwf-golang-sdk/blob/main/iwftest/example/example_test.go gomock is probably the best option for mocking in my experience, also seems like people like it in the golang community: https://www.reddit.com/r/golang/comments/qe4a1c/what_mocking_framework_do_you_prefer/ |
Added unit tests |
No description provided.