@mock.patch.object(action_db_util, 'get_action_by_ref',
                       mock.MagicMock(return_value=ACTION_1))
    @mock.patch.object(action_service, 'request', return_value=(DummyActionExecution(), None))
    def test_chain_runner_failure_during_param_rendering_single_task(self, request):
        # Parameter rendering should result in a top level error which aborts
        # the whole chain
        chain_runner = acr.get_runner()
        chain_runner.entry_point = CHAIN_FIRST_TASK_RENDER_FAIL_PATH
        chain_runner.action = ACTION_1
        chain_runner.container_service = RunnerContainerService()
        chain_runner.pre_run()
        status, result, _ = chain_runner.run({})

        # No tasks ran because rendering of parameters for the first task failed
        self.assertEqual(status, LIVEACTION_STATUS_FAILED)
        self.assertEqual(result['tasks'], [])
        self.assertTrue('error' in result)
        self.assertTrue('traceback' in result)
        self.assertTrue('Failed to run task "c1". Parameter rendering failed' in result['error'])
        self.assertTrue('Traceback' in result['traceback'])
dataset/ETHPy150Open StackStorm/st2/st2actions/tests/unit/test_actionchain.py/TestActionChainRunner.test_chain_runner_failure_during_param_rendering_single_task/original