@@ -238,7 +238,8 @@ def check_cached_replay(project, sanitizer='address', integrity_test=False):
238238def check_test (project ,
239239 sanitizer = 'address' ,
240240 run_full_cache_replay = False ,
241- integrity_test = False ):
241+ integrity_test = False ,
242+ stop_on_failure = False ):
242243 """Run the `run_tests.sh` script for a specific project. Will
243244 build a cached container first."""
244245
@@ -325,6 +326,11 @@ def check_test(project,
325326 'result' : 'Success'
326327 })
327328 else :
329+ if stop_on_failure :
330+ logger .info (
331+ '%s integrity check failed on patch %s, stopping as requested.' ,
332+ project , logic_patch .name )
333+ return False
328334 integrity_checks .append ({'patch' : logic_patch .name , 'result' : 'Failed' })
329335
330336 logger .info ('%s integrity check results:' , project )
@@ -548,7 +554,7 @@ def extract_test_coverage(project):
548554
549555def _cmd_dispatcher_check_test (args ):
550556 check_test (args .project , args .sanitizer , args .run_full_cache_replay ,
551- args .check_patch_integrity )
557+ args .check_patch_integrity , args . stop_on_failure )
552558
553559
554560def _cmd_dispatcher_check_replay (args ):
@@ -597,6 +603,10 @@ def parse_args():
597603 type = str ,
598604 help = 'The name of the project to check (e.g., "libpng").' ,
599605 )
606+ check_test_parser .add_argument (
607+ '--stop-on-failure' ,
608+ action = 'store_true' ,
609+ help = 'If set, will stop integrity checks on first failure.' )
600610 check_test_parser .add_argument (
601611 '--sanitizer' ,
602612 default = 'address' ,
0 commit comments