Skip to content

Commit 5609356

Browse files
committed
Merge bitcoin/bitcoin#31018: test: Treat exclude list warning as failure in CI
fa6d14e test: Treat exclude list warning as failure in CI (MarcoFalke) Pull request description: An outdated exclude list or otherwise an error in the exclude list handling is usually a bug. So make it fatal in the CI, instead of silently ignoring it. Fixes https://github.com/bitcoin/bitcoin/pull/30872/files#r1757015334 Can be tested with something like (with and without `--ci`): ``` ./bld-cmake/test/functional/test_runner.py wallet_disable -x wallet_disablee ACKs for top commit: tdb3: ACK fa6d14e ismaelsadeeq: utACK fa6d14e Tree-SHA512: 03a70dff9d1272d982591d60ab764f9233d4802488bc1bad305a2755e2d7ed86e691ee94767a3bc5f68321b63214aba44e6f9edd1543dfad7a20f9397cf78734
2 parents bb47b5a + fa6d14e commit 5609356

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

test/functional/test_runner.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -447,8 +447,8 @@ def main():
447447
help="Leave bitcoinds and test.* datadir on exit or error")
448448
parser.add_argument('--resultsfile', '-r', help='store test results (as CSV) to the provided file')
449449

450-
451450
args, unknown_args = parser.parse_known_args()
451+
fail_on_warn = args.ci
452452
if not args.ansi:
453453
global DEFAULT, BOLD, GREEN, RED
454454
DEFAULT = ("", "")
@@ -525,8 +525,12 @@ def main():
525525
# Remove the test cases that the user has explicitly asked to exclude.
526526
# The user can specify a test case with or without the .py extension.
527527
if args.exclude:
528+
528529
def print_warning_missing_test(test_name):
529-
print("{}WARNING!{} Test '{}' not found in current test list.".format(BOLD[1], BOLD[0], test_name))
530+
print("{}WARNING!{} Test '{}' not found in current test list. Check the --exclude list.".format(BOLD[1], BOLD[0], test_name))
531+
if fail_on_warn:
532+
sys.exit(1)
533+
530534
def remove_tests(exclude_list):
531535
if not exclude_list:
532536
print_warning_missing_test(exclude_test)
@@ -563,7 +567,7 @@ def remove_tests(exclude_list):
563567
f"A minimum of {MIN_NO_CLEANUP_SPACE // (1024 * 1024 * 1024)} GB of free space is required.")
564568
passon_args.append("--nocleanup")
565569

566-
check_script_list(src_dir=config["environment"]["SRCDIR"], fail_on_warn=args.ci)
570+
check_script_list(src_dir=config["environment"]["SRCDIR"], fail_on_warn=fail_on_warn)
567571
check_script_prefixes()
568572

569573
if not args.keepcache:
@@ -872,7 +876,6 @@ def check_script_list(*, src_dir, fail_on_warn):
872876
if len(missed_tests) != 0:
873877
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)))
874878
if fail_on_warn:
875-
# On CI this warning is an error to prevent merging incomplete commits into master
876879
sys.exit(1)
877880

878881

0 commit comments

Comments
 (0)