Browse Source

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: Daniel DeGrasse <ddegrasse@tenstorrent.com>
pull/90162/merge
Daniel DeGrasse 2 weeks ago committed by Daniel DeGrasse
parent
commit
0b0af06da5
  1. 3
      scripts/pylib/twister/twisterlib/harness.py

3
scripts/pylib/twister/twisterlib/harness.py

@ -1124,7 +1124,8 @@ class Ctest(Harness): @@ -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

Loading…
Cancel
Save