parent
8189d18648
commit
072acc1ea7
@ -27,7 +27,7 @@ FILENAME_LENGTH = 255
|
||||
LOG_NAME_REPLACE_STR = "##NAME##"
|
||||
DEFAULT_PROCESS_TIMEOUT = 3600
|
||||
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')
|
||||
|
||||
@ -82,24 +82,17 @@ class TaskManager:
|
||||
thread.start()
|
||||
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):
|
||||
if len(self._command_list) <= self._idx:
|
||||
logger.warning(f"Skip worker initialiazation. Command list lenght <= worker index")
|
||||
return
|
||||
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:
|
||||
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(
|
||||
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)
|
||||
worker.join()
|
||||
self._timers.append(datetime.datetime.now())
|
||||
@ -121,8 +114,10 @@ class TaskManager:
|
||||
continue
|
||||
|
||||
def __update_process(self, pid:int, log_file):
|
||||
args = self.__normilize_path_in_args(self._command_list[self._idx])
|
||||
self._process_list[pid] = Popen(args, stdout=log_file, stderr=log_file)
|
||||
args = self._command_list[self._idx]
|
||||
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):
|
||||
if self._idx >= len(self._command_list):
|
||||
|
@ -97,9 +97,13 @@ def merge_xmls(xml_paths: list):
|
||||
logger.warning(f'Test counter is different in {op_result.tag} for {device.tag}'\
|
||||
f'({total_tests_count_xml} vs {total_tests_count_xml})')
|
||||
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
|
||||
xml_value = int(op_result.attrib.get(attr_name))
|
||||
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))
|
||||
device_results.find(current_op_res.tag).set(attr_name, str(xml_value))
|
||||
else:
|
||||
device_results.append(op_result)
|
||||
|
@ -6,6 +6,8 @@ import xml.etree.ElementTree as ET
|
||||
from . import conformance_utils
|
||||
|
||||
def update_rel_values(xml_node: ET.SubElement):
|
||||
if xml_node is None:
|
||||
return
|
||||
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")) + \
|
||||
int(xml_node.attrib.get("crashed")) + int(xml_node.attrib.get("hanged"))
|
||||
|
Loading…
Reference in New Issue
Block a user