From 12a7ed9bdd0aef030a89d64fff4df094e952cbb4 Mon Sep 17 00:00:00 2001 From: Sofya Balandina Date: Fri, 21 Jul 2023 13:57:09 +0100 Subject: [PATCH] [apiConformance] Fix run_confoormance fails after exclusion opset tests (#18710) --- .../layer_tests_summary/run_conformance.py | 19 ++++++++----------- .../layer_tests_summary/run_parallel.py | 12 +++++++----- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/tests/test_utils/functional_test_utils/layer_tests_summary/run_conformance.py b/src/tests/test_utils/functional_test_utils/layer_tests_summary/run_conformance.py index da93996a10c..cd6a78aa6d7 100644 --- a/src/tests/test_utils/functional_test_utils/layer_tests_summary/run_conformance.py +++ b/src/tests/test_utils/functional_test_utils/layer_tests_summary/run_conformance.py @@ -4,7 +4,7 @@ from argparse import ArgumentParser from subprocess import Popen from shutil import copytree, rmtree -from summarize import create_summary +from summarize import create_summary, create_api_summary from merge_xmls import merge_xml from run_parallel import TestParallelRunner from pathlib import Path @@ -177,21 +177,18 @@ class Conformance: conformance.postprocess_logs() final_report_name = f'report_{self._type.lower()}' - # API Conformance contains both report type merge_xml([parallel_report_dir], report_dir, final_report_name, self._type, True) - if self._type == constants.API_CONFORMANCE: - try: - final_report_name = f'report_{constants.OP_CONFORMANCE.lower()}' - merge_xml([parallel_report_dir], report_dir, final_report_name, constants.OP_CONFORMANCE.lower(), True) - except: - logger.warning("Something is wrong to create report_op for API conformance!") + logger.info(f"Conformance is successful. XML reportwas saved to {report_dir}") return (os.path.join(report_dir, final_report_name + ".xml"), report_dir) def __summarize(self, xml_report_path:os.path, report_dir: os.path): - summary_root = ET.parse(xml_report_path).getroot() - rel_weights_path = os.path.join(self._model_path, constants.REL_WEIGHTS_FILENAME.replace(constants.REL_WEIGHTS_REPLACE_STR, self._shape_mode)) - create_summary(summary_root, report_dir, [], "", "", True, True, rel_weights_path) + if self._type == constants.OP_CONFORMANCE: + summary_root = ET.parse(xml_report_path).getroot() + rel_weights_path = os.path.join(self._model_path, constants.REL_WEIGHTS_FILENAME.replace(constants.REL_WEIGHTS_REPLACE_STR, self._shape_mode)) + create_summary(summary_root, report_dir, [], "", "", True, True, rel_weights_path) + else: + create_api_summary([xml_report_path], report_dir, [], "", "") copytree(os.path.join(SCRIPT_DIR_PATH, "template"), os.path.join(report_dir, "template")) logger.info(f"Report was saved to {os.path.join(report_dir, 'report.html')}") diff --git a/src/tests/test_utils/functional_test_utils/layer_tests_summary/run_parallel.py b/src/tests/test_utils/functional_test_utils/layer_tests_summary/run_parallel.py index 21eba795355..4c8f02c32a9 100644 --- a/src/tests/test_utils/functional_test_utils/layer_tests_summary/run_parallel.py +++ b/src/tests/test_utils/functional_test_utils/layer_tests_summary/run_parallel.py @@ -681,11 +681,13 @@ class TestParallelRunner: copyfile(xml_file, failed_ir_xml) copyfile(bin_file, failed_ir_bin) copyfile(meta_file, failed_ir_meta) - output_file_name = failed_ir_dir + '.tar' - with tar_open(output_file_name, "w:gz") as tar: - tar.add(failed_ir_dir, arcname=os.path.basename(failed_ir_dir)) - logger.info(f"All Conformance IRs for failed tests are saved to: {output_file_name}") - rmtree(failed_ir_dir) + # api conformance has no failed irs + if os.path.exists(failed_ir_dir): + output_file_name = failed_ir_dir + '.tar' + with tar_open(output_file_name, "w:gz") as tar: + tar.add(failed_ir_dir, arcname=os.path.basename(failed_ir_dir)) + logger.info(f"All Conformance IRs for failed tests are saved to: {output_file_name}") + rmtree(failed_ir_dir) disabled_tests_path = os.path.join(logs_dir, "disabled_tests.log") with open(disabled_tests_path, "w") as disabled_tests_file: