Commit 0b0af06d authored by Daniel DeGrasse's avatar Daniel DeGrasse Committed by Daniel DeGrasse
Browse files

scripts: pylib: fix twister report handling for junitparser >= 4.0.2

With junitparser 4.0.2, the JunitXml.fromfile() now returns a JUnitXml
instance. In order to access the junit.TestSuite instance, we must use
TestSuite.fromelem() to convert it back.

Signed-off-by: default avatarDaniel DeGrasse <ddegrasse@tenstorrent.com>
parent c8c1bf41
Loading
Loading
Loading
Loading
+2 −1
Changes for scripts/pylib/twister/twisterlib/harness.py: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -1124,7 +1124,8 @@ class Ctest(Harness):
            self.instance.reason = 'No tests collected'
            return

        assert isinstance(suite, junit.TestSuite)
        if not isinstance(suite, junit.TestSuite):
            suite = junit.TestSuite.fromelem(suite)

        if suite.failures and suite.failures > 0:
            self.status = TwisterStatus.FAIL