Skip to content

Commit 92f9a90

Browse files
author
Jinming Zhao
committed
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 <jinmzhao@qti.qualcomm.com>
1 parent 8c264d3 commit 92f9a90

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

scripts/ci/test_plan.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ def __init__(
118118
detailed_test_id=False,
119119
quarantine_list=None,
120120
tc_roots_th=20,
121+
test_config=None,
122+
level=None,
121123
):
122124
self.modified_files = modified_files
123125
self.testsuite_root = testsuite_root
@@ -133,6 +135,8 @@ def __init__(
133135
self.tag_cfg_file = alt_tags
134136
self.quarantine_list = quarantine_list
135137
self.tc_roots_th = tc_roots_th
138+
self.test_config = test_config
139+
self.level = level
136140

137141
def process(self):
138142
self.find_modules()
@@ -163,6 +167,10 @@ def get_plan(self, options, integration=False, use_testsuite_root=True):
163167
if self.quarantine_list:
164168
for q in self.quarantine_list:
165169
cmd += ["--quarantine-list", q]
170+
if self.test_config:
171+
cmd += ["--test-config", self.test_config]
172+
if self.level:
173+
cmd += ["--level", self.level]
166174

167175
logging.info(" ".join(cmd))
168176
_ = subprocess.call(cmd)
@@ -509,6 +517,16 @@ def parse_args():
509517
"corresponding tests .yaml files. These scenarios "
510518
"will be skipped with quarantine as the reason.",
511519
)
520+
parser.add_argument(
521+
'--test-config',
522+
default=None,
523+
help="Path to file with plans and test configurations.",
524+
)
525+
parser.add_argument(
526+
'--level',
527+
default=None,
528+
help="Test level to be used.",
529+
)
512530

513531
# Do not include paths in names by default.
514532
parser.set_defaults(detailed_test_id=False)
@@ -545,6 +563,8 @@ def parse_args():
545563
args.detailed_test_id,
546564
args.quarantine_list,
547565
args.testcase_roots_threshold,
566+
args.test_config,
567+
args.level,
548568
)
549569
f.process()
550570

0 commit comments

Comments
 (0)