Skip to content

Allow Replay to expose Query and Completion results for testing #681

Open
@samarabbas

Description

@samarabbas

Cadence client API like ReplayWorkflowHistoryFromJSONFile is used for protection against non-backward compatible changes to workflow implementation. The idea is to store sample of some execution histories and then have a unit test which replay new workflow implementation using ReplayWorkflowHistoryFromJSONFile API to look for non determinism error. This provides good protection if user makes non-backwards compatible changes in the workflow implementation resulting in different code path which triggers different decisions by the workflow implementation. Cadence client can easily detect such changes and fail unit test by throwing non-deterministic error.
Current approach does not work for the following 2 use cases:

  1. Workflow implementation makes a non-backwards compatible change to local state within workflow implementation which does not result into different decision on replay.
  2. Workflow implementation completes/ContinueAsNew with a different result.

Straw-man proposal to allow user to add protection for above 2 cases by having more fine grained semantics exposed through replay API. We need a replayer API to allow following:

  1. Capability to replay upto various event id
  2. Allow Query results to be exposed to caller after replay
  3. Allow Completion/ContinueAsNew result to be exposed to caller after replay

With these capabilities we believe clients should be able to add protection for non-backward compatible changes as part unit test by asserting internal workflow state during replay.

Metadata

Metadata

Assignees

No one assigned

    Labels

    customercustomer requestedfeaturenew feature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions