Skip to content

Commit cb4bdd1

Browse files
committed
Have pull-tester run the listtransactions.py regression test
This should show how to run a python-based regression test successfully in the pull-tester environment.
1 parent 397521d commit cb4bdd1

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ check-local:
162162
@qa/pull-tester/run-bitcoind-for-test.sh $(JAVA) -jar $(JAVA_COMPARISON_TOOL) qa/tmp/compTool $(COMPARISON_TOOL_REORG_TESTS)
163163
endif
164164

165-
EXTRA_DIST = $(top_srcdir)/share/genbuild.sh qa/pull-tester/pull-tester.sh $(DIST_DOCS) $(WINDOWS_PACKAGING) $(OSX_PACKAGING)
165+
EXTRA_DIST = $(top_srcdir)/share/genbuild.sh qa/pull-tester/pull-tester.sh qa/rpc-tests $(DIST_DOCS) $(WINDOWS_PACKAGING) $(OSX_PACKAGING)
166166

167167
CLEANFILES = $(OSX_DMG) $(OSX_APP) $(BITCOIN_WIN_INSTALLER)
168168

qa/pull-tester/build-tests.sh.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ make check
7474

7575
# Run RPC integration test on Linux:
7676
@abs_top_srcdir@/qa/rpc-tests/wallet.sh @abs_top_srcdir@/linux-build/src
77+
@abs_top_srcdir@/qa/rpc-tests/listtransactions.py --srcdir @abs_top_srcdir@/linux-build/src
78+
# Clean up cache/ directory that the python regression tests create
79+
rm -rf cache
7780

7881
if [ $RUN_EXPENSIVE_TESTS = 1 ]; then
7982
# Run unit tests and blockchain-tester on Windows:

qa/rpc-tests/util.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ def initialize_chain(test_dir):
6565
"""
6666

6767
if not os.path.isdir(os.path.join("cache", "node0")):
68+
devnull = open("/dev/null", "w+")
6869
# Create cache directories, run bitcoinds:
6970
for i in range(4):
7071
datadir = os.path.join("cache", "node"+str(i))
@@ -79,9 +80,9 @@ def initialize_chain(test_dir):
7980
if i > 0:
8081
args.append("-connect=127.0.0.1:"+str(START_P2P_PORT))
8182
bitcoind_processes.append(subprocess.Popen(args))
82-
subprocess.check_output([ "bitcoin-cli", "-datadir="+datadir,
83-
"-rpcwait", "getblockcount"])
84-
83+
subprocess.check_call([ "bitcoin-cli", "-datadir="+datadir,
84+
"-rpcwait", "getblockcount"], stdout=devnull)
85+
devnull.close()
8586
rpcs = []
8687
for i in range(4):
8788
try:
@@ -113,12 +114,14 @@ def initialize_chain(test_dir):
113114

114115
def start_nodes(num_nodes, dir):
115116
# Start bitcoinds, and wait for RPC interface to be up and running:
117+
devnull = open("/dev/null", "w+")
116118
for i in range(num_nodes):
117119
datadir = os.path.join(dir, "node"+str(i))
118120
args = [ "bitcoind", "-datadir="+datadir ]
119121
bitcoind_processes.append(subprocess.Popen(args))
120-
subprocess.check_output([ "bitcoin-cli", "-datadir="+datadir,
121-
"-rpcwait", "getblockcount"])
122+
subprocess.check_call([ "bitcoin-cli", "-datadir="+datadir,
123+
"-rpcwait", "getblockcount"], stdout=devnull)
124+
devnull.close()
122125
# Create&return JSON-RPC connections
123126
rpc_connections = []
124127
for i in range(num_nodes):

0 commit comments

Comments
 (0)