@@ -628,6 +628,7 @@ class MatterTestConfig:
628
628
timeout : typing .Union [int , None ] = None
629
629
endpoint : typing .Union [int , None ] = 0
630
630
app_pid : int = 0
631
+ fail_on_skipped_tests : bool = False
631
632
632
633
commissioning_method : Optional [str ] = None
633
634
discriminators : List [int ] = field (default_factory = list )
@@ -1932,10 +1933,11 @@ def convert_args_to_matter_config(args: argparse.Namespace) -> MatterTestConfig:
1932
1933
config .paa_trust_store_path = args .paa_trust_store_path
1933
1934
config .ble_interface_id = args .ble_interface_id
1934
1935
config .pics = {} if args .PICS is None else read_pics_from_file (args .PICS )
1935
- config .tests = [] if args .tests is None else args . tests
1936
+ config .tests = list ( chain . from_iterable ( args .tests or []))
1936
1937
config .timeout = args .timeout # This can be none, we pull the default from the test if it's unspecified
1937
1938
config .endpoint = args .endpoint # This can be None, the get_endpoint function allows the tests to supply a default
1938
1939
config .app_pid = 0 if args .app_pid is None else args .app_pid
1940
+ config .fail_on_skipped_tests = args .fail_on_skipped
1939
1941
1940
1942
config .controller_node_id = args .controller_node_id
1941
1943
config .trace_to = args .trace_to
@@ -1962,13 +1964,10 @@ def parse_matter_test_args(argv: Optional[List[str]] = None) -> MatterTestConfig
1962
1964
1963
1965
basic_group = parser .add_argument_group (title = "Basic arguments" , description = "Overall test execution arguments" )
1964
1966
1965
- basic_group .add_argument ('--tests' ,
1966
- '--test_case' ,
1967
- action = "store" ,
1968
- nargs = '+' ,
1969
- type = str ,
1970
- metavar = 'test_a test_b...' ,
1967
+ basic_group .add_argument ('--tests' , '--test-case' , action = 'append' , nargs = '+' , type = str , metavar = 'test_NAME' ,
1971
1968
help = 'A list of tests in the test class to execute.' )
1969
+ basic_group .add_argument ('--fail-on-skipped' , action = "store_true" , default = False ,
1970
+ help = "Fail the test if any test cases are skipped" )
1972
1971
basic_group .add_argument ('--trace-to' , nargs = "*" , default = [],
1973
1972
help = "Where to trace (e.g perfetto, perfetto:path, json:log, json:path)" )
1974
1973
basic_group .add_argument ('--storage-path' , action = "store" , type = pathlib .Path ,
@@ -2056,17 +2055,17 @@ def parse_matter_test_args(argv: Optional[List[str]] = None) -> MatterTestConfig
2056
2055
help = 'Path to chip-tool credentials file root' )
2057
2056
2058
2057
args_group = parser .add_argument_group (title = "Config arguments" , description = "Test configuration global arguments set" )
2059
- args_group .add_argument ('--int-arg' , nargs = '* ' , action = 'append' , type = int_named_arg , metavar = "NAME:VALUE" ,
2058
+ args_group .add_argument ('--int-arg' , nargs = '+ ' , action = 'append' , type = int_named_arg , metavar = "NAME:VALUE" ,
2060
2059
help = "Add a named test argument for an integer as hex or decimal (e.g. -2 or 0xFFFF_1234)" )
2061
- args_group .add_argument ('--bool-arg' , nargs = '* ' , action = 'append' , type = bool_named_arg , metavar = "NAME:VALUE" ,
2060
+ args_group .add_argument ('--bool-arg' , nargs = '+ ' , action = 'append' , type = bool_named_arg , metavar = "NAME:VALUE" ,
2062
2061
help = "Add a named test argument for an boolean value (e.g. true/false or 0/1)" )
2063
- args_group .add_argument ('--float-arg' , nargs = '* ' , action = 'append' , type = float_named_arg , metavar = "NAME:VALUE" ,
2062
+ args_group .add_argument ('--float-arg' , nargs = '+ ' , action = 'append' , type = float_named_arg , metavar = "NAME:VALUE" ,
2064
2063
help = "Add a named test argument for a floating point value (e.g. -2.1 or 6.022e23)" )
2065
- args_group .add_argument ('--string-arg' , nargs = '* ' , action = 'append' , type = str_named_arg , metavar = "NAME:VALUE" ,
2064
+ args_group .add_argument ('--string-arg' , nargs = '+ ' , action = 'append' , type = str_named_arg , metavar = "NAME:VALUE" ,
2066
2065
help = "Add a named test argument for a string value" )
2067
- args_group .add_argument ('--json-arg' , nargs = '* ' , action = 'append' , type = json_named_arg , metavar = "NAME:VALUE" ,
2066
+ args_group .add_argument ('--json-arg' , nargs = '+ ' , action = 'append' , type = json_named_arg , metavar = "NAME:VALUE" ,
2068
2067
help = "Add a named test argument for JSON stored as a list or dict" )
2069
- args_group .add_argument ('--hex-arg' , nargs = '* ' , action = 'append' , type = bytes_as_hex_named_arg , metavar = "NAME:VALUE" ,
2068
+ args_group .add_argument ('--hex-arg' , nargs = '+ ' , action = 'append' , type = bytes_as_hex_named_arg , metavar = "NAME:VALUE" ,
2070
2069
help = "Add a named test argument for an octet string in hex (e.g. 0011cafe or 00:11:CA:FE)" )
2071
2070
2072
2071
if not argv :
@@ -2510,6 +2509,8 @@ def run_tests_no_exit(test_class: MatterBaseTest, matter_test_config: MatterTest
2510
2509
try :
2511
2510
runner .run ()
2512
2511
ok = runner .results .is_all_pass and ok
2512
+ if matter_test_config .fail_on_skipped_tests and runner .results .skipped :
2513
+ ok = False
2513
2514
except TimeoutError :
2514
2515
ok = False
2515
2516
except signals .TestAbortAll :
0 commit comments