From cd81730471c62b6b76b3785367c928d8cbde9ff6 Mon Sep 17 00:00:00 2001 From: Jinming Zhao Date: Thu, 6 Nov 2025 14:34:23 +0530 Subject: [PATCH] scripts: Allow using test config and level with test_plan.py script In Twister, test-config and level options are ignored when --load-test is used. To combine them with dynamic scope from test_plan.py, pass these options through the script instead. Signed-off-by: Jinming Zhao --- scripts/ci/test_plan.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/scripts/ci/test_plan.py b/scripts/ci/test_plan.py index 4c6df1c33a74d..326021b6ef03e 100755 --- a/scripts/ci/test_plan.py +++ b/scripts/ci/test_plan.py @@ -102,7 +102,8 @@ def __repr__(self): class Filters: def __init__(self, modified_files, ignore_path, alt_tags, testsuite_root, - pull_request=False, platforms=[], detailed_test_id=False, quarantine_list=None, tc_roots_th=20): + pull_request=False, platforms=[], detailed_test_id=False, quarantine_list=None, + tc_roots_th=20, test_config=None, level=None): self.modified_files = modified_files self.testsuite_root = testsuite_root self.resolved_files = [] @@ -117,6 +118,8 @@ def __init__(self, modified_files, ignore_path, alt_tags, testsuite_root, self.tag_cfg_file = alt_tags self.quarantine_list = quarantine_list self.tc_roots_th = tc_roots_th + self.test_config = test_config + self.level = level def process(self): self.find_modules() @@ -147,6 +150,10 @@ def get_plan(self, options, integration=False, use_testsuite_root=True): if self.quarantine_list: for q in self.quarantine_list: cmd += ["--quarantine-list", q] + if self.test_config: + cmd += ["--test-config", self.test_config] + if self.level: + cmd += ["--level", self.level] logging.info(" ".join(cmd)) _ = subprocess.call(cmd) @@ -443,6 +450,10 @@ def parse_args(): "the file need to correspond to the test scenarios names as in " "corresponding tests .yaml files. These scenarios " "will be skipped with quarantine as the reason.") + parser.add_argument('--test-config', default=None, + help="Path to file with plans and test configurations.") + parser.add_argument('--level', default=None, + help="Test level to be used.") # Do not include paths in names by default. parser.set_defaults(detailed_test_id=False) @@ -472,7 +483,7 @@ def parse_args(): f = Filters(files, args.ignore_path, args.alt_tags, args.testsuite_root, args.pull_request, args.platform, args.detailed_test_id, args.quarantine_list, - args.testcase_roots_threshold) + args.testcase_roots_threshold, args.test_config, args.level) f.process() # remove dupes and filtered cases