示例#1
0
    def setUp(self):
        super(LongActionTest, self).setUp()

        global ACTION_SEMAPHORE
        global TEST_SEMAPHORE

        ACTION_SEMAPHORE = semaphore.Semaphore(1)
        TEST_SEMAPHORE = semaphore.Semaphore(0)

        test_base.register_action_class('test.block', BlockingAction)
示例#2
0
    def test_with_items_results_order(self):
        workbook = """---
        version: "2.0"

        name: wb1

        workflows:
          with_items:
            type: direct

            tasks:
              task1:
                with-items: i in [1, 2, 3]
                action: sleep_echo output=<% $.i %>
                publish:
                  one_two_three: <% $.task1 %>
        """
        # Register random sleep action in the DB.
        test_base.register_action_class('sleep_echo', RandomSleepEchoAction)

        wb_service.create_workbook_v2(workbook)

        # Start workflow.
        wf_ex = self.engine.start_workflow('wb1.with_items', {})

        self._await(
            lambda: self.is_execution_success(wf_ex.id),
        )

        # Note: We need to reread execution to access related tasks.
        wf_ex = db_api.get_workflow_execution(wf_ex.id)

        tasks = wf_ex.task_executions
        task1 = self._assert_single_item(tasks, name='task1')

        self.assertEqual(states.SUCCESS, task1.state)

        published = task1.published

        # Now we can check order of results explicitly.
        self.assertEqual([1, 2, 3], published['one_two_three'])
 def setUp(self):
     """Resets the size limit config between tests"""
     super(ExecutionFieldsSizeLimitTest, self).setUp()
     cfg.CONF.set_default('execution_field_size_limit_kb', 0,
                          group='engine')
     test_base.register_action_class('my_action', MyAction)
示例#4
0
    def setUp(self):
        super(ErrorResultTest, self).setUp()

        test_base.register_action_class("my_action", MyAction)