Skip to content

Commit

Permalink
Have pull-tester run the listtransactions.py regression test
Browse files Browse the repository at this point in the history
This should show how to run a python-based regression test
successfully in the pull-tester environment.
  • Loading branch information
gavinandresen committed Apr 2, 2014
1 parent 397521d commit cb4bdd1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ check-local:
@qa/pull-tester/run-bitcoind-for-test.sh $(JAVA) -jar $(JAVA_COMPARISON_TOOL) qa/tmp/compTool $(COMPARISON_TOOL_REORG_TESTS)
endif

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

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

Expand Down
3 changes: 3 additions & 0 deletions qa/pull-tester/build-tests.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ make check

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

if [ $RUN_EXPENSIVE_TESTS = 1 ]; then
# Run unit tests and blockchain-tester on Windows:
Expand Down
13 changes: 8 additions & 5 deletions qa/rpc-tests/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def initialize_chain(test_dir):
"""

if not os.path.isdir(os.path.join("cache", "node0")):
devnull = open("/dev/null", "w+")
# Create cache directories, run bitcoinds:
for i in range(4):
datadir = os.path.join("cache", "node"+str(i))
Expand All @@ -79,9 +80,9 @@ def initialize_chain(test_dir):
if i > 0:
args.append("-connect=127.0.0.1:"+str(START_P2P_PORT))
bitcoind_processes.append(subprocess.Popen(args))
subprocess.check_output([ "bitcoin-cli", "-datadir="+datadir,
"-rpcwait", "getblockcount"])

subprocess.check_call([ "bitcoin-cli", "-datadir="+datadir,
"-rpcwait", "getblockcount"], stdout=devnull)
devnull.close()
rpcs = []
for i in range(4):
try:
Expand Down Expand Up @@ -113,12 +114,14 @@ def initialize_chain(test_dir):

def start_nodes(num_nodes, dir):
# Start bitcoinds, and wait for RPC interface to be up and running:
devnull = open("/dev/null", "w+")
for i in range(num_nodes):
datadir = os.path.join(dir, "node"+str(i))
args = [ "bitcoind", "-datadir="+datadir ]
bitcoind_processes.append(subprocess.Popen(args))
subprocess.check_output([ "bitcoin-cli", "-datadir="+datadir,
"-rpcwait", "getblockcount"])
subprocess.check_call([ "bitcoin-cli", "-datadir="+datadir,
"-rpcwait", "getblockcount"], stdout=devnull)
devnull.close()
# Create&return JSON-RPC connections
rpc_connections = []
for i in range(num_nodes):
Expand Down

0 comments on commit cb4bdd1

Please sign in to comment.