File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -48,12 +48,20 @@ def retrieve_test_list(config_file=f"{PARENT_DIR}/.buildkite/test_description.js
4848 parser .add_argument ("-l" , "--list-tests" ,
4949 action = 'store_true' , default = False ,
5050 help = "List available tests" )
51+ parser .add_argument ('tests' , nargs = '*' ,
52+ help = "The tests to run. If none are specified "
53+ "run all the available tests." )
5154 args = parser .parse_args ()
5255
5356 test_config = retrieve_test_list ()
5457
5558 for test in test_config ["tests" ]:
5659 name = test ["test_name" ]
60+
61+ if len (args .tests ) > 0 :
62+ if name not in args .tests :
63+ continue
64+
5765 command = test ["command" ]
5866 command = command .replace ("{target_platform}" , platform .machine ())
5967 if args .list_tests :
@@ -63,4 +71,5 @@ def retrieve_test_list(config_file=f"{PARENT_DIR}/.buildkite/test_description.js
6371 setattr (TestsContainer , f"test_{ name } " , test_func )
6472
6573 if not args .list_tests :
66- unittest .main (verbosity = 2 )
74+ tests_suite = unittest .TestLoader ().loadTestsFromTestCase (TestsContainer )
75+ unittest .TextTestRunner (verbosity = 2 ).run (tests_suite )
You can’t perform that action at this time.
0 commit comments