Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

twister: do not create overlays/run_id for filtered cases #82362

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion scripts/pylib/twister/twisterlib/testinstance.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def __init__(self, testsuite, platform, outdir):
source_dir_rel,
testsuite.name
)
self.run_id = self._get_run_id()
self.run_id = None
self.domains = None
# Instance need to use sysbuild if a given suite or a platform requires it
self.sysbuild = testsuite.sysbuild or platform.sysbuild
Expand All @@ -90,6 +90,9 @@ def __init__(self, testsuite, platform, outdir):
self.filters = []
self.filter_type = None

def setup_run_id(self):
self.run_id = self._get_run_id()

def record(self, recording, fname_csv="recording.csv"):
if recording:
if self.recording is None:
Expand Down
5 changes: 5 additions & 0 deletions scripts/pylib/twister/twisterlib/testplan.py
Original file line number Diff line number Diff line change
Expand Up @@ -1206,6 +1206,11 @@ def apply_filters(self, **kwargs):
self.add_instances(instance_list)

for _, case in self.instances.items():
# Do not create files for filtered instances
if case.status == TwisterStatus.FILTER:
continue
# set run_id for each unfiltered instance
case.setup_run_id()
case.create_overlay(case.platform,
self.options.enable_asan,
self.options.enable_ubsan,
Expand Down
2 changes: 1 addition & 1 deletion scripts/tests/twister_blackbox/test_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def test_platform_reports(self, capfd, out_path, test_path, test_platforms, file
pytest.fail(f"Unsupported file type: '{path}'")

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

assert str(sys_exit.value) == '0'
Expand Down
Loading