Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Export SetContinuedAsNewRunID in the TestWorkflowEnvironment
When building some workflows ("actors" like ones are a good example), you sometimes want to be able to distinguish when a workflow is starting and when it's being continued as new. This allows you to execute different behavior like restoring some state from an external system. One way to check if your current workflow execution has been continued as new is to inspect the workflow info ContinuedAsNewRunID field. When it's set, then you now you are not starting fresh. When testing such workflows though, you may want to test behavior only after a first ContinueAsNew call. The easiest way to do that is to setup the test environment to fill up the workflow info ContinuedAsNewRunID field. This is what this commit is doing, it extends the TestWorkflowEnvironment to expose a SetContinuedExecutionID field to an arbitrary value. This way in workflow unit tests, we can skip the code paths we don't care about and don't resort to mocking activities and child workflows for nothing leading to easier to implement and easier to read tests.
- Loading branch information