diff --git a/doc/releases/release-notes-4.1.rst b/doc/releases/release-notes-4.1.rst index 3b821986a26..b47361a3803 100644 --- a/doc/releases/release-notes-4.1.rst +++ b/doc/releases/release-notes-4.1.rst @@ -126,6 +126,8 @@ Build system and Infrastructure as well as for ``--sub-test`` command line parameters (:github:`80088`). * The ``--no-detailed-test-id`` command line option also shortens Ztest Test Case names excluding its Test Scenario name prefix which is the same as the parent Test Suite id (:github:`82302`). + Twister XML reports have full testsuite name as ``testcase.classname property`` resolving + possible duplicate testcase elements in ``twister_report.xml`` testsuite container. Drivers and Sensors ******************* diff --git a/scripts/pylib/twister/twisterlib/reports.py b/scripts/pylib/twister/twisterlib/reports.py index c64ddfefef3..5aec6566b0f 100644 --- a/scripts/pylib/twister/twisterlib/reports.py +++ b/scripts/pylib/twister/twisterlib/reports.py @@ -171,6 +171,7 @@ class Reporting: runnable = suite.get('runnable', 0) duration += float(handler_time) ts_status = TwisterStatus(suite.get('status')) + classname = PosixPath(suite.get("name","")).name for tc in suite.get("testcases", []): status = TwisterStatus(tc.get('status')) reason = tc.get('reason', suite.get('reason', 'Unknown')) @@ -178,7 +179,6 @@ class Reporting: tc_duration = tc.get('execution_time', handler_time) name = tc.get("identifier") - classname = ".".join(name.split(".")[:2]) fails, passes, errors, skips = self.xunit_testcase(eleTestsuite, name, classname, status, ts_status, reason, tc_duration, runnable, (fails, passes, errors, skips), log, True) @@ -252,6 +252,7 @@ class Reporting: ): continue if full_report: + classname = PosixPath(ts.get("name","")).name for tc in ts.get("testcases", []): status = TwisterStatus(tc.get('status')) reason = tc.get('reason', ts.get('reason', 'Unknown')) @@ -259,7 +260,6 @@ class Reporting: tc_duration = tc.get('execution_time', handler_time) name = tc.get("identifier") - classname = ".".join(name.split(".")[:2]) fails, passes, errors, skips = self.xunit_testcase(eleTestsuite, name, classname, status, ts_status, reason, tc_duration, runnable, (fails, passes, errors, skips), log, True)