[CONFORMANCE] Remove duplications from API Conformance report (#17339)

* [CONFORMANCE] Remove duplications from API Conformance report

* remove extra prints
This commit is contained in:
Irina Efode authored and GitHub committed 2023-05-03 12:01:56 +01:00
1 parent 52f32ae437
commit e616bcbad8
2 files changed
+8 -4

No files matched your search

@@ -70,12 +70,12 @@ def aggregate_test_results(aggregated_results: SubElement, xml_reports: list,
if aggregated_timestamp is None or xml_timestamp < aggregated_timestamp:
aggregated_timestamp = xml_timestamp
for xml_device_entry in xml_results:
device_name = xml_device_entry.tag
if merge_device_suffix and "." in xml_device_entry.tag:
device_name = xml_device_entry.tag[:xml_device_entry.tag.find("."):]
new_data = ET.tostring(xml_device_entry).decode('utf8').replace(xml_device_entry.tag, device_name)
xml_device_entry = ET.fromstring(new_data)
aggregated_device_results = aggregated_results.find(xml_device_entry.tag)
device_name = xml_device_entry.tag
aggregated_device_results = aggregated_results.find(device_name)
for xml_results_entry in xml_device_entry:
aggregated_results_entry = None
if not aggregated_device_results is None:
@@ -84,6 +84,7 @@ def aggregate_test_results(aggregated_results: SubElement, xml_reports: list,
stat_update_utils.update_rel_values(xml_results_entry)
if aggregated_device_results is None:
aggregated_results.append(xml_device_entry)
aggregated_device_results = aggregated_results.find(device_name)
else:
aggregated_device_results.append(xml_results_entry)
continue
@@ -180,8 +180,11 @@ class Conformance:
# 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:
final_report_name = f'report_{constants.OP_CONFORMANCE.lower()}'
merge_xml([parallel_report_dir], report_dir, final_report_name, constants.OP_CONFORMANCE.lower(), True)
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)