I’m trying to write tests for an activity that observes/queries another 2nd workflow.
Is there a way to manually populate the
workflowId when initializing a workflow in a test environment?
The activity calls
DescribeWorkflowExecution (with the specified workflowId) to check if it exists and get its status.
workflowId for the 2nd workflow is manually supplied when created
Have you considered heartbeating instead of DescribeWorkflowExecution? It is a much cleaner way to learn about workflow completion.
You can use
TestWorkflowEnvironment.SetStartWorkflowOptions to set the workflow ID.
Thanks for the feedback.
I will look into using heartbeating to refactor this in the future.
In the meantime, I had a couple follow up question about using
When I try to supply arguments to the method, it seems to want the arguments to be typed to the
internal.StartWorkflowOptions type, which doesn’t appear to be doable/recommended.
How would I define this helper to avoid the
Also, the setting is bound to the
s.env scope, but not seeing how to associate the workflowOptions just with one workflow registered in the test. What would happen if I registered multiple workflows in the test?
awesome, that did it.