Skip to content

Commit

Permalink
Rename test/pull-tester/rpc-tests.py to test/functional/test_runner.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jnewbery committed Mar 20, 2017
1 parent c28ee91 commit a9bd622
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ script:
- make $MAKEJOBS $GOAL || ( echo "Build failure. Verbose build follows." && make $GOAL V=1 ; false )
- export LD_LIBRARY_PATH=$TRAVIS_BUILD_DIR/depends/$HOST/lib
- if [ "$RUN_TESTS" = "true" ]; then make $MAKEJOBS check VERBOSE=1; fi
- if [ "$RUN_TESTS" = "true" ]; then functional/pull-tester/rpc-tests.py --coverage; fi
- if [ "$RUN_TESTS" = "true" ]; then test/functional/test_runner.py --coverage; fi
after_script:
- echo $TRAVIS_COMMIT_RANGE
- echo $TRAVIS_COMMIT_LOG
6 changes: 3 additions & 3 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ test_bitcoin_filtered.info: test_bitcoin.info
$(LCOV) -r $< "/usr/include/*" -o $@

functional_test.info: test_bitcoin_filtered.info
-@TIMEOUT=15 python test/pull-tester/rpc-tests.py $(EXTENDED_RPC_TESTS)
-@TIMEOUT=15 python test/functional/test_runner.py $(EXTENDED_RPC_TESTS)
$(LCOV) -c -d $(abs_builddir)/src --t functional-tests -o $@
$(LCOV) -z -d $(abs_builddir)/src
$(LCOV) -z -d $(abs_builddir)/src/leveldb
Expand Down Expand Up @@ -223,7 +223,7 @@ endif

dist_noinst_SCRIPTS = autogen.sh

EXTRA_DIST = $(top_srcdir)/share/genbuild.sh test/pull-tester/rpc-tests.py test/functional $(DIST_CONTRIB) $(DIST_DOCS) $(WINDOWS_PACKAGING) $(OSX_PACKAGING) $(BIN_CHECKS)
EXTRA_DIST = $(top_srcdir)/share/genbuild.sh test/functional/test_runner.py test/functional $(DIST_CONTRIB) $(DIST_DOCS) $(WINDOWS_PACKAGING) $(OSX_PACKAGING) $(BIN_CHECKS)

CLEANFILES = $(OSX_DMG) $(BITCOIN_WIN_INSTALLER)

Expand All @@ -233,4 +233,4 @@ DISTCHECK_CONFIGURE_FLAGS = --enable-man

clean-local:
rm -rf coverage_percent.txt test_bitcoin.coverage/ total.coverage/ test/tmp/ cache/ $(OSX_APP)
rm -rf test/pull-tester/__pycache__
rm -rf test/functional/__pycache__
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ and extending unit tests can be found in [/src/test/README.md](/src/test/README.

There are also [regression and integration tests](/test), written
in Python, that are run automatically on the build server.
These tests can be run (if the [test dependencies](/test) are installed) with: `test/pull-tester/rpc-tests.py`
These tests can be run (if the [test dependencies](/test) are installed) with: `test/functional/test_runner.py`

The Travis CI system makes sure that every pull request is built for Windows, Linux, and OS X, and that unit/sanity tests are run automatically.

Expand Down
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1147,9 +1147,9 @@ AC_SUBST(EVENT_PTHREADS_LIBS)
AC_SUBST(ZMQ_LIBS)
AC_SUBST(PROTOBUF_LIBS)
AC_SUBST(QR_LIBS)
AC_CONFIG_FILES([Makefile src/Makefile doc/man/Makefile share/setup.nsi share/qt/Info.plist src/test/buildenv.py test/pull-tester/tests_config.ini])
AC_CONFIG_FILES([Makefile src/Makefile doc/man/Makefile share/setup.nsi share/qt/Info.plist src/test/buildenv.py test/functional/config.ini])
AC_CONFIG_FILES([contrib/devtools/split-debug.sh],[chmod +x contrib/devtools/split-debug.sh])
AC_CONFIG_LINKS([test/pull-tester/rpc-tests.py:test/pull-tester/rpc-tests.py])
AC_CONFIG_LINKS([test/functional/test_runner.py:test/functional/test_runner.py])

dnl boost's m4 checks do something really nasty: they export these vars. As a
dnl result, they leak into secp256k1's configure and crazy things happen.
Expand Down
2 changes: 1 addition & 1 deletion contrib/rpm/bitcoin.spec
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ make check
pushd src
srcdir=. test/bitcoin-util-test.py
popd
test/pull-tester/rpc-tests.py -extended
test/functional/test_runner.py --extended

%post libs -p /sbin/ldconfig

Expand Down
14 changes: 7 additions & 7 deletions test/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
The [pull-tester](/test/pull-tester/) folder contains a script to call
multiple tests from the [functional](/test/functional/) folder.
The [functional](/test/functional/) folder contains a script test_runner
to call multiple functional tests from its folder.

Every pull request to the bitcoin repository is built and run through
the regression test suite. You can also run all or only individual
Expand Down Expand Up @@ -27,19 +27,19 @@ Running tests

You can run any single test by calling

test/pull-tester/rpc-tests.py <testname>
test/functional/test_runner.py <testname>

Or you can run any combination of tests by calling

test/pull-tester/rpc-tests.py <testname1> <testname2> <testname3> ...
test/functional/test_runner.py <testname1> <testname2> <testname3> ...

Run the regression test suite with

test/pull-tester/rpc-tests.py
test/functional/test_runner.py

Run all possible tests with

test/pull-tester/rpc-tests.py --extended
test/functional/test_runner.py --extended

By default, tests will be run in parallel. To specify how many jobs to run,
append `--jobs=n` (default n=4).
Expand All @@ -61,7 +61,7 @@ Possible options, which apply to each individual test run:
```

If you set the environment variable `PYTHON_DEBUG=1` you will get some debug
output (example: `PYTHON_DEBUG=1 test/pull-tester/rpc-tests.py wallet`).
output (example: `PYTHON_DEBUG=1 test/functional/test_runner.py wallet`).

A 200-block -regtest blockchain and wallets for four nodes
is created the first time a regression test is run and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# file COPYING or http://www.opensource.org/licenses/mit-license.php.

# These environment variables are set by the build process and read by
# rpc-tests.py
# test/functional/test_runner.py

[environment]
SRCDIR=@abs_top_srcdir@
Expand Down
2 changes: 1 addition & 1 deletion test/functional/create_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"""Create a blockchain cache.
Creating a cache of the blockchain speeds up test execution when running
multiple functional tests. This helper script is executed by rpc-tests when multiple
multiple functional tests. This helper script is executed by test_runner when multiple
tests are being run in parallel.
"""

Expand Down
17 changes: 8 additions & 9 deletions test/pull-tester/rpc-tests.py → test/functional/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
rpc-tests.py - run regression test suite
"""Run regression test suite.
This module calls down into individual test cases via subprocess. It will
forward all unrecognized arguments onto the individual test scripts.
Functional tests are disabled on Windows by default. Use --force to run them anyway.
For a description of arguments recognized by test scripts, see
`test/pull-tester/test_framework/test_framework.py:BitcoinTestFramework.main`.
`test/functional/test_framework/test_framework.py:BitcoinTestFramework.main`.
"""

Expand Down Expand Up @@ -87,7 +86,7 @@

ZMQ_SCRIPTS = [
# ZMQ test can only be run if bitcoin was built with zmq-enabled.
# call rpc_tests.py with -nozmq to explicitly exclude these tests.
# call test_runner.py with -nozmq to explicitly exclude these tests.
"zmq_test.py"]

EXTENDED_SCRIPTS = [
Expand Down Expand Up @@ -127,7 +126,7 @@
def main():
# Parse arguments and pass through unrecognised args
parser = argparse.ArgumentParser(add_help=False,
usage='%(prog)s [rpc-test.py options] [script options] [scripts]',
usage='%(prog)s [test_runner.py options] [script options] [scripts]',
description=__doc__,
epilog='''
Help text and arguments for individual test script:''',
Expand All @@ -147,7 +146,7 @@ def main():

# Read config generated by configure.
config = configparser.ConfigParser()
config.read_file(open(os.path.dirname(__file__) + "/tests_config.ini"))
config.read_file(open(os.path.dirname(__file__) + "/config.ini"))

enable_wallet = config["components"].getboolean("ENABLE_WALLET")
enable_utils = config["components"].getboolean("ENABLE_UTILS")
Expand Down Expand Up @@ -200,11 +199,11 @@ def main():

if not test_list:
print("No valid test scripts specified. Check that your test is in one "
"of the test lists in rpc-tests.py, or run rpc-tests.py with no arguments to run all tests")
"of the test lists in test_runner.py, or run test_runner.py with no arguments to run all tests")
sys.exit(0)

if args.help:
# Print help for rpc-tests.py, then print help of the first script and exit.
# Print help for test_runner.py, then print help of the first script and exit.
parser.print_help()
subprocess.check_call((config["environment"]["SRCDIR"] + '/test/functional/' + test_list[0]).split() + ['-h'])
sys.exit(0)
Expand Down Expand Up @@ -325,7 +324,7 @@ def get_next(self):

class RPCCoverage(object):
"""
Coverage reporting utilities for pull-tester.
Coverage reporting utilities for test_runner.
Coverage calculation works by having each test script subprocess write
coverage files into a particular directory. These files contain the RPC
Expand Down

0 comments on commit a9bd622

Please sign in to comment.