61
61
import subprocess
62
62
import sys
63
63
64
+ from integration_testing import config_reader
65
+
64
66
# Note that desktop is used for fallback,
65
67
# if there is no direct match for a key.
66
68
DEFAULT_WORKFLOW = "desktop"
@@ -334,12 +336,26 @@ def filter_values_on_diff(parm_key, value, auto_diff):
334
336
return value
335
337
336
338
339
+ def filter_platforms_on_apis (platforms , apis ):
340
+ if "tvOS" in platforms :
341
+ config = config_reader .read_config ()
342
+ supported_apis = [api for api in apis if config .get_api (api ).tvos_target ]
343
+ if not supported_apis :
344
+ platforms .remove ("tvOS" )
345
+
346
+ return platforms
347
+
348
+
337
349
def main ():
338
350
args = parse_cmdline_args ()
339
351
if args .override :
340
352
# If it is matrix parm, convert CSV string into a list
341
353
if not args .config :
342
354
args .override = args .override .split (',' )
355
+ if args .parm_key == "platform" and args .apis :
356
+ # e.g. args.apis = "\"admob,analytics\""
357
+ args .override = filter_platforms_on_apis (args .override , args .apis .strip ('"' ).split (',' ))
358
+
343
359
print_value (args .override )
344
360
return
345
361
@@ -365,6 +381,8 @@ def parse_cmdline_args():
365
381
parser .add_argument ('-o' , '--override' , help = 'Override existing value with provided value' )
366
382
parser .add_argument ('-d' , '--device' , action = 'store_true' , help = 'Get the device type, used with -k $device' )
367
383
parser .add_argument ('-t' , '--device_type' , default = ['real' , 'virtual' ], help = 'Test on which type of mobile devices' )
384
+ parser .add_argument ('--apis' , default = PARAMETERS ["integration_tests" ]["config" ]["apis" ],
385
+ help = 'Exclude platform based on apis. Certain platform does not support all apis. e.g. tvOS does not support messaging' )
368
386
args = parser .parse_args ()
369
387
return args
370
388
0 commit comments