parent
8189d18648
commit
072acc1ea7
@ -27,7 +27,7 @@ FILENAME_LENGTH = 255
|
|||||||
LOG_NAME_REPLACE_STR = "##NAME##"
|
LOG_NAME_REPLACE_STR = "##NAME##"
|
||||||
DEFAULT_PROCESS_TIMEOUT = 3600
|
DEFAULT_PROCESS_TIMEOUT = 3600
|
||||||
DEFAULT_TEST_TIMEOUT = 900
|
DEFAULT_TEST_TIMEOUT = 900
|
||||||
MAX_LENGHT = 4096 if platform.system() != "Windows" else 8191
|
MAX_LENGHT = 4096 if not constants.IS_WIN else 8191
|
||||||
|
|
||||||
logger = get_logger('test_parallel_runner')
|
logger = get_logger('test_parallel_runner')
|
||||||
|
|
||||||
@ -82,24 +82,17 @@ class TaskManager:
|
|||||||
thread.start()
|
thread.start()
|
||||||
return thread
|
return thread
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def __normilize_path_in_args(command: str):
|
|
||||||
args = shlex.split(command)
|
|
||||||
for arg in args:
|
|
||||||
path = Path(arg)
|
|
||||||
if path.exists():
|
|
||||||
arg = path.expanduser().resolve()
|
|
||||||
return args
|
|
||||||
|
|
||||||
def init_worker(self):
|
def init_worker(self):
|
||||||
if len(self._command_list) <= self._idx:
|
if len(self._command_list) <= self._idx:
|
||||||
logger.warning(f"Skip worker initialiazation. Command list lenght <= worker index")
|
logger.warning(f"Skip worker initialiazation. Command list lenght <= worker index")
|
||||||
return
|
return
|
||||||
log_file_name = self._log_filename.replace(LOG_NAME_REPLACE_STR, str(self._idx + self._prev_run_cmd_length))
|
log_file_name = self._log_filename.replace(LOG_NAME_REPLACE_STR, str(self._idx + self._prev_run_cmd_length))
|
||||||
with open(log_file_name, "w") as log_file:
|
with open(log_file_name, "w") as log_file:
|
||||||
args = self.__normilize_path_in_args(self._command_list[self._idx])
|
args = self._command_list[self._idx]
|
||||||
|
if not constants.IS_WIN:
|
||||||
|
args = shlex.split(self._command_list[self._idx])
|
||||||
worker = self.__create_thread(
|
worker = self.__create_thread(
|
||||||
self._process_list.append(Popen(args, stdout=log_file, stderr=log_file)))
|
self._process_list.append(Popen(args, shell=constants.IS_WIN, stdout=log_file, stderr=log_file)))
|
||||||
self._workers.append(worker)
|
self._workers.append(worker)
|
||||||
worker.join()
|
worker.join()
|
||||||
self._timers.append(datetime.datetime.now())
|
self._timers.append(datetime.datetime.now())
|
||||||
@ -121,8 +114,10 @@ class TaskManager:
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
def __update_process(self, pid:int, log_file):
|
def __update_process(self, pid:int, log_file):
|
||||||
args = self.__normilize_path_in_args(self._command_list[self._idx])
|
args = self._command_list[self._idx]
|
||||||
self._process_list[pid] = Popen(args, stdout=log_file, stderr=log_file)
|
if not constants.IS_WIN:
|
||||||
|
args = shlex.split(self._command_list[self._idx])
|
||||||
|
self._process_list[pid] = Popen(args, shell=constants.IS_WIN, stdout=log_file, stderr=log_file)
|
||||||
|
|
||||||
def update_worker(self):
|
def update_worker(self):
|
||||||
if self._idx >= len(self._command_list):
|
if self._idx >= len(self._command_list):
|
||||||
|
@ -97,8 +97,12 @@ def merge_xmls(xml_paths: list):
|
|||||||
logger.warning(f'Test counter is different in {op_result.tag} for {device.tag}'\
|
logger.warning(f'Test counter is different in {op_result.tag} for {device.tag}'\
|
||||||
f'({total_tests_count_xml} vs {total_tests_count_xml})')
|
f'({total_tests_count_xml} vs {total_tests_count_xml})')
|
||||||
for attr_name in device_results.find(op_result.tag).attrib:
|
for attr_name in device_results.find(op_result.tag).attrib:
|
||||||
if attr_name == "passrate" or attr_name == "implemented":
|
if attr_name == "passrate" or attr_name == "implemented" or attr_name == "relative_passrate":
|
||||||
continue
|
continue
|
||||||
|
xml_value = None
|
||||||
|
if "relative_" in attr_name:
|
||||||
|
xml_value = float(op_result.attrib.get(attr_name))
|
||||||
|
else:
|
||||||
xml_value = int(op_result.attrib.get(attr_name))
|
xml_value = int(op_result.attrib.get(attr_name))
|
||||||
device_results.find(current_op_res.tag).set(attr_name, str(xml_value))
|
device_results.find(current_op_res.tag).set(attr_name, str(xml_value))
|
||||||
else:
|
else:
|
||||||
|
@ -6,6 +6,8 @@ import xml.etree.ElementTree as ET
|
|||||||
from . import conformance_utils
|
from . import conformance_utils
|
||||||
|
|
||||||
def update_rel_values(xml_node: ET.SubElement):
|
def update_rel_values(xml_node: ET.SubElement):
|
||||||
|
if xml_node is None:
|
||||||
|
return
|
||||||
if not "relative_all" in xml_node.attrib:
|
if not "relative_all" in xml_node.attrib:
|
||||||
test_cnt = int(xml_node.attrib.get("passed")) + int(xml_node.attrib.get("failed")) + int(xml_node.attrib.get("skipped")) + \
|
test_cnt = int(xml_node.attrib.get("passed")) + int(xml_node.attrib.get("failed")) + int(xml_node.attrib.get("skipped")) + \
|
||||||
int(xml_node.attrib.get("crashed")) + int(xml_node.attrib.get("hanged"))
|
int(xml_node.attrib.get("crashed")) + int(xml_node.attrib.get("hanged"))
|
||||||
|
Loading…
Reference in New Issue
Block a user