mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-10-10 19:43:13 +02:00
tests: Fail if RPC has been added without tests
This commit is contained in:
@@ -401,16 +401,18 @@ def run_tests(*, test_list, src_dir, build_dir, tmpdir, jobs=1, enable_coverage=
|
||||
print_results(test_results, max_len_name, (int(time.time() - start_time)))
|
||||
|
||||
if coverage:
|
||||
coverage.report_rpc_coverage()
|
||||
coverage_passed = coverage.report_rpc_coverage()
|
||||
|
||||
logging.debug("Cleaning up coverage data")
|
||||
coverage.cleanup()
|
||||
else:
|
||||
coverage_passed = True
|
||||
|
||||
# Clear up the temp directory if all subdirectories are gone
|
||||
if not os.listdir(tmpdir):
|
||||
os.rmdir(tmpdir)
|
||||
|
||||
all_passed = all(map(lambda test_result: test_result.was_successful, test_results))
|
||||
all_passed = all(map(lambda test_result: test_result.was_successful, test_results)) and coverage_passed
|
||||
|
||||
# This will be a no-op unless failfast is True in which case there may be dangling
|
||||
# processes which need to be killed.
|
||||
@@ -612,8 +614,10 @@ class RPCCoverage():
|
||||
if uncovered:
|
||||
print("Uncovered RPC commands:")
|
||||
print("".join((" - %s\n" % command) for command in sorted(uncovered)))
|
||||
return False
|
||||
else:
|
||||
print("All RPC commands covered.")
|
||||
return True
|
||||
|
||||
def cleanup(self):
|
||||
return shutil.rmtree(self.dir)
|
||||
|
Reference in New Issue
Block a user