Skip to content

Commit

Permalink
tests: Automatically run both wallet types in parallel for wallet tests
Browse files Browse the repository at this point in the history
Most wallet tests need to be run with both wallet types. Instead of
requiring developers to manually specify this, the test_runner can find
the wallet tests that do not have a wallet type specified and
automatically run the test with both types.
  • Loading branch information
achow101 committed Aug 23, 2023
1 parent 6891bd3 commit 62b7f30
Showing 1 changed file with 51 additions and 77 deletions.
128 changes: 51 additions & 77 deletions test/functional/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,31 +108,27 @@
# vv Tests less than 60s vv
'rpc_psbt.py --legacy-wallet',
'rpc_psbt.py --descriptors',
'wallet_fundrawtransaction.py --legacy-wallet',
'wallet_fundrawtransaction.py --descriptors',
'wallet_bumpfee.py --legacy-wallet',
'wallet_bumpfee.py --descriptors',
'wallet_fundrawtransaction.py',
'wallet_bumpfee.py',
'wallet_import_rescan.py --legacy-wallet',
'wallet_backup.py --legacy-wallet',
'wallet_backup.py --descriptors',
'wallet_backup.py',
'feature_segwit.py --legacy-wallet',
'feature_segwit.py --descriptors',
'p2p_tx_download.py',
'wallet_avoidreuse.py --legacy-wallet',
'wallet_avoidreuse.py --descriptors',
'wallet_avoidreuse.py',
'feature_abortnode.py',
'wallet_address_types.py --legacy-wallet',
'wallet_address_types.py --descriptors',
'p2p_orphan_handling.py',
'wallet_basic.py --legacy-wallet',
'wallet_basic.py --descriptors',
'wallet_address_types.py',
'p2p_orphan_handling.py',
'wallet_basic.py',
'feature_maxtipage.py',
'wallet_multiwallet.py --legacy-wallet',
'wallet_multiwallet.py --descriptors',
'wallet_multiwallet.py',
'wallet_multiwallet.py --usecli',
'p2p_dns_seeds.py',
'wallet_groups.py --legacy-wallet',
'wallet_groups.py --descriptors',
'wallet_groups.py',
'p2p_blockfilters.py',
'feature_assumevalid.py',
'wallet_taproot.py --descriptors',
Expand All @@ -145,8 +141,7 @@
'p2p_feefilter.py',
'feature_csv_activation.py',
'p2p_sendheaders.py',
'wallet_listtransactions.py --legacy-wallet',
'wallet_listtransactions.py --descriptors',
'wallet_listtransactions.py',
# vv Tests less than 30s vv
'p2p_invalid_messages.py',
'rpc_createmultisig.py',
Expand All @@ -157,21 +152,15 @@
'wallet_importmulti.py --legacy-wallet',
'mempool_limit.py',
'rpc_txoutproof.py',
'wallet_listreceivedby.py --legacy-wallet',
'wallet_listreceivedby.py --descriptors',
'wallet_abandonconflict.py --legacy-wallet',
'wallet_abandonconflict.py --descriptors',
'wallet_listreceivedby.py',
'wallet_abandonconflict.py',
'feature_reindex.py',
'wallet_labels.py --legacy-wallet',
'wallet_labels.py --descriptors',
'wallet_labels.py',
'p2p_compactblocks.py',
'p2p_compactblocks_blocksonly.py',
'wallet_hd.py --legacy-wallet',
'wallet_hd.py --descriptors',
'wallet_blank.py --legacy-wallet',
'wallet_blank.py --descriptors',
'wallet_keypool_topup.py --legacy-wallet',
'wallet_keypool_topup.py --descriptors',
'wallet_hd.py',
'wallet_blank.py',
'wallet_keypool_topup.py',
'wallet_fast_rescan.py --descriptors',
'interface_zmq.py',
'rpc_invalid_address_message.py',
Expand All @@ -185,26 +174,21 @@
'tool_wallet.py --descriptors',
'tool_signet_miner.py --legacy-wallet',
'tool_signet_miner.py --descriptors',
'wallet_txn_clone.py --legacy-wallet',
'wallet_txn_clone.py --descriptors',
'wallet_txn_clone.py --segwit --legacy-wallet',
'wallet_txn_clone.py --segwit --descriptors',
'wallet_txn_clone.py',
'wallet_txn_clone.py --segwit',
'rpc_getchaintips.py',
'rpc_misc.py',
'interface_rest.py',
'mempool_spend_coinbase.py',
'wallet_avoid_mixing_output_types.py --descriptors',
'mempool_reorg.py',
'p2p_block_sync.py',
'wallet_createwallet.py --legacy-wallet',
'wallet_createwallet.py',
'wallet_createwallet.py --usecli',
'wallet_createwallet.py --descriptors',
'wallet_watchonly.py --legacy-wallet',
'wallet_watchonly.py --usecli --legacy-wallet',
'wallet_reorgsrestore.py --legacy-wallet',
'wallet_reorgsrestore.py --descriptors',
'wallet_conflicts.py --legacy-wallet',
'wallet_conflicts.py --descriptors',
'wallet_reorgsrestore.py',
'wallet_conflicts.py',
'interface_http.py',
'interface_rpc.py',
'interface_usdt_coinselection.py',
Expand All @@ -215,12 +199,10 @@
'rpc_users.py',
'rpc_whitelist.py',
'feature_proxy.py',
'wallet_signrawtransactionwithwallet.py --legacy-wallet',
'wallet_signrawtransactionwithwallet.py --descriptors',
'wallet_signrawtransactionwithwallet.py',
'rpc_signrawtransactionwithkey.py',
'rpc_rawtransaction.py --legacy-wallet',
'wallet_transactiontime_rescan.py --descriptors',
'wallet_transactiontime_rescan.py --legacy-wallet',
'wallet_transactiontime_rescan.py',
'p2p_addrv2_relay.py',
'p2p_compactblocks_hb.py',
'p2p_disconnect_ban.py',
Expand All @@ -236,8 +218,7 @@
'p2p_getdata.py',
'p2p_addrfetch.py',
'rpc_net.py',
'wallet_keypool.py --legacy-wallet',
'wallet_keypool.py --descriptors',
'wallet_keypool.py',
'wallet_descriptor.py --descriptors',
'wallet_miniscript.py --descriptors',
'p2p_nobloomfilter_messages.py',
Expand All @@ -249,13 +230,10 @@
'p2p_invalid_block.py',
'p2p_invalid_tx.py',
'example_test.py',
'wallet_txn_doublespend.py --legacy-wallet',
'wallet_txn_doublespend.py',
'wallet_multisig_descriptor_psbt.py --descriptors',
'wallet_txn_doublespend.py --descriptors',
'wallet_backwards_compatibility.py --legacy-wallet',
'wallet_backwards_compatibility.py --descriptors',
'wallet_txn_clone.py --mineblock --legacy-wallet',
'wallet_txn_clone.py --mineblock --descriptors',
'wallet_backwards_compatibility.py',
'wallet_txn_clone.py --mineblock',
'feature_notifications.py',
'rpc_getblockfilter.py',
'rpc_getblockfrompeer.py',
Expand All @@ -267,17 +245,14 @@
'mempool_package_limits.py',
'feature_versionbits_warning.py',
'rpc_preciousblock.py',
'wallet_importprunedfunds.py --legacy-wallet',
'wallet_importprunedfunds.py --descriptors',
'wallet_importprunedfunds.py',
'p2p_leak_tx.py',
'p2p_eviction.py',
'p2p_ibd_stalling.py',
'wallet_signmessagewithaddress.py --legacy-wallet',
'wallet_signmessagewithaddress.py --descriptors',
'wallet_signmessagewithaddress.py',
'rpc_signmessagewithprivkey.py',
'rpc_generate.py',
'wallet_balance.py --legacy-wallet',
'wallet_balance.py --descriptors',
'wallet_balance.py',
'p2p_initial_headers_sync.py',
'feature_nulldummy.py',
'mempool_accept.py',
Expand All @@ -291,39 +266,30 @@
'wallet_implicitsegwit.py --legacy-wallet',
'rpc_named_arguments.py',
'feature_startupnotify.py',
'wallet_simulaterawtx.py --legacy-wallet',
'wallet_simulaterawtx.py --descriptors',
'wallet_listsinceblock.py --legacy-wallet',
'wallet_listsinceblock.py --descriptors',
'wallet_simulaterawtx.py',
'wallet_listsinceblock.py',
'wallet_listdescriptors.py --descriptors',
'p2p_leak.py',
'wallet_encryption.py --legacy-wallet',
'wallet_encryption.py --descriptors',
'wallet_encryption.py',
'feature_dersig.py',
'feature_cltv.py',
'rpc_uptime.py',
'feature_discover.py',
'wallet_resendwallettransactions.py --legacy-wallet',
'wallet_resendwallettransactions.py --descriptors',
'wallet_fallbackfee.py --legacy-wallet',
'wallet_fallbackfee.py --descriptors',
'wallet_resendwallettransactions.py',
'wallet_fallbackfee.py',
'rpc_dumptxoutset.py',
'feature_minchainwork.py',
'rpc_estimatefee.py',
'rpc_getblockstats.py',
'feature_bind_port_externalip.py',
'wallet_create_tx.py --legacy-wallet',
'wallet_send.py --legacy-wallet',
'wallet_send.py --descriptors',
'wallet_sendall.py --legacy-wallet',
'wallet_sendall.py --descriptors',
'wallet_create_tx.py --descriptors',
'wallet_create_tx.py',
'wallet_send.py',
'wallet_sendall.py',
'wallet_inactive_hdchains.py --legacy-wallet',
'p2p_fingerprint.py',
'feature_uacomment.py',
'feature_init.py',
'wallet_coinbase_category.py --legacy-wallet',
'wallet_coinbase_category.py --descriptors',
'wallet_coinbase_category.py',
'feature_filelock.py',
'feature_loadblock.py',
'p2p_dos_header_tree.py',
Expand Down Expand Up @@ -353,14 +319,12 @@
'feature_anchors.py',
'mempool_datacarrier.py',
'feature_coinstatsindex.py',
'wallet_orphanedreward.py --descriptors',
'wallet_orphanedreward.py --legacy-wallet',
'wallet_orphanedreward.py',
'wallet_timelock.py',
'p2p_node_network_limited.py',
'p2p_permissions.py',
'feature_blocksdir.py',
'wallet_startup.py --legacy-wallet',
'wallet_startup.py --descriptors',
'wallet_startup.py',
'feature_remove_pruned_files_on_startup.py',
'p2p_i2p_ports.py',
'p2p_i2p_sessions.py',
Expand Down Expand Up @@ -483,6 +447,16 @@ def main():
# Run base tests only
test_list += BASE_SCRIPTS

# Run both --legacy-wallet and --descriptors for wallet tests unless one of those options was already provided
mod_test_list = []
for test in test_list:
if not test.startswith("wallet_") or "--legacy-wallet" in test or "--descriptors" in test or test == "wallet_disable.py":
mod_test_list.append(test)
continue
mod_test_list.append(test + " --legacy-wallet")
mod_test_list.append(test + " --descriptors")
test_list = mod_test_list

# Remove the test cases that the user has explicitly asked to exclude.
if args.exclude:
exclude_tests = [test.split('.py')[0] for test in args.exclude.split(',')]
Expand Down

0 comments on commit 62b7f30

Please sign in to comment.