Skip to content

Commit 79af9fb

Browse files
author
MarcoFalke
committed
Merge #10096: Check that all test scripts in test/functional are being run
29d6634 Check that all test scripts in test/functional are being run (John Newbery) Tree-SHA512: 9231d3a119632be031c51c4f7e95a8adae58489a8ec36fc967d499c0708bae2941a3bf28f11dcd4efd59141eb54c3c920f2629f5cd8a0139d30397a19591666d
2 parents c412fd8 + 29d6634 commit 79af9fb

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

test/functional/test_runner.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,13 @@
128128

129129
ALL_SCRIPTS = BASE_SCRIPTS + ZMQ_SCRIPTS + EXTENDED_SCRIPTS
130130

131+
NON_SCRIPTS = [
132+
# These are python files that live in the functional tests directory, but are not test scripts.
133+
"combine_logs.py",
134+
"create_cache.py",
135+
"test_runner.py",
136+
]
137+
131138
def main():
132139
# Parse arguments and pass through unrecognised args
133140
parser = argparse.ArgumentParser(add_help=False,
@@ -218,6 +225,8 @@ def main():
218225
subprocess.check_call([(config["environment"]["SRCDIR"] + '/test/functional/' + test_list[0].split()[0])] + ['-h'])
219226
sys.exit(0)
220227

228+
check_script_list(config["environment"]["SRCDIR"])
229+
221230
run_tests(test_list, config["environment"]["SRCDIR"], config["environment"]["BUILDDIR"], config["environment"]["EXEEXT"], args.jobs, args.coverage, passon_args)
222231

223232
def run_tests(test_list, src_dir, build_dir, exeext, jobs=1, enable_coverage=False, args=[]):
@@ -341,6 +350,18 @@ def get_next(self):
341350
return name, stdout, stderr, status, int(time.time() - time0)
342351
print('.', end='', flush=True)
343352

353+
def check_script_list(src_dir):
354+
"""Check scripts directory.
355+
356+
Check that there are no scripts in the functional tests directory which are
357+
not being run by pull-tester.py."""
358+
script_dir = src_dir + '/test/functional/'
359+
python_files = set([t for t in os.listdir(script_dir) if t[-3:] == ".py"])
360+
missed_tests = list(python_files - set(map(lambda x: x.split()[0], ALL_SCRIPTS + NON_SCRIPTS)))
361+
if len(missed_tests) != 0:
362+
print("The following scripts are not being run:" + str(missed_tests))
363+
print("Check the test lists in test_runner.py")
364+
sys.exit(1)
344365

345366
class RPCCoverage(object):
346367
"""

0 commit comments

Comments
 (0)