Skip to content

Commit

Permalink
Merge bitcoin#20262: tests: Skip --descriptor tests if sqlite is not …
Browse files Browse the repository at this point in the history
…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:

  bitcoin#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
  • Loading branch information
meshcollider authored and knst committed Mar 6, 2024
1 parent 7d55046 commit a340ad6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions test/functional/test_framework/test_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -953,6 +953,8 @@ def skip_if_no_wallet(self):
self.requires_wallet = True
if not self.is_wallet_compiled():
raise SkipTest("wallet has not been compiled.")
if self.options.descriptors:
self.skip_if_no_sqlite()

def skip_if_no_sqlite(self):
"""Skip the running test if sqlite has not been compiled."""
Expand Down
4 changes: 2 additions & 2 deletions test/functional/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@
'wallet_keypool.py',
'wallet_keypool_hd.py',
'wallet_keypool_hd.py --descriptors',
'wallet_descriptor.py',
'wallet_descriptor.py --descriptors',
'p2p_nobloomfilter_messages.py',
'p2p_filter.py',
'p2p_blocksonly.py',
Expand Down Expand Up @@ -235,7 +235,7 @@
'wallet_import_rescan.py',
'wallet_import_with_label.py',
'wallet_upgradewallet.py',
'wallet_importdescriptors.py',
'wallet_importdescriptors.py --descriptors',
'wallet_mnemonicbits.py',
'rpc_bind.py --ipv4',
'rpc_bind.py --ipv6',
Expand Down
4 changes: 4 additions & 0 deletions test/functional/wallet_descriptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,14 @@ def set_test_params(self):

def skip_test_if_missing_module(self):
self.skip_if_no_wallet()
self.skip_if_no_sqlite()

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

# Make a descriptor wallet
self.log.info("Making a descriptor wallet")
Expand Down
1 change: 1 addition & 0 deletions test/functional/wallet_importdescriptors.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def set_test_params(self):

def skip_test_if_missing_module(self):
self.skip_if_no_wallet()
self.skip_if_no_sqlite()

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

0 comments on commit a340ad6

Please sign in to comment.