Skip to content

Commit

Permalink
Fix win run (openvinotoolkit#16309)
Browse files Browse the repository at this point in the history
* ix conformance on win

* fix summarizer

* try
  • Loading branch information
iefode authored and andrei-cv committed Mar 21, 2023
1 parent 3667fbe commit 876f963
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
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')

Expand Down Expand Up @@ -82,24 +82,17 @@ def __create_thread(self, func):
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())
Expand All @@ -121,8 +114,10 @@ def __find_free_process(self):
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):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
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"))
Expand Down

0 comments on commit 876f963

Please sign in to comment.