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.
I was working on some unit tests for some
st2workflows and theWorkflowRehearsaltest case doesn't account for times when thest2context may be accessed in the workflow. I have a workflow that defines in thevarssection a variable that includesst2.action_execution_id. It results in an exception like this one:It would be useful to be able to pass in
contextto theWorkflowTestCasespec and then update theWorkflowRehearsaltest case to make use of it.