]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Support older junit XML format in test result processing
authorTom Krizek <tkrizek@isc.org>
Tue, 6 Feb 2024 09:21:45 +0000 (10:21 +0100)
committerTom Krizek <tkrizek@isc.org>
Thu, 8 Feb 2024 13:14:26 +0000 (14:14 +0100)
When running `make check` on a platform which has older (but still
supported) pytest, e.g. 3.4.2 on EL8, the junit to trs conversion would
fail because the junit format has different structure. Make the junit
XML processing more lenient to support both the older and newer junit
XML formats.

bin/tests/system/convert-junit-to-trs.py

index b3d44b5567255ce2d1a9464b8111b7212e3b7b9b..9675825a50a87b9b4aa4ae55dc34ce2cd0659250 100755 (executable)
@@ -13,7 +13,7 @@ from xml.etree import ElementTree
 
 def junit_to_trs(junit_xml):
     root = ElementTree.fromstring(junit_xml)
-    testcases = root.findall("./testsuite/testcase")
+    testcases = root.findall(".//testcase")
 
     if len(testcases) < 1:
         print(":test-result: ERROR convert-junit-to-trs.py")