def test_join_with_long_name(self): long_task_name = utils.generate_string( tasks_lang.MAX_LENGTH_JOIN_TASK_NAME) wf_text = """--- version: '2.0' wf: tasks: task1: on-success: - {0} task2: on-success: - {0} {0}: join: all """.format(long_task_name) wf_service.create_workflows(wf_text) wf_ex = self.engine.start_workflow('wf') self.await_workflow_success(wf_ex.id) with db_api.transaction(): wf_ex = db_api.get_workflow_execution(wf_ex.id) tasks = wf_ex.task_executions task1 = self._assert_single_item(tasks, name='task1') task2 = self._assert_single_item(tasks, name='task2') task3 = self._assert_single_item(tasks, name=long_task_name) self.assertEqual(states.SUCCESS, task1.state) self.assertEqual(states.SUCCESS, task2.state) self.assertEqual(states.SUCCESS, task3.state)
def test_with_long_task_name(self): long_task_name = utils.generate_string(tasks.MAX_LENGTH_TASK_NAME + 1) workflow = WORKFLOW_WITH_LONG_TASK_NAME.format( long_task_name=long_task_name) self.assertRaises(exc.InvalidModelException, wf_service.create_workflows, workflow)
def test_upper_bound_length_join_task_name(self): long_task_name = utils.generate_string(tasks.MAX_LENGTH_JOIN_TASK_NAME) wf_text = WORKFLOW_WITH_LONG_JOIN_TASK_NAME.format( long_task_name=long_task_name) wf_defs = wf_service.create_workflows(wf_text) self.assertIsNotNone(wf_defs) self.assertEqual(1, len(wf_defs))