Example #1
0
 def test_multi_process_executor_ok(self):
     """
     Test MultiProcExecutor::execute_steps
     """
     instance1 = SampleStep()
     instance2 = SampleStep()
     strategy = MultiProcExecutor([instance1, instance2])
     strategy.execute_steps(self._cmd_args)
Example #2
0
 def test_multi_process_executor_ok(self):
     """
     Test MultiProcExecutor::execute_steps
     """
     py_info = sys.version_info
     major_ver = py_info[0]
     minor_ver = py_info[1]
     py_ver = major_ver + minor_ver
     if py_ver >= self.MULTI_PROC_SUPPORT_VER:
         instance1 = SampleStep()
         instance2 = SampleStep()
         strategy = MultiProcExecutor([instance1, instance2])
         strategy.execute_steps(self._cmd_args)
Example #3
0
    def test_multi_process_error_stop(self):
        py_info = sys.version_info
        major_ver = py_info[0]
        minor_ver = py_info[1]
        py_ver = int(str(major_ver) + str(minor_ver))

        log = LisboaLog.get_logger(self.__class__.__name__)
        log.info(minor_ver)
        if py_ver >= self.MULTI_PROC_SUPPORT_VER:
            step1 = SampleStep()
            Helper.set_property(step1, "logger",
                                LisboaLog.get_logger(step1.__class__.__name__))
            step2 = ErrorSampleStep()
            Helper.set_property(step2, "logger",
                                LisboaLog.get_logger(step2.__class__.__name__))

            q = StepQueue()
            q.force_continue = False
            setattr(ScenarioQueue, "step_queue", q)

            executor = MultiProcExecutor([step1, step2])
            try:
                executor.execute_steps(None)
                self.fail("Error must be occured")
            except StepExecutionFailed:
                pass
Example #4
0
 def test_single_process_executor_ok(self):
     """
     Test SingleProcExecutor::execute_steps
     """
     instance = SampleStep()
     strategy = SingleProcExecutor([instance])
     strategy.execute_steps(self._cmd_args)
Example #5
0
 def test_execute_scenario_ok(self):
     """
     Test ScenarioWorker::execute_scenario
     """
     q = ScenarioQueue.step_queue
     instance = SampleStep()
     q.push([instance])
     worker = ScenarioWorker(self._cmd_args)
     worker.execute_scenario()
Example #6
0
    def test_multi_process_error_continue(self):
        py_info = sys.version_info
        major_ver = py_info[0]
        minor_ver = py_info[1]
        py_ver = int(str(major_ver) + str(minor_ver))

        if py_ver >= self.MULTI_PROC_SUPPORT_VER:
            step1 = SampleStep()
            Helper.set_property(step1, "logger",
                                LisboaLog.get_logger(step1.__class__.__name__))
            step2 = ErrorSampleStep()
            Helper.set_property(step2, "logger",
                                LisboaLog.get_logger(step2.__class__.__name__))

            q = StepQueue()
            q.force_continue = True
            setattr(ScenarioQueue, "step_queue", q)

            executor = MultiProcExecutor([step1, step2])
            executor.execute_steps(None)