[qa] pull-tester: Cleanup (run keypool, tidy stdout)

* Run keypool (takes 6 seconds)
* Print duration of each rpc test
* Structure output (bold, new lines)
This commit is contained in:
MarcoFalke 2015-11-30 14:53:07 +01:00
parent a7751824ce
commit fa3a38a7f2

View File

@ -22,6 +22,7 @@ For a description of arguments recognized by test scripts, see
""" """
import os import os
import time
import shutil import shutil
import sys import sys
import subprocess import subprocess
@ -47,6 +48,10 @@ opts = set()
passOn = "" passOn = ""
p = re.compile("^--") p = re.compile("^--")
bold = ("","")
if (os.name == 'posix'):
bold = ('\033[0m', '\033[1m')
for arg in sys.argv[1:]: for arg in sys.argv[1:]:
if arg == '--coverage': if arg == '--coverage':
ENABLE_COVERAGE = 1 ENABLE_COVERAGE = 1
@ -92,6 +97,7 @@ testScripts = [
'blockchain.py', 'blockchain.py',
'disablewallet.py', 'disablewallet.py',
'sendheaders.py', 'sendheaders.py',
'keypool.py',
] ]
testScriptsExt = [ testScriptsExt = [
'bip65-cltv.py', 'bip65-cltv.py',
@ -105,7 +111,6 @@ testScriptsExt = [
'pruning.py', 'pruning.py',
'forknotify.py', 'forknotify.py',
'invalidateblock.py', 'invalidateblock.py',
'keypool.py',
# 'rpcbind_test.py', #temporary, bug in libevent, see #6655 # 'rpcbind_test.py', #temporary, bug in libevent, see #6655
'smartfees.py', 'smartfees.py',
'maxblocksinflight.py', 'maxblocksinflight.py',
@ -126,7 +131,7 @@ def runtests():
if ENABLE_COVERAGE: if ENABLE_COVERAGE:
coverage = RPCCoverage() coverage = RPCCoverage()
print("Initializing coverage directory at %s" % coverage.dir) print("Initializing coverage directory at %s\n" % coverage.dir)
if(ENABLE_WALLET == 1 and ENABLE_UTILS == 1 and ENABLE_BITCOIND == 1): if(ENABLE_WALLET == 1 and ENABLE_UTILS == 1 and ENABLE_BITCOIND == 1):
rpcTestDir = buildDir + '/qa/rpc-tests/' rpcTestDir = buildDir + '/qa/rpc-tests/'
@ -141,10 +146,12 @@ def runtests():
or run_extended or run_extended
or testScripts[i] in opts or testScripts[i] in opts
or re.sub(".py$", "", testScripts[i]) in opts ): or re.sub(".py$", "", testScripts[i]) in opts ):
print("Running testscript " + testScripts[i] + "...")
print("Running testscript %s%s%s ..." % (bold[1], testScripts[i], bold[0]))
time0 = time.time()
subprocess.check_call( subprocess.check_call(
rpcTestDir + testScripts[i] + flags, shell=True) rpcTestDir + testScripts[i] + flags, shell=True)
print("Duration: %s s\n" % (int(time.time() - time0)))
# exit if help is called so we print just one set of # exit if help is called so we print just one set of
# instructions # instructions
@ -156,12 +163,14 @@ def runtests():
for i in range(len(testScriptsExt)): for i in range(len(testScriptsExt)):
if (run_extended or testScriptsExt[i] in opts if (run_extended or testScriptsExt[i] in opts
or re.sub(".py$", "", testScriptsExt[i]) in opts): or re.sub(".py$", "", testScriptsExt[i]) in opts):
print( print(
"Running 2nd level testscript " "Running 2nd level testscript "
+ testScriptsExt[i] + "...") + "%s%s%s ..." % (bold[1], testScriptsExt[i], bold[0]))
time0 = time.time()
subprocess.check_call( subprocess.check_call(
rpcTestDir + testScriptsExt[i] + flags, shell=True) rpcTestDir + testScriptsExt[i] + flags, shell=True)
print("Duration: %s s\n" % (int(time.time() - time0)))
if coverage: if coverage:
coverage.report_rpc_coverage() coverage.report_rpc_coverage()