Skip to content

Make it possible to use context in WorkflowRehearsal Test Cases #275

@jpavlav

Description

@jpavlav

I was working on some unit tests for some st2 workflows and the WorkflowRehearsal test case doesn't account for times when the st2 context may be accessed in the workflow. I have a workflow that defines in the vars section a variable that includes st2.action_execution_id. It results in an exception like this one:

E   AssertionError: {'context': [{'type': 'yaql', 'expression'[161 chars]t'}]} != {}
E   + {}
E   - {'context': [{'expression': '<% ctx().st2.action_execution_id %>',
E   -               'message': 'Variable "st2" is referenced before assignment.',
E   -               'schema_path': 'properties.output',
E   -               'spec_path': 'output[1]',
E   -               'type': 'yaql'}]}

It would be useful to be able to pass in context to the WorkflowTestCase spec and then update the WorkflowRehearsal test case to make use of it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions