Skip to content

Commit 8597260

Browse files
committed
Merge bitcoin/bitcoin#26480: test: Remove wallet option from non-wallet tests
fa10f19 test: Set default in add_wallet_options if only one type can be chosen (MacroFake) 555519d test: Remove wallet option from non-wallet tests (MacroFake) fac8d59 test: Set -disablewallet when no wallet has been compiled (MacroFake) fa68937 test: Make requires_wallet private (MacroFake) Pull request description: The tests have several issues: * Some tests that are wallet-type specific offer the option to run the test with the incompatible type For example, `wallet_dump.py` offers `--descriptors` and on current master fails with `JSONRPCException: Invalid public key`. After the changes here, it fails with a clear error: `unrecognized arguments: --descriptors`. * Tests that don't use the wallet at all offer the option to run it with a wallet type. This is confusing and wastes developers time if they are "tricked" into running the test for both wallet types, even though no wallet code is executed at all. For example, `feature_addrman.py` will happily accept and run with `--descriptors` or `--legacy-wallet`. After the changes here, it no longer silently ignores the flag, but reports a clear error: `unrecognized arguments`. ACKs for top commit: achow101: ACK fa10f19 Tree-SHA512: a5784da7305f4ec58c0013f433289000d94fc3d434b00fc329ffa37b812e2cd1da0071e34c3462bf79d904808564f2ae6d3d582f6b86b26215f9b07391b58460
2 parents 5488dc1 + fa10f19 commit 8597260

File tree

81 files changed

+259
-20
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+259
-20
lines changed

test/functional/example_test.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ class ExampleTest(BitcoinTestFramework):
7979
# Override the set_test_params(), skip_test_if_missing_module(), add_options(), setup_chain(), setup_network()
8080
# and setup_nodes() methods to customize the test setup as required.
8181

82+
def add_options(self, parser):
83+
self.add_wallet_options(parser)
84+
8285
def set_test_params(self):
8386
"""Override test parameters for your individual test.
8487

test/functional/feature_backwards_compatibility.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232

3333

3434
class BackwardsCompatibilityTest(BitcoinTestFramework):
35+
def add_options(self, parser):
36+
self.add_wallet_options(parser)
37+
3538
def set_test_params(self):
3639
self.setup_clean_chain = True
3740
self.num_nodes = 10

test/functional/feature_bip68_sequence.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@
4444
NOT_FINAL_ERROR = "non-BIP68-final"
4545

4646
class BIP68Test(BitcoinTestFramework):
47+
def add_options(self, parser):
48+
self.add_wallet_options(parser)
49+
4750
def set_test_params(self):
4851
self.num_nodes = 2
4952
self.extra_args = [

test/functional/feature_config_args.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212

1313

1414
class ConfArgsTest(BitcoinTestFramework):
15+
def add_options(self, parser):
16+
self.add_wallet_options(parser)
17+
1518
def set_test_params(self):
1619
self.setup_clean_chain = True
1720
self.num_nodes = 1

test/functional/feature_filelock.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
from test_framework.test_node import ErrorMatch
1212

1313
class FilelockTest(BitcoinTestFramework):
14+
def add_options(self, parser):
15+
self.add_wallet_options(parser)
16+
1417
def set_test_params(self):
1518
self.setup_clean_chain = True
1619
self.num_nodes = 2

test/functional/feature_init.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ class InitStressTest(BitcoinTestFramework):
1717
subsequent starts.
1818
"""
1919

20+
def add_options(self, parser):
21+
self.add_wallet_options(parser)
22+
2023
def set_test_params(self):
2124
self.setup_clean_chain = False
2225
self.num_nodes = 1

test/functional/feature_notifications.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ def notify_outputname(walletname, txid):
2424

2525

2626
class NotificationsTest(BitcoinTestFramework):
27+
def add_options(self, parser):
28+
self.add_wallet_options(parser)
29+
2730
def set_test_params(self):
2831
self.num_nodes = 2
2932
self.setup_clean_chain = True

test/functional/feature_pruning.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ def calc_usage(blockdir):
7676
return sum(os.path.getsize(blockdir + f) for f in os.listdir(blockdir) if os.path.isfile(os.path.join(blockdir, f))) / (1024. * 1024.)
7777

7878
class PruneTest(BitcoinTestFramework):
79+
def add_options(self, parser):
80+
self.add_wallet_options(parser)
81+
7982
def set_test_params(self):
8083
self.setup_clean_chain = True
8184
self.num_nodes = 6

test/functional/feature_rbf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121

2222
MAX_REPLACEMENT_LIMIT = 100
2323
class ReplaceByFeeTest(BitcoinTestFramework):
24+
def add_options(self, parser):
25+
self.add_wallet_options(parser)
26+
2427
def set_test_params(self):
2528
self.num_nodes = 2
2629
self.extra_args = [

test/functional/feature_segwit.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ def find_spendable_utxo(node, min_value):
7878

7979

8080
class SegWitTest(BitcoinTestFramework):
81+
def add_options(self, parser):
82+
self.add_wallet_options(parser)
83+
8184
def set_test_params(self):
8285
self.setup_clean_chain = True
8386
self.num_nodes = 3

0 commit comments

Comments
 (0)