Skip to content

Commit e1df922

Browse files
author
MarcoFalke
committed
Merge #17497: test: skip tests when utils haven't been compiled
a673521 test: skip tool_wallet test when bitcoin-wallet isn't compiled (fanquake) e9277ba test: skip wallet_listreceivedby test when the cli isn't compiled (fanquake) 621d398 test: skip bitcoin_cli test when the cli isn't compiled (fanquake) Pull request description: Don't try and run the `interface_bitcoin_cli.py` test when `bitcoin-cli` isn't available. ```bash stdout: 2019-11-17T01:51:41.623000Z TestFramework (INFO): Initializing test directory /var/folders/z2/cn877pxd3czdfh47mfkmbwgm0000gn/T/test_runner_₿_🏃_20191116_205141/interface_bitcoin_cli_0 2019-11-17T01:51:41.890000Z TestFramework (ERROR): Unexpected exception caught during testing Traceback (most recent call last): File "/Users/michael/github/bitcoin/test/functional/test_framework/test_framework.py", line 111, in main self.run_test() File "/Users/michael/github/bitcoin/test/functional/interface_bitcoin_cli.py", line 18, in run_test cli_response = self.nodes[0].cli("-version").send_cli() File "/Users/michael/github/bitcoin/test/functional/test_framework/test_node.py", line 528, in send_cli process = subprocess.Popen(p_args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) File "/Users/michael/.pyenv/versions/3.5.6/lib/python3.5/subprocess.py", line 676, in __init__ restore_signals, start_new_session) File "/Users/michael/.pyenv/versions/3.5.6/lib/python3.5/subprocess.py", line 1289, in _execute_child raise child_exception_type(errno_num, err_msg) FileNotFoundError: [Errno 2] No such file or directory: '/Users/michael/github/bitcoin/src/bitcoin-cli' ``` Top commit has no ACKs. Tree-SHA512: de27513a615d9d21271a0948e012c3209351e7374efd19bfa1bb9cda77e8fffe15d99e3424e4dbfa8cf826084f8af1670726f4703bd2b6093e7d37df4bea64f0
2 parents 92db280 + a673521 commit e1df922

File tree

5 files changed

+15
-0
lines changed

5 files changed

+15
-0
lines changed

test/config.ini.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ RPCAUTH=@abs_top_srcdir@/share/rpcauth/rpcauth.py
1616
# Which components are enabled. These are commented out by `configure` if they were disabled when running config.
1717
@ENABLE_WALLET_TRUE@ENABLE_WALLET=true
1818
@BUILD_BITCOIN_CLI_TRUE@ENABLE_CLI=true
19+
@BUILD_BITCOIN_WALLET_TRUE@ENABLE_WALLET_TOOL=true
1920
@BUILD_BITCOIND_TRUE@ENABLE_BITCOIND=true
2021
@ENABLE_FUZZ_TRUE@ENABLE_FUZZ=true
2122
@ENABLE_ZMQ_TRUE@ENABLE_ZMQ=true

test/functional/interface_bitcoin_cli.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ def set_test_params(self):
1212
self.setup_clean_chain = True
1313
self.num_nodes = 1
1414

15+
def skip_test_if_missing_module(self):
16+
self.skip_if_no_cli()
17+
1518
def run_test(self):
1619
"""Main test logic"""
1720

test/functional/test_framework/test_framework.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,11 @@ def skip_if_no_wallet(self):
596596
if not self.is_wallet_compiled():
597597
raise SkipTest("wallet has not been compiled.")
598598

599+
def skip_if_no_wallet_tool(self):
600+
"""Skip the running test if bitcoin-wallet has not been compiled."""
601+
if not self.is_wallet_tool_compiled():
602+
raise SkipTest("bitcoin-wallet has not been compiled")
603+
599604
def skip_if_no_cli(self):
600605
"""Skip the running test if bitcoin-cli has not been compiled."""
601606
if not self.is_cli_compiled():
@@ -609,6 +614,10 @@ def is_wallet_compiled(self):
609614
"""Checks whether the wallet module was compiled."""
610615
return self.config["components"].getboolean("ENABLE_WALLET")
611616

617+
def is_wallet_tool_compiled(self):
618+
"""Checks whether bitcoin-wallet was compiled."""
619+
return self.config["components"].getboolean("ENABLE_WALLET_TOOL")
620+
612621
def is_zmq_compiled(self):
613622
"""Checks whether the zmq module was compiled."""
614623
return self.config["components"].getboolean("ENABLE_ZMQ")

test/functional/tool_wallet.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ def set_test_params(self):
2323

2424
def skip_test_if_missing_module(self):
2525
self.skip_if_no_wallet()
26+
self.skip_if_no_wallet_tool()
2627

2728
def bitcoin_wallet_process(self, *args):
2829
binary = self.config["environment"]["BUILDDIR"] + '/src/bitcoin-wallet' + self.config["environment"]["EXEEXT"]

test/functional/wallet_listreceivedby.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ def set_test_params(self):
1919

2020
def skip_test_if_missing_module(self):
2121
self.skip_if_no_wallet()
22+
self.skip_if_no_cli()
2223

2324
def run_test(self):
2425
# Generate block to get out of IBD

0 commit comments

Comments
 (0)