twister: Add "path" entry to json test report

"Path" is a path (relative to zephyr) to a directory with test suite's
definition. Such entry helps to locate a given test.

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
This commit is contained in:
Maciej Perkowski 2023-09-06 16:52:16 +02:00 committed by Carles Cufí
commit 4e4b743fe1
2 changed files with 3 additions and 0 deletions

View file

@ -258,6 +258,7 @@ class Reporting:
"name": instance.testsuite.name,
"arch": instance.platform.arch,
"platform": instance.platform.name,
"path": instance.testsuite.source_dir_rel
}
if instance.run_id:
suite['run_id'] = instance.run_id

View file

@ -395,6 +395,8 @@ class TestSuite(DisablePyTestCollectionMixin):
self.id = name
self.source_dir = suite_path
self.source_dir_rel = os.path.relpath(os.path.realpath(suite_path),
start=canonical_zephyr_base)
self.yamlfile = suite_path
self.testcases = []