@@ -87,11 +87,14 @@ def DumpProgramOutputToQueue(thread_list: typing.List[threading.Thread], tag: st
87
87
'mobile-device-test.py' ), help = 'Test script to use.' )
88
88
@click .option ("--script-args" , type = str , default = '' ,
89
89
help = 'Script arguments, can use placeholders like {SCRIPT_BASE_NAME}.' )
90
+ @click .option ("--script-start-delay" , type = int , default = 0 ,
91
+ help = 'Delay in seconds before starting the script.' )
90
92
@click .option ("--script-gdb" , is_flag = True ,
91
93
help = 'Run script through gdb' )
92
94
@click .option ("--quiet" , is_flag = True , help = "Do not print output from passing tests. Use this flag in CI to keep github log sizes manageable." )
93
95
@click .option ("--load-from-env" , default = None , help = "YAML file that contains values for environment variables." )
94
- def main (app : str , factoryreset : bool , factoryreset_app_only : bool , app_args : str , script : str , script_args : str , script_gdb : bool , quiet : bool , load_from_env ):
96
+ def main (app : str , factoryreset : bool , factoryreset_app_only : bool , app_args : str ,
97
+ script : str , script_args : str , script_start_delay : int , script_gdb : bool , quiet : bool , load_from_env ):
95
98
if load_from_env :
96
99
reader = MetadataReader (load_from_env )
97
100
runs = reader .parse_script (script )
@@ -103,6 +106,7 @@ def main(app: str, factoryreset: bool, factoryreset_app_only: bool, app_args: st
103
106
app = app ,
104
107
app_args = app_args ,
105
108
script_args = script_args ,
109
+ script_start_delay = script_start_delay ,
106
110
factoryreset = factoryreset ,
107
111
factoryreset_app_only = factoryreset_app_only ,
108
112
script_gdb = script_gdb ,
@@ -117,10 +121,11 @@ def main(app: str, factoryreset: bool, factoryreset_app_only: bool, app_args: st
117
121
for run in runs :
118
122
print (f"Executing { run .py_script_path .split ('/' )[- 1 ]} { run .run } " )
119
123
main_impl (run .app , run .factoryreset , run .factoryreset_app_only , run .app_args ,
120
- run .py_script_path , run .script_args , run .script_gdb , run .quiet )
124
+ run .py_script_path , run .script_args , run .script_start_delay , run . script_gdb , run .quiet )
121
125
122
126
123
- def main_impl (app : str , factoryreset : bool , factoryreset_app_only : bool , app_args : str , script : str , script_args : str , script_gdb : bool , quiet : bool ):
127
+ def main_impl (app : str , factoryreset : bool , factoryreset_app_only : bool , app_args : str ,
128
+ script : str , script_args : str , script_start_delay : int , script_gdb : bool , quiet : bool ):
124
129
125
130
app_args = app_args .replace ('{SCRIPT_BASE_NAME}' , os .path .splitext (os .path .basename (script ))[0 ])
126
131
script_args = script_args .replace ('{SCRIPT_BASE_NAME}' , os .path .splitext (os .path .basename (script ))[0 ])
@@ -175,6 +180,8 @@ def main_impl(app: str, factoryreset: bool, factoryreset_app_only: bool, app_arg
175
180
DumpProgramOutputToQueue (
176
181
log_cooking_threads , Fore .GREEN + "APP " + Style .RESET_ALL , app_process , stream_output , log_queue )
177
182
183
+ time .sleep (script_start_delay )
184
+
178
185
script_command = [script , "--paa-trust-store-path" , os .path .join (DEFAULT_CHIP_ROOT , MATTER_DEVELOPMENT_PAA_ROOT_CERTS ),
179
186
'--log-format' , '%(message)s' , "--app-pid" , str (app_pid )] + shlex .split (script_args )
180
187
0 commit comments