From 586640381a2c379ce3d6366b1b4534ccc4e8ccf2 Mon Sep 17 00:00:00 2001 From: Andrew Chow Date: Thu, 29 Oct 2020 12:28:07 -0400 Subject: [PATCH] Skip --descriptor tests if sqlite is not compiled --- test/config.ini.in | 1 + test/functional/test_framework/test_framework.py | 11 +++++++++++ test/functional/test_runner.py | 4 ++-- test/functional/wallet_descriptor.py | 1 + test/functional/wallet_importdescriptors.py | 1 + 5 files changed, 16 insertions(+), 2 deletions(-) diff --git a/test/config.ini.in b/test/config.ini.in index be1bfe87523..4b4a092a9db 100644 --- a/test/config.ini.in +++ b/test/config.ini.in @@ -16,6 +16,7 @@ RPCAUTH=@abs_top_srcdir@/share/rpcauth/rpcauth.py [components] # Which components are enabled. These are commented out by `configure` if they were disabled when running config. @ENABLE_WALLET_TRUE@ENABLE_WALLET=true +@USE_SQLITE_TRUE@USE_SQLITE=true @BUILD_BITCOIN_CLI_TRUE@ENABLE_CLI=true @BUILD_BITCOIN_WALLET_TRUE@ENABLE_WALLET_TOOL=true @BUILD_BITCOIND_TRUE@ENABLE_BITCOIND=true diff --git a/test/functional/test_framework/test_framework.py b/test/functional/test_framework/test_framework.py index 872f612a4d4..d3e0737f21d 100755 --- a/test/functional/test_framework/test_framework.py +++ b/test/functional/test_framework/test_framework.py @@ -769,6 +769,13 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass): """Skip the running test if wallet has not been compiled.""" 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.""" + if not self.is_sqlite_compiled(): + raise SkipTest("sqlite has not been compiled.") def skip_if_no_wallet_tool(self): """Skip the running test if bitcoin-wallet has not been compiled.""" @@ -808,3 +815,7 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass): def is_zmq_compiled(self): """Checks whether the zmq module was compiled.""" return self.config["components"].getboolean("ENABLE_ZMQ") + + def is_sqlite_compiled(self): + """Checks whether the wallet module was compiled.""" + return self.config["components"].getboolean("USE_SQLITE") diff --git a/test/functional/test_runner.py b/test/functional/test_runner.py index 8cd82649b6b..b25fb240645 100755 --- a/test/functional/test_runner.py +++ b/test/functional/test_runner.py @@ -171,7 +171,7 @@ BASE_SCRIPTS = [ 'rpc_net.py', 'wallet_keypool.py', 'wallet_keypool.py --descriptors', - 'wallet_descriptor.py', + 'wallet_descriptor.py --descriptors', 'p2p_nobloomfilter_messages.py', 'p2p_filter.py', 'rpc_setban.py', @@ -208,7 +208,7 @@ BASE_SCRIPTS = [ 'mempool_expiry.py', 'wallet_import_rescan.py', 'wallet_import_with_label.py', - 'wallet_importdescriptors.py', + 'wallet_importdescriptors.py --descriptors', 'wallet_upgradewallet.py', 'rpc_bind.py --ipv4', 'rpc_bind.py --ipv6', diff --git a/test/functional/wallet_descriptor.py b/test/functional/wallet_descriptor.py index 51e9ec8f40e..92828095304 100755 --- a/test/functional/wallet_descriptor.py +++ b/test/functional/wallet_descriptor.py @@ -19,6 +19,7 @@ class WalletDescriptorTest(BitcoinTestFramework): def skip_test_if_missing_module(self): self.skip_if_no_wallet() + self.skip_if_no_sqlite() def run_test(self): wallet_info = self.nodes[0].getwalletinfo() diff --git a/test/functional/wallet_importdescriptors.py b/test/functional/wallet_importdescriptors.py index 2d982edef8d..743a9ac9ff9 100755 --- a/test/functional/wallet_importdescriptors.py +++ b/test/functional/wallet_importdescriptors.py @@ -37,6 +37,7 @@ class ImportDescriptorsTest(BitcoinTestFramework): 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"""