Skip to content

Commit 4406598

Browse files
nashifkartben
authored andcommitted
twister: do not create overlays/run_id for filtered cases
Avoid creating directories and files for instances that are filtered. Signed-off-by: Anas Nashif <[email protected]>
1 parent f8c6570 commit 4406598

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

scripts/pylib/twister/twisterlib/testinstance.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def __init__(self, testsuite, platform, outdir):
7979
source_dir_rel,
8080
testsuite.name
8181
)
82-
self.run_id = self._get_run_id()
82+
self.run_id = None
8383
self.domains = None
8484
# Instance need to use sysbuild if a given suite or a platform requires it
8585
self.sysbuild = testsuite.sysbuild or platform.sysbuild
@@ -90,6 +90,9 @@ def __init__(self, testsuite, platform, outdir):
9090
self.filters = []
9191
self.filter_type = None
9292

93+
def setup_run_id(self):
94+
self.run_id = self._get_run_id()
95+
9396
def record(self, recording, fname_csv="recording.csv"):
9497
if recording:
9598
if self.recording is None:

scripts/pylib/twister/twisterlib/testplan.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1206,6 +1206,11 @@ def apply_filters(self, **kwargs):
12061206
self.add_instances(instance_list)
12071207

12081208
for _, case in self.instances.items():
1209+
# Do not create files for filtered instances
1210+
if case.status == TwisterStatus.FILTER:
1211+
continue
1212+
# set run_id for each unfiltered instance
1213+
case.setup_run_id()
12091214
case.create_overlay(case.platform,
12101215
self.options.enable_asan,
12111216
self.options.enable_ubsan,

scripts/tests/twister_blackbox/test_report.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def test_platform_reports(self, capfd, out_path, test_path, test_platforms, file
174174
pytest.fail(f"Unsupported file type: '{path}'")
175175

176176
for f_platform in test_platforms:
177-
platform_path = os.path.join(out_path, f_platform.replace("/", "_"))
177+
platform_path = os.path.join(out_path, f_platform.replace("/", "_") + ".json", )
178178
assert os.path.exists(platform_path), f'file not found {f_platform}'
179179

180180
assert str(sys_exit.value) == '0'

0 commit comments

Comments
 (0)