@@ -446,8 +446,8 @@ def main():
446
446
help = "Leave bitcoinds and test.* datadir on exit or error" )
447
447
parser .add_argument ('--resultsfile' , '-r' , help = 'store test results (as CSV) to the provided file' )
448
448
449
-
450
449
args , unknown_args = parser .parse_known_args ()
450
+ fail_on_warn = args .ci
451
451
if not args .ansi :
452
452
global DEFAULT , BOLD , GREEN , RED
453
453
DEFAULT = ("" , "" )
@@ -524,8 +524,12 @@ def main():
524
524
# Remove the test cases that the user has explicitly asked to exclude.
525
525
# The user can specify a test case with or without the .py extension.
526
526
if args .exclude :
527
+
527
528
def print_warning_missing_test (test_name ):
528
- print ("{}WARNING!{} Test '{}' not found in current test list." .format (BOLD [1 ], BOLD [0 ], test_name ))
529
+ print ("{}WARNING!{} Test '{}' not found in current test list. Check the --exclude list." .format (BOLD [1 ], BOLD [0 ], test_name ))
530
+ if fail_on_warn :
531
+ sys .exit (1 )
532
+
529
533
def remove_tests (exclude_list ):
530
534
if not exclude_list :
531
535
print_warning_missing_test (exclude_test )
@@ -562,7 +566,7 @@ def remove_tests(exclude_list):
562
566
f"A minimum of { MIN_NO_CLEANUP_SPACE // (1024 * 1024 * 1024 )} GB of free space is required." )
563
567
passon_args .append ("--nocleanup" )
564
568
565
- check_script_list (src_dir = config ["environment" ]["SRCDIR" ], fail_on_warn = args . ci )
569
+ check_script_list (src_dir = config ["environment" ]["SRCDIR" ], fail_on_warn = fail_on_warn )
566
570
check_script_prefixes ()
567
571
568
572
if not args .keepcache :
@@ -871,7 +875,6 @@ def check_script_list(*, src_dir, fail_on_warn):
871
875
if len (missed_tests ) != 0 :
872
876
print ("%sWARNING!%s The following scripts are not being run: %s. Check the test lists in test_runner.py." % (BOLD [1 ], BOLD [0 ], str (missed_tests )))
873
877
if fail_on_warn :
874
- # On CI this warning is an error to prevent merging incomplete commits into master
875
878
sys .exit (1 )
876
879
877
880
0 commit comments