Exemple #1
0
 def test_parallel_execution_with_testlevelsplit(self):
     dtemp = tempfile.mkdtemp()
     outs_dir = os.path.join(dtemp, 'pabot_results')
     self._options['outputdir'] = dtemp
     self._pabot_args['pabotlibport'] = 4000 + random.randint(0, 1000)
     self._pabot_args['testlevelsplit'] = True
     lib_process = pabot._start_remote_library(self._pabot_args)
     pabot._initialize_queue_index()
     try:
         test_names = [t(_t) for _t in self._all_tests]
         items = [
             pabot.QueueItem(self._datasources, outs_dir, self._options,
                             test, self._pabot_args['command'],
                             self._pabot_args['verbose'], argfile)
             for test in test_names
             for argfile in self._pabot_args['argumentfiles'] or [("",
                                                                   None)]
         ]
         pabot._parallel_execute(items, self._pabot_args['processes'])
         result_code = pabot._report_results(
             outs_dir, self._pabot_args, self._options, pabot._now(),
             pabot._get_suite_root_name([test_names]))
         self.assertEqual(10, result_code)
     finally:
         pabot._stop_remote_library(lib_process)
         shutil.rmtree(dtemp)
Exemple #2
0
 def test_parallel_execution(self):
     dtemp = tempfile.mkdtemp()
     outs_dir = os.path.join(dtemp, "pabot_results")
     self._options["outputdir"] = dtemp
     self._pabot_args["pabotlibport"] = 4000 + random.randint(0, 1000)
     self._pabot_args["testlevelsplit"] = False
     lib_process = pabot._start_remote_library(self._pabot_args)
     pabot._initialize_queue_index()
     try:
         suite_names = [s(_s) for _s in self._all_suites]
         items = [
             pabot.QueueItem(
                 self._datasources,
                 outs_dir,
                 self._options,
                 suite,
                 self._pabot_args["command"],
                 self._pabot_args["verbose"],
                 argfile,
             ) for suite in suite_names
             for argfile in self._pabot_args["argumentfiles"] or [("",
                                                                   None)]
         ]
         pabot._parallel_execute(items, self._pabot_args["processes"])
         result_code = pabot._report_results(
             outs_dir,
             self._pabot_args,
             self._options,
             pabot._now(),
             pabot._get_suite_root_name([suite_names]),
         )
         self.assertEqual(8, result_code)
     finally:
         pabot._stop_remote_library(lib_process)
         shutil.rmtree(dtemp)