Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Check if zmq is installed in tests, update docs
If ZMQ is enabled, check whether it's installed before running ZMQ tests.
If it isn't, disable ZMQ and print a warning.

Also add dependency info to test docs, so users know ZMQ is required
before running tests, and so they know how to install it.

When following the build instructions before this change then trying
to run the RPC tests, a unix user would get an error when python
tried to import zmq.

There may be other dependencies that should be added to the docs,
particularly ones for non-unix systems. This is the only unlisted
dependency I encountered using linux.
  • Loading branch information
elliotolds committed Mar 10, 2016
1 parent 409f843 commit 2ab835a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -55,10 +55,10 @@ submit new unit tests for old code. Unit tests can be compiled and run

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

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

### Manual Quality Assurance (QA) Testing

Expand Down
11 changes: 11 additions & 0 deletions qa/README.md
Expand Up @@ -5,6 +5,17 @@ Every pull request to the bitcoin repository is built and run through
the regression test suite. You can also run all or only individual
tests locally.

Test dependencies
=================
Before running the tests, the following must be installed.

Unix
----
The python-zmq library is required. On Ubuntu or Debian it can be installed via:
```
sudo apt-get install python-zmq
```

Running tests
=============

Expand Down
9 changes: 9 additions & 0 deletions qa/pull-tester/rpc-tests.py
Expand Up @@ -40,6 +40,15 @@
ENABLE_UTILS=0
if not vars().has_key('ENABLE_ZMQ'):
ENABLE_ZMQ=0

# python-zmq may not be installed. Handle this gracefully and with some helpful info
if ENABLE_ZMQ:
try:
import zmq
except ImportError:
print("WARNING: \"import zmq\" failed. Setting ENABLE_ZMQ=0. " \
"To run zmq tests, see dependency info in /qa/README.md.")
ENABLE_ZMQ=0

ENABLE_COVERAGE=0

Expand Down

0 comments on commit 2ab835a

Please sign in to comment.