Loading scripts/parse_mld_xml.py +16 −9 Original line number Diff line number Diff line Loading @@ -7,6 +7,9 @@ from xml.etree import ElementTree Parse a junit report and create a MLD summary report. """ PROPERTIES = ["MLD", "MAXIMUM ABS DIFF"] # Main routine if __name__ == "__main__": parser = argparse.ArgumentParser( Loading @@ -32,9 +35,12 @@ if __name__ == "__main__": testcases = tree.findall(".//testcase") with open(csv_file, "w") as outfile: headerline = ";".join(["testcase"] + PROPERTIES) + "\n" outfile.write(headerline) for testcase in testcases: if testcase.find(".//skipped") == None: if testcase.get("file") == None: if testcase.find(".//skipped") is None: if testcase.get("file") is None: fulltestname = ( testcase.get("classname").replace(".", "/") + ".py::" Loading @@ -42,10 +48,11 @@ if __name__ == "__main__": ) else: fulltestname = testcase.get("file") + "::" + testcase.get("name") if testcase.find(".//property") == None: mld_val = None else: mld_val = testcase.find(".//property").get( "value" ) # Currently MLD is the only set property. If more are added updates are needed here. outfile.write(fulltestname + ";" + str(mld_val) + "\n") properties_found = { p.get("name"): p.get("value") for p in testcase.findall(".//property") } properties_values = [str(properties_found.get(p)) for p in PROPERTIES] outline = ";".join([fulltestname] + properties_values) + "\n" outfile.write(outline) tests/cmp_pcm.py +10 −10 File changed.Contains only whitespace changes. Show changes Loading
scripts/parse_mld_xml.py +16 −9 Original line number Diff line number Diff line Loading @@ -7,6 +7,9 @@ from xml.etree import ElementTree Parse a junit report and create a MLD summary report. """ PROPERTIES = ["MLD", "MAXIMUM ABS DIFF"] # Main routine if __name__ == "__main__": parser = argparse.ArgumentParser( Loading @@ -32,9 +35,12 @@ if __name__ == "__main__": testcases = tree.findall(".//testcase") with open(csv_file, "w") as outfile: headerline = ";".join(["testcase"] + PROPERTIES) + "\n" outfile.write(headerline) for testcase in testcases: if testcase.find(".//skipped") == None: if testcase.get("file") == None: if testcase.find(".//skipped") is None: if testcase.get("file") is None: fulltestname = ( testcase.get("classname").replace(".", "/") + ".py::" Loading @@ -42,10 +48,11 @@ if __name__ == "__main__": ) else: fulltestname = testcase.get("file") + "::" + testcase.get("name") if testcase.find(".//property") == None: mld_val = None else: mld_val = testcase.find(".//property").get( "value" ) # Currently MLD is the only set property. If more are added updates are needed here. outfile.write(fulltestname + ";" + str(mld_val) + "\n") properties_found = { p.get("name"): p.get("value") for p in testcase.findall(".//property") } properties_values = [str(properties_found.get(p)) for p in PROPERTIES] outline = ";".join([fulltestname] + properties_values) + "\n" outfile.write(outline)