Update merge script to work with outdated reports (#16078)
* Update merge script to work with outdated xml * change report name
This commit is contained in:
parent
35dacb370a
commit
3b6bb06f1d
@ -34,8 +34,18 @@ def parse_arguments():
|
|||||||
|
|
||||||
return parser.parse_args()
|
return parser.parse_args()
|
||||||
|
|
||||||
|
def update_rel_values(xml_node: SubElement):
|
||||||
|
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"))
|
||||||
|
xml_node.set("relative_all", str(test_cnt))
|
||||||
|
if not "relative_passed" in xml_node.attrib:
|
||||||
|
xml_node.set("relative_passed", xml_node.attrib.get("passed"))
|
||||||
|
|
||||||
|
|
||||||
def update_result_node(xml_node: SubElement, aggregated_res: SubElement):
|
def update_result_node(xml_node: SubElement, aggregated_res: SubElement):
|
||||||
|
update_rel_values(aggregated_res)
|
||||||
|
update_rel_values(xml_node)
|
||||||
for attr_name in xml_node.attrib:
|
for attr_name in xml_node.attrib:
|
||||||
if attr_name == "passrate" or attr_name == "relative_passrate":
|
if attr_name == "passrate" or attr_name == "relative_passrate":
|
||||||
continue
|
continue
|
||||||
@ -47,8 +57,6 @@ def update_result_node(xml_node: SubElement, aggregated_res: SubElement):
|
|||||||
continue
|
continue
|
||||||
xml_value = float(xml_node.attrib.get(attr_name)) if "relative_" in attr_name else int(xml_node.attrib.get(attr_name))
|
xml_value = float(xml_node.attrib.get(attr_name)) if "relative_" in attr_name else int(xml_node.attrib.get(attr_name))
|
||||||
aggregated_value = float(aggregated_res.attrib.get(attr_name)) if "relative_" in attr_name else int(aggregated_res.attrib.get(attr_name))
|
aggregated_value = float(aggregated_res.attrib.get(attr_name)) if "relative_" in attr_name else int(aggregated_res.attrib.get(attr_name))
|
||||||
# if attr_name == "crashed" and xml_value > 0:
|
|
||||||
# print("f")
|
|
||||||
aggregated_res.set(attr_name, str(xml_value + aggregated_value))
|
aggregated_res.set(attr_name, str(xml_value + aggregated_value))
|
||||||
|
|
||||||
|
|
||||||
@ -74,6 +82,7 @@ def aggregate_test_results(aggregated_results: SubElement, xml_reports: list, re
|
|||||||
for xml_results_entry in xml_device_entry:
|
for xml_results_entry in xml_device_entry:
|
||||||
aggregated_results_entry = aggregated_device_results.find(xml_results_entry.tag)
|
aggregated_results_entry = aggregated_device_results.find(xml_results_entry.tag)
|
||||||
if aggregated_results_entry is None:
|
if aggregated_results_entry is None:
|
||||||
|
update_rel_values(xml_results_entry)
|
||||||
aggregated_device_results.append(xml_results_entry)
|
aggregated_device_results.append(xml_results_entry)
|
||||||
continue
|
continue
|
||||||
if report_type == "OP":
|
if report_type == "OP":
|
||||||
|
@ -171,12 +171,12 @@ class Conformance:
|
|||||||
conformance.run()
|
conformance.run()
|
||||||
conformance.postprocess_logs()
|
conformance.postprocess_logs()
|
||||||
|
|
||||||
final_report_name = f'report_{self._type}'
|
final_report_name = f'report_{self._type.lower()}'
|
||||||
# API Conformance contains both report type
|
# API Conformance contains both report type
|
||||||
merge_xml([parallel_report_dir], report_dir, final_report_name, self._type)
|
merge_xml([parallel_report_dir], report_dir, final_report_name, self._type)
|
||||||
if self._type == constants.API_CONFORMANCE:
|
if self._type == constants.API_CONFORMANCE:
|
||||||
final_op_report_name = f'report_{constants.OP_CONFORMANCE}'
|
final_op_report_name = f'report_{constants.OP_CONFORMANCE.lower()}'
|
||||||
merge_xml([parallel_report_dir], report_dir, final_op_report_name, constants.OP_CONFORMANCE)
|
merge_xml([parallel_report_dir], report_dir, final_op_report_name, constants.OP_CONFORMANCE.lower())
|
||||||
logger.info(f"Conformance is successful. XML reportwas saved to {report_dir}")
|
logger.info(f"Conformance is successful. XML reportwas saved to {report_dir}")
|
||||||
return (os.path.join(report_dir, final_report_name + ".xml"), report_dir)
|
return (os.path.join(report_dir, final_report_name + ".xml"), report_dir)
|
||||||
|
|
||||||
|
@ -31,4 +31,4 @@ DEBUG_DIR = "Debug"
|
|||||||
RELEASE_DIR = "Release"
|
RELEASE_DIR = "Release"
|
||||||
|
|
||||||
OP_CONFORMANCE = "OP"
|
OP_CONFORMANCE = "OP"
|
||||||
API_CONFORMANCE = "API"
|
API_CONFORMANCE = "API"
|
||||||
|
Loading…
Reference in New Issue
Block a user