Commit c5c4165f authored by Dmitrii Golovanov's avatar Dmitrii Golovanov Committed by Benjamin Cabé
Browse files

twister: reports: Long testcase.classname XML properties

The testcase.classname properties in `twister_report.xml` and
`twister_suite_report.xml` now contain the full testsuite name
(without its path prefix) instead of just two its dot-separated
leftmost components. This way `twister_report.xml` testsuite container
has no duplicate testcase elements with the same `classname` and `name`
properties executing with --no-detailed-test-id for a project with same
testcase names in its 'sibling' suites, for example`tests/kernel/sleep`.

Signed-off-by: default avatarDmitrii Golovanov <dmitrii.golovanov@intel.com>
parent b69a8d1d
Loading
Loading
Loading
Loading
+2 −0
Changes for doc/releases/release-notes-4.1.rst: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -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
*******************
+2 −2
Changes for scripts/pylib/twister/twisterlib/reports.py: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -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)