Skip to content

Commit 8d57319

Browse files
author
MarcoFalke
committed
Merge #12252: Require all tests to follow naming convention
125f4a4 [tests] Require all tests to follow naming convention (Anthony Towns) Pull request description: Based on top of #11774 Tree-SHA512: 1eb156b5a97b30c203b7b0ad3d2055b391ef825e2e57805c7745b5259a9b1caaa115768ec225452f12f354e550f83e071f9c6fee2c36698b4679191895aab8de
2 parents 10847fe + 125f4a4 commit 8d57319

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

test/functional/test_runner.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -472,21 +472,15 @@ def was_successful(self):
472472

473473

474474
def check_script_prefixes():
475-
"""Check that at most a handful of the
476-
test scripts don't start with one of the allowed name prefixes."""
477-
478-
# LEEWAY is provided as a transition measure, so that pull-requests
479-
# that introduce new tests that don't conform with the naming
480-
# convention don't immediately cause the tests to fail.
481-
LEEWAY = 10
475+
"""Check that test scripts start with one of the allowed name prefixes."""
482476

483477
good_prefixes_re = re.compile("(example|feature|interface|mempool|mining|p2p|rpc|wallet)_")
484478
bad_script_names = [script for script in ALL_SCRIPTS if good_prefixes_re.match(script) is None]
485479

486-
if len(bad_script_names) > 0:
487-
print("INFO: %d tests not meeting naming conventions:" % (len(bad_script_names)))
480+
if bad_script_names:
481+
print("%sERROR:%s %d tests not meeting naming conventions:" % (BOLD[1], BOLD[0], len(bad_script_names)))
488482
print(" %s" % ("\n ".join(sorted(bad_script_names))))
489-
assert len(bad_script_names) <= LEEWAY, "Too many tests not following naming convention! (%d found, maximum: %d)" % (len(bad_script_names), LEEWAY)
483+
raise AssertionError("Some tests are not following naming convention!")
490484

491485

492486
def check_script_list(src_dir):

0 commit comments

Comments
 (0)