diff options
Diffstat (limited to '.ci/utils/format_devtest_junitxml.py')
-rw-r--r-- | .ci/utils/format_devtest_junitxml.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/.ci/utils/format_devtest_junitxml.py b/.ci/utils/format_devtest_junitxml.py new file mode 100644 index 000000000..b941a64e6 --- /dev/null +++ b/.ci/utils/format_devtest_junitxml.py @@ -0,0 +1,22 @@ +from junitparser import JUnitXml, Element, Attr, TestCase +import argparse +import glob, os + +class ClassNameTestCase(TestCase): + classname = Attr('classname') + +parser = argparse.ArgumentParser() +parser.add_argument("search_path") +parser.add_argument("output_name") +args = parser.parse_args() + +xml = JUnitXml() +for file in glob.glob(args.search_path + "/**/*.xml", recursive=True): + xml += JUnitXml.fromfile(file) + +for suite in xml: + for case in suite: + classname_case = ClassNameTestCase.fromelem(case) + if classname_case.name == 'test_all': + classname_case.name = classname_case.classname +xml.write(args.output_name) |