Skip to content

Commit 0c2eb7f

Browse files
committed
Merge #20262: tests: Skip --descriptor tests if sqlite is not compiled
7411876 Ensure a legacy wallet for BDB format check (Andrew Chow) 5866403 Skip --descriptor tests if sqlite is not compiled (Andrew Chow) Pull request description: #20156 allows sqlite to not be compiled by configuring `--without-sqlite`. However doing so and then running the test runner will result in all of the `--descriptor` tests to fail. We should be skipping those tests if sqlite was not compiled. ACKs for top commit: practicalswift: ACK 7411876: patch looks correct Sjors: tACK 7411876 ryanofsky: Code review ACK 7411876 hebasto: ACK 7411876, tested on Linux Mint 20 (x86_64), tests pass for binaries compiled with: Tree-SHA512: 1d635a66d2b7bb865300144dfefcfdaf86133aaaa020c8f440a471476ac1205d32f2df704906ce6c2ea48ddf791c3c95055f6291340b4f7b353c1b02cab5cabe
2 parents 5a6f3c5 + 7411876 commit 0c2eb7f

File tree

5 files changed

+20
-3
lines changed

5 files changed

+20
-3
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
[components]
1717
# Which components are enabled. These are commented out by `configure` if they were disabled when running config.
1818
@ENABLE_WALLET_TRUE@ENABLE_WALLET=true
19+
@USE_SQLITE_TRUE@USE_SQLITE=true
1920
@BUILD_BITCOIN_CLI_TRUE@ENABLE_CLI=true
2021
@BUILD_BITCOIN_WALLET_TRUE@ENABLE_WALLET_TOOL=true
2122
@BUILD_BITCOIND_TRUE@ENABLE_BITCOIND=true

test/functional/test_framework/test_framework.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,13 @@ def skip_if_no_wallet(self):
769769
"""Skip the running test if wallet has not been compiled."""
770770
if not self.is_wallet_compiled():
771771
raise SkipTest("wallet has not been compiled.")
772+
if self.options.descriptors:
773+
self.skip_if_no_sqlite()
774+
775+
def skip_if_no_sqlite(self):
776+
"""Skip the running test if sqlite has not been compiled."""
777+
if not self.is_sqlite_compiled():
778+
raise SkipTest("sqlite has not been compiled.")
772779

773780
def skip_if_no_wallet_tool(self):
774781
"""Skip the running test if bitcoin-wallet has not been compiled."""
@@ -808,3 +815,7 @@ def is_wallet_tool_compiled(self):
808815
def is_zmq_compiled(self):
809816
"""Checks whether the zmq module was compiled."""
810817
return self.config["components"].getboolean("ENABLE_ZMQ")
818+
819+
def is_sqlite_compiled(self):
820+
"""Checks whether the wallet module was compiled."""
821+
return self.config["components"].getboolean("USE_SQLITE")

test/functional/test_runner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@
171171
'rpc_net.py',
172172
'wallet_keypool.py',
173173
'wallet_keypool.py --descriptors',
174-
'wallet_descriptor.py',
174+
'wallet_descriptor.py --descriptors',
175175
'p2p_nobloomfilter_messages.py',
176176
'p2p_filter.py',
177177
'rpc_setban.py',
@@ -208,7 +208,7 @@
208208
'mempool_expiry.py',
209209
'wallet_import_rescan.py',
210210
'wallet_import_with_label.py',
211-
'wallet_importdescriptors.py',
211+
'wallet_importdescriptors.py --descriptors',
212212
'wallet_upgradewallet.py',
213213
'rpc_bind.py --ipv4',
214214
'rpc_bind.py --ipv6',

test/functional/wallet_descriptor.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,22 @@ def set_test_params(self):
1616
self.setup_clean_chain = True
1717
self.num_nodes = 1
1818
self.extra_args = [['-keypool=100']]
19+
self.wallet_names = []
1920

2021
def skip_test_if_missing_module(self):
2122
self.skip_if_no_wallet()
23+
self.skip_if_no_sqlite()
2224

2325
def run_test(self):
26+
# Make a legacy wallet and check it is BDB
27+
self.nodes[0].createwallet(wallet_name="legacy1", descriptors=False)
2428
wallet_info = self.nodes[0].getwalletinfo()
2529
assert_equal(wallet_info['format'], 'bdb')
30+
self.nodes[0].unloadwallet("legacy1")
2631

2732
# Make a descriptor wallet
2833
self.log.info("Making a descriptor wallet")
2934
self.nodes[0].createwallet(wallet_name="desc1", descriptors=True)
30-
self.nodes[0].unloadwallet(self.default_wallet_name)
3135

3236
# A descriptor wallet should have 100 addresses * 3 types = 300 keys
3337
self.log.info("Checking wallet info")

test/functional/wallet_importdescriptors.py

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

3838
def skip_test_if_missing_module(self):
3939
self.skip_if_no_wallet()
40+
self.skip_if_no_sqlite()
4041

4142
def test_importdesc(self, req, success, error_code=None, error_message=None, warnings=None, wallet=None):
4243
"""Run importdescriptors and assert success"""

0 commit comments

Comments
 (0)