-
Notifications
You must be signed in to change notification settings - Fork 216
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
regenerate mocks under client to allow dynamic returns based on arguments #1353
regenerate mocks under client to allow dynamic returns based on arguments #1353
Conversation
Please approve CLA and fix copyright headers of files |
signed CLA and iterated the PR. |
one CI job failed. somehow I cannot find a way to re trigger the job. I locally ran this test and passed. Looks like rerun should be also resolve it. Could you please help rerun the failed CI jobs? |
mocks/Client.go
Outdated
@@ -162,23 +228,30 @@ func (_m *Client) DescribeWorkflowExecution(ctx context.Context, workflowID stri | |||
} | |||
|
|||
// ExecuteWorkflow provides a mock function with given fields: ctx, options, workflow, args | |||
func (_m *Client) ExecuteWorkflow(ctx context.Context, options client.StartWorkflowOptions, workflow interface{}, args ...interface{}) (client.WorkflowRun, error) { |
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.
All these internal.*
need to be replaced by the appropriate exposed type.
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.
@Quinn-With-Two-Ns
thanks for review.
Actually internal.WorkflowRun
is equivalent to client.WorkflowRun
. FYI.
Line 100 in 41d2288
WorkflowRun = internal.WorkflowRun |
I will still make the change
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.
@Quinn-With-Two-Ns iterated. Not sure why build-and-test is not started. Is it just slow?
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.
It requires manual approval
16c1898
to
d0a3fcc
Compare
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.
Thanks for the contribution
Thanks. Looks like I don't have permission to merge. What is the process for merging the PR ? And I have another PR that completes the all existing mockers under We can do two merges. But happy to help merge with one PR here if you think it's necessary. |
What was changed
mocker for interfaces under
client
folderWhy?
Looks the mocks are old and only supports returning value rather than the function.
With updated mocker by latest mockery, (example https://github.com/temporalio/sdk-go/compare/master...yinsidij:yjiao/regenerate_mocks?expand=1#diff-baf21238e036d6550f43915acceadaf7448d1ff493453a0da0d41a232e20fa6fR217)
It allows dynamic return based on argument.
For example, with the newly generated mock, we could do following that provides more flexibility.
Checklist
Closes
How was this tested: