|
| 1 | +The [pull-tester](/qa/pull-tester/) folder contains a script to call |
| 2 | +multiple tests from the [rpc-tests](/qa/rpc-tests/) folder. |
| 3 | + |
| 4 | +Every pull request to the bitcoin repository is built and run through |
| 5 | +the regression test suite. You can also run all or only individual |
| 6 | +tests locally. |
| 7 | + |
| 8 | +Running tests |
| 9 | +============= |
| 10 | + |
| 11 | +You can run any single test by calling `qa/pull-tester/rpc-tests.py <testname>`. |
| 12 | + |
| 13 | +Or you can run any combination of tests by calling `qa/pull-tester/rpc-tests.py <testname1> <testname2> <testname3> ...` |
| 14 | + |
| 15 | +Run the regression test suite with `qa/pull-tester/rpc-tests.py` |
| 16 | + |
| 17 | +Run all possible tests with `qa/pull-tester/rpc-tests.py -extended` |
| 18 | + |
| 19 | +Possible options: |
| 20 | + |
| 21 | +``` |
| 22 | + -h, --help show this help message and exit |
| 23 | + --nocleanup Leave bitcoinds and test.* datadir on exit or error |
| 24 | + --noshutdown Don't stop bitcoinds after the test execution |
| 25 | + --srcdir=SRCDIR Source directory containing bitcoind/bitcoin-cli |
| 26 | + (default: ../../src) |
| 27 | + --tmpdir=TMPDIR Root directory for datadirs |
| 28 | + --tracerpc Print out all RPC calls as they are made |
| 29 | + --coveragedir=COVERAGEDIR |
| 30 | + Write tested RPC commands into this directory |
| 31 | +``` |
| 32 | + |
| 33 | +If you set the environment variable `PYTHON_DEBUG=1` you will get some debug |
| 34 | +output (example: `PYTHON_DEBUG=1 qa/pull-tester/rpc-tests.py wallet`). |
| 35 | + |
| 36 | +A 200-block -regtest blockchain and wallets for four nodes |
| 37 | +is created the first time a regression test is run and |
| 38 | +is stored in the cache/ directory. Each node has 25 mature |
| 39 | +blocks (25*50=1250 BTC) in its wallet. |
| 40 | + |
| 41 | +After the first run, the cache/ blockchain and wallets are |
| 42 | +copied into a temporary directory and used as the initial |
| 43 | +test state. |
| 44 | + |
| 45 | +If you get into a bad state, you should be able |
| 46 | +to recover with: |
| 47 | + |
| 48 | +```bash |
| 49 | +rm -rf cache |
| 50 | +killall bitcoind |
| 51 | +``` |
| 52 | + |
| 53 | +Writing tests |
| 54 | +============= |
| 55 | +You are encouraged to write tests for new or existing features. |
| 56 | +Further information about the test framework and individual rpc |
| 57 | +tests is found in [qa/rpc-tests](/qa/rpc-tests). |
0 commit comments