Skip to content

Commit fa3a38a

Browse files
author
MarcoFalke
committed
[qa] pull-tester: Cleanup (run keypool, tidy stdout)
* Run keypool (takes 6 seconds) * Print duration of each rpc test * Structure output (bold, new lines)
1 parent a775182 commit fa3a38a

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

qa/pull-tester/rpc-tests.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"""
2323

2424
import os
25+
import time
2526
import shutil
2627
import sys
2728
import subprocess
@@ -47,6 +48,10 @@
4748
passOn = ""
4849
p = re.compile("^--")
4950

51+
bold = ("","")
52+
if (os.name == 'posix'):
53+
bold = ('\033[0m', '\033[1m')
54+
5055
for arg in sys.argv[1:]:
5156
if arg == '--coverage':
5257
ENABLE_COVERAGE = 1
@@ -92,6 +97,7 @@
9297
'blockchain.py',
9398
'disablewallet.py',
9499
'sendheaders.py',
100+
'keypool.py',
95101
]
96102
testScriptsExt = [
97103
'bip65-cltv.py',
@@ -105,7 +111,6 @@
105111
'pruning.py',
106112
'forknotify.py',
107113
'invalidateblock.py',
108-
'keypool.py',
109114
# 'rpcbind_test.py', #temporary, bug in libevent, see #6655
110115
'smartfees.py',
111116
'maxblocksinflight.py',
@@ -126,7 +131,7 @@ def runtests():
126131

127132
if ENABLE_COVERAGE:
128133
coverage = RPCCoverage()
129-
print("Initializing coverage directory at %s" % coverage.dir)
134+
print("Initializing coverage directory at %s\n" % coverage.dir)
130135

131136
if(ENABLE_WALLET == 1 and ENABLE_UTILS == 1 and ENABLE_BITCOIND == 1):
132137
rpcTestDir = buildDir + '/qa/rpc-tests/'
@@ -141,10 +146,12 @@ def runtests():
141146
or run_extended
142147
or testScripts[i] in opts
143148
or re.sub(".py$", "", testScripts[i]) in opts ):
144-
print("Running testscript " + testScripts[i] + "...")
145149

150+
print("Running testscript %s%s%s ..." % (bold[1], testScripts[i], bold[0]))
151+
time0 = time.time()
146152
subprocess.check_call(
147153
rpcTestDir + testScripts[i] + flags, shell=True)
154+
print("Duration: %s s\n" % (int(time.time() - time0)))
148155

149156
# exit if help is called so we print just one set of
150157
# instructions
@@ -156,12 +163,14 @@ def runtests():
156163
for i in range(len(testScriptsExt)):
157164
if (run_extended or testScriptsExt[i] in opts
158165
or re.sub(".py$", "", testScriptsExt[i]) in opts):
166+
159167
print(
160168
"Running 2nd level testscript "
161-
+ testScriptsExt[i] + "...")
162-
169+
+ "%s%s%s ..." % (bold[1], testScriptsExt[i], bold[0]))
170+
time0 = time.time()
163171
subprocess.check_call(
164172
rpcTestDir + testScriptsExt[i] + flags, shell=True)
173+
print("Duration: %s s\n" % (int(time.time() - time0)))
165174

166175
if coverage:
167176
coverage.report_rpc_coverage()

0 commit comments

Comments
 (0)