From 2ab835ae6c02de14264896d571c0bba230a1e9f0 Mon Sep 17 00:00:00 2001 From: Elliot Olds Date: Thu, 10 Mar 2016 03:12:40 -0800 Subject: 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. --- qa/pull-tester/rpc-tests.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'qa/pull-tester/rpc-tests.py') diff --git a/qa/pull-tester/rpc-tests.py b/qa/pull-tester/rpc-tests.py index 7649c1183b..485888e9b4 100755 --- a/qa/pull-tester/rpc-tests.py +++ b/qa/pull-tester/rpc-tests.py @@ -40,6 +40,15 @@ if not vars().has_key('ENABLE_UTILS'): 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 -- cgit v1.2.3