Browse Source

Merge #11774: [tests] Rename functional tests

6f881cc880 [tests] Remove EXPECTED_VIOLATION_COUNT (Anthony Towns)
3150b3fea7 [tests] Rename misc functional tests. (Anthony Towns)
81b79f2c39 [tests] Rename rpc_* functional tests. (Anthony Towns)
61b8f7f273 [tests] Rename p2p_* functional tests. (Anthony Towns)
90600bc7db [tests] Rename wallet_* functional tests. (Anthony Towns)
ca6523d0c8 [tests] Rename feature_* functional tests. (Anthony Towns)

Pull request description:

  This PR changes the functional tests to have a consistent naming scheme:

      tests for individual RPC methods are named rpc_...
      tests for interfaces (REST, ZMQ, RPC features) are named interface_...
      tests that explicitly test the p2p interface are named p2p_...
      tests for wallet features are named wallet_...
      tests for mining features are named mining_...
      tests for mempool behaviour are named mempool_...
      tests for full features that aren't wallet/mining/mempool are named feature_...

  Rationale: it's sometimes difficult for new contributors to know what's already covered by existing tests and where new tests should be added. Naming in a consistent fashion makes it easier to see what's already covered at a glance.

Tree-SHA512: 4246790552d42bbd95f6d5bdf67702b81b3b2c583ce7eaf1fe6d8e254721279b47315973c6e9ae82dad6e4c747f12188160764bf2624c0f8f3b4d39330ec8b16
0.16
MarcoFalke 7 years ago
parent
commit
6970b30c6f
No known key found for this signature in database
GPG Key ID: D2EA4850E7528B25
  1. 4
      test/functional/README.md
  2. 0
      test/functional/feature_assumevalid.py
  3. 0
      test/functional/feature_bip68_sequence.py
  4. 0
      test/functional/feature_bip9_softforks.py
  5. 0
      test/functional/feature_block.py
  6. 0
      test/functional/feature_cltv.py
  7. 0
      test/functional/feature_config_args.py
  8. 0
      test/functional/feature_csv_activation.py
  9. 0
      test/functional/feature_dbcrash.py
  10. 0
      test/functional/feature_dersig.py
  11. 0
      test/functional/feature_fee_estimation.py
  12. 0
      test/functional/feature_maxuploadtarget.py
  13. 0
      test/functional/feature_minchainwork.py
  14. 0
      test/functional/feature_notifications.py
  15. 0
      test/functional/feature_nulldummy.py
  16. 0
      test/functional/feature_proxy.py
  17. 0
      test/functional/feature_pruning.py
  18. 0
      test/functional/feature_rbf.py
  19. 0
      test/functional/feature_reindex.py
  20. 0
      test/functional/feature_segwit.py
  21. 0
      test/functional/feature_uacomment.py
  22. 0
      test/functional/feature_versionbits_warning.py
  23. 0
      test/functional/interface_bitcoin_cli.py
  24. 0
      test/functional/interface_http.py
  25. 0
      test/functional/interface_rest.py
  26. 0
      test/functional/interface_zmq.py
  27. 0
      test/functional/mempool_resurrect.py
  28. 0
      test/functional/mempool_spend_coinbase.py
  29. 0
      test/functional/mining_basic.py
  30. 0
      test/functional/mining_getblocktemplate_longpoll.py
  31. 0
      test/functional/mining_prioritisetransaction.py
  32. 0
      test/functional/p2p_compactblocks.py
  33. 0
      test/functional/p2p_disconnect_ban.py
  34. 0
      test/functional/p2p_feefilter.py
  35. 0
      test/functional/p2p_fingerprint.py
  36. 0
      test/functional/p2p_invalid_block.py
  37. 0
      test/functional/p2p_invalid_tx.py
  38. 0
      test/functional/p2p_leak.py
  39. 0
      test/functional/p2p_mempool.py
  40. 0
      test/functional/p2p_node_network_limited.py
  41. 0
      test/functional/p2p_segwit.py
  42. 0
      test/functional/p2p_sendheaders.py
  43. 0
      test/functional/p2p_timeouts.py
  44. 0
      test/functional/p2p_unrequested_blocks.py
  45. 0
      test/functional/rpc_bind.py
  46. 0
      test/functional/rpc_blockchain.py
  47. 0
      test/functional/rpc_decodescript.py
  48. 0
      test/functional/rpc_deprecated.py
  49. 0
      test/functional/rpc_fundrawtransaction.py
  50. 0
      test/functional/rpc_getchaintips.py
  51. 0
      test/functional/rpc_invalidateblock.py
  52. 0
      test/functional/rpc_listtransactions.py
  53. 0
      test/functional/rpc_named_arguments.py
  54. 0
      test/functional/rpc_net.py
  55. 0
      test/functional/rpc_preciousblock.py
  56. 0
      test/functional/rpc_rawtransaction.py
  57. 0
      test/functional/rpc_signmessage.py
  58. 0
      test/functional/rpc_signrawtransaction.py
  59. 0
      test/functional/rpc_txoutproof.py
  60. 0
      test/functional/rpc_uptime.py
  61. 0
      test/functional/rpc_users.py
  62. 184
      test/functional/test_runner.py
  63. 0
      test/functional/wallet_abandonconflict.py
  64. 0
      test/functional/wallet_accounts.py
  65. 0
      test/functional/wallet_address_types.py
  66. 0
      test/functional/wallet_backup.py
  67. 0
      test/functional/wallet_basic.py
  68. 0
      test/functional/wallet_bumpfee.py
  69. 0
      test/functional/wallet_disable.py
  70. 0
      test/functional/wallet_dump.py
  71. 0
      test/functional/wallet_encryption.py
  72. 0
      test/functional/wallet_hd.py
  73. 0
      test/functional/wallet_import_rescan.py
  74. 0
      test/functional/wallet_importmulti.py
  75. 0
      test/functional/wallet_importprunedfunds.py
  76. 0
      test/functional/wallet_keypool.py
  77. 0
      test/functional/wallet_keypool_topup.py
  78. 0
      test/functional/wallet_listreceivedby.py
  79. 0
      test/functional/wallet_listsinceblock.py
  80. 0
      test/functional/wallet_multiwallet.py
  81. 0
      test/functional/wallet_resendwallettransactions.py
  82. 0
      test/functional/wallet_txn_clone.py
  83. 0
      test/functional/wallet_txn_doublespend.py
  84. 0
      test/functional/wallet_zapwallettxes.py

4
test/functional/README.md

@ -87,7 +87,7 @@ start the networking thread. (Continue with the test logic in your existing @@ -87,7 +87,7 @@ start the networking thread. (Continue with the test logic in your existing
thread.)
- Can be used to write tests where specific P2P protocol behavior is tested.
Examples tests are `p2p-acceptblock.py`, `p2p-compactblocks.py`.
Examples tests are `p2p_unrequested_blocks.py`, `p2p_compactblocks.py`.
#### Comptool
@ -133,7 +133,7 @@ Each `TestInstance` consists of: @@ -133,7 +133,7 @@ Each `TestInstance` consists of:
acceptance is tested against the given outcome.
- For examples of tests written in this framework, see
`invalidblockrequest.py` and `p2p-fullblocktest.py`.
`p2p_invalid_block.py` and `feature_block.py`.
### test-framework modules

0
test/functional/assumevalid.py → test/functional/feature_assumevalid.py

0
test/functional/bip68-sequence.py → test/functional/feature_bip68_sequence.py

0
test/functional/bip9-softforks.py → test/functional/feature_bip9_softforks.py

0
test/functional/p2p-fullblocktest.py → test/functional/feature_block.py

0
test/functional/bip65-cltv-p2p.py → test/functional/feature_cltv.py

0
test/functional/conf_args.py → test/functional/feature_config_args.py

0
test/functional/bip68-112-113-p2p.py → test/functional/feature_csv_activation.py

0
test/functional/dbcrash.py → test/functional/feature_dbcrash.py

0
test/functional/bipdersig-p2p.py → test/functional/feature_dersig.py

0
test/functional/smartfees.py → test/functional/feature_fee_estimation.py

0
test/functional/maxuploadtarget.py → test/functional/feature_maxuploadtarget.py

0
test/functional/minchainwork.py → test/functional/feature_minchainwork.py

0
test/functional/notifications.py → test/functional/feature_notifications.py

0
test/functional/nulldummy.py → test/functional/feature_nulldummy.py

0
test/functional/proxy_test.py → test/functional/feature_proxy.py

0
test/functional/pruning.py → test/functional/feature_pruning.py

0
test/functional/replace-by-fee.py → test/functional/feature_rbf.py

0
test/functional/reindex.py → test/functional/feature_reindex.py

0
test/functional/segwit.py → test/functional/feature_segwit.py

0
test/functional/uacomment.py → test/functional/feature_uacomment.py

0
test/functional/p2p-versionbits-warning.py → test/functional/feature_versionbits_warning.py

0
test/functional/bitcoin_cli.py → test/functional/interface_bitcoin_cli.py

0
test/functional/httpbasics.py → test/functional/interface_http.py

0
test/functional/rest.py → test/functional/interface_rest.py

0
test/functional/zmq_test.py → test/functional/interface_zmq.py

0
test/functional/mempool_resurrect_test.py → test/functional/mempool_resurrect.py

0
test/functional/mempool_spendcoinbase.py → test/functional/mempool_spend_coinbase.py

0
test/functional/mining.py → test/functional/mining_basic.py

0
test/functional/getblocktemplate_longpoll.py → test/functional/mining_getblocktemplate_longpoll.py

0
test/functional/prioritise_transaction.py → test/functional/mining_prioritisetransaction.py

0
test/functional/p2p-compactblocks.py → test/functional/p2p_compactblocks.py

0
test/functional/disconnect_ban.py → test/functional/p2p_disconnect_ban.py

0
test/functional/p2p-feefilter.py → test/functional/p2p_feefilter.py

0
test/functional/p2p-fingerprint.py → test/functional/p2p_fingerprint.py

0
test/functional/invalidblockrequest.py → test/functional/p2p_invalid_block.py

0
test/functional/invalidtxrequest.py → test/functional/p2p_invalid_tx.py

0
test/functional/p2p-leaktests.py → test/functional/p2p_leak.py

0
test/functional/p2p-mempool.py → test/functional/p2p_mempool.py

0
test/functional/node_network_limited.py → test/functional/p2p_node_network_limited.py

0
test/functional/p2p-segwit.py → test/functional/p2p_segwit.py

0
test/functional/sendheaders.py → test/functional/p2p_sendheaders.py

0
test/functional/p2p-timeouts.py → test/functional/p2p_timeouts.py

0
test/functional/p2p-acceptblock.py → test/functional/p2p_unrequested_blocks.py

0
test/functional/rpcbind_test.py → test/functional/rpc_bind.py

0
test/functional/blockchain.py → test/functional/rpc_blockchain.py

0
test/functional/decodescript.py → test/functional/rpc_decodescript.py

0
test/functional/deprecated_rpc.py → test/functional/rpc_deprecated.py

0
test/functional/fundrawtransaction.py → test/functional/rpc_fundrawtransaction.py

0
test/functional/getchaintips.py → test/functional/rpc_getchaintips.py

0
test/functional/invalidateblock.py → test/functional/rpc_invalidateblock.py

0
test/functional/listtransactions.py → test/functional/rpc_listtransactions.py

0
test/functional/rpcnamedargs.py → test/functional/rpc_named_arguments.py

0
test/functional/net.py → test/functional/rpc_net.py

0
test/functional/preciousblock.py → test/functional/rpc_preciousblock.py

0
test/functional/rawtransactions.py → test/functional/rpc_rawtransaction.py

0
test/functional/signmessages.py → test/functional/rpc_signmessage.py

0
test/functional/signrawtransactions.py → test/functional/rpc_signrawtransaction.py

0
test/functional/merkle_blocks.py → test/functional/rpc_txoutproof.py

0
test/functional/uptime.py → test/functional/rpc_uptime.py

0
test/functional/multi_rpc.py → test/functional/rpc_users.py

184
test/functional/test_runner.py

@ -55,84 +55,84 @@ TEST_EXIT_SKIPPED = 77 @@ -55,84 +55,84 @@ TEST_EXIT_SKIPPED = 77
BASE_SCRIPTS= [
# Scripts that are run by the travis build process.
# Longest test should go first, to favor running tests in parallel
'wallet-hd.py',
'walletbackup.py',
'wallet_hd.py',
'wallet_backup.py',
# vv Tests less than 5m vv
'p2p-fullblocktest.py',
'fundrawtransaction.py',
'p2p-compactblocks.py',
'segwit.py',
'feature_block.py',
'rpc_fundrawtransaction.py',
'p2p_compactblocks.py',
'feature_segwit.py',
# vv Tests less than 2m vv
'wallet.py',
'wallet-accounts.py',
'p2p-segwit.py',
'wallet-dump.py',
'listtransactions.py',
'wallet_basic.py',
'wallet_accounts.py',
'p2p_segwit.py',
'wallet_dump.py',
'rpc_listtransactions.py',
# vv Tests less than 60s vv
'sendheaders.py',
'zapwallettxes.py',
'importmulti.py',
'p2p_sendheaders.py',
'wallet_zapwallettxes.py',
'wallet_importmulti.py',
'mempool_limit.py',
'merkle_blocks.py',
'receivedby.py',
'abandonconflict.py',
'bip68-112-113-p2p.py',
'rawtransactions.py',
'address_types.py',
'reindex.py',
'rpc_txoutproof.py',
'wallet_listreceivedby.py',
'wallet_abandonconflict.py',
'feature_csv_activation.py',
'rpc_rawtransaction.py',
'wallet_address_types.py',
'feature_reindex.py',
# vv Tests less than 30s vv
'keypool-topup.py',
'zmq_test.py',
'bitcoin_cli.py',
'mempool_resurrect_test.py',
'txn_doublespend.py --mineblock',
'txn_clone.py',
'txn_clone.py --segwit',
'getchaintips.py',
'rest.py',
'mempool_spendcoinbase.py',
'wallet_keypool_topup.py',
'interface_zmq.py',
'interface_bitcoin_cli.py',
'mempool_resurrect.py',
'wallet_txn_doublespend.py --mineblock',
'wallet_txn_clone.py',
'wallet_txn_clone.py --segwit',
'rpc_getchaintips.py',
'interface_rest.py',
'mempool_spend_coinbase.py',
'mempool_reorg.py',
'mempool_persist.py',
'multiwallet.py',
'multiwallet.py --usecli',
'httpbasics.py',
'multi_rpc.py',
'proxy_test.py',
'signrawtransactions.py',
'disconnect_ban.py',
'decodescript.py',
'blockchain.py',
'deprecated_rpc.py',
'disablewallet.py',
'net.py',
'keypool.py',
'p2p-mempool.py',
'prioritise_transaction.py',
'invalidblockrequest.py',
'invalidtxrequest.py',
'p2p-versionbits-warning.py',
'preciousblock.py',
'importprunedfunds.py',
'signmessages.py',
'nulldummy.py',
'import-rescan.py',
'mining.py',
'bumpfee.py',
'rpcnamedargs.py',
'listsinceblock.py',
'p2p-leaktests.py',
'wallet-encryption.py',
'bipdersig-p2p.py',
'bip65-cltv-p2p.py',
'uptime.py',
'resendwallettransactions.py',
'minchainwork.py',
'p2p-fingerprint.py',
'uacomment.py',
'p2p-acceptblock.py',
'wallet_multiwallet.py',
'wallet_multiwallet.py --usecli',
'interface_http.py',
'rpc_users.py',
'feature_proxy.py',
'rpc_signrawtransaction.py',
'p2p_disconnect_ban.py',
'rpc_decodescript.py',
'rpc_blockchain.py',
'rpc_deprecated.py',
'wallet_disable.py',
'rpc_net.py',
'wallet_keypool.py',
'p2p_mempool.py',
'mining_prioritisetransaction.py',
'p2p_invalid_block.py',
'p2p_invalid_tx.py',
'feature_versionbits_warning.py',
'rpc_preciousblock.py',
'wallet_importprunedfunds.py',
'rpc_signmessage.py',
'feature_nulldummy.py',
'wallet_import_rescan.py',
'mining_basic.py',
'wallet_bumpfee.py',
'rpc_named_arguments.py',
'wallet_listsinceblock.py',
'p2p_leak.py',
'wallet_encryption.py',
'feature_dersig.py',
'feature_cltv.py',
'rpc_uptime.py',
'wallet_resendwallettransactions.py',
'feature_minchainwork.py',
'p2p_fingerprint.py',
'feature_uacomment.py',
'p2p_unrequested_blocks.py',
'feature_logging.py',
'node_network_limited.py',
'conf_args.py',
'p2p_node_network_limited.py',
'feature_config_args.py',
# Don't append tests at the end to avoid merge conflicts
# Put them in a random line within the section that fits their approximate run-time
]
@ -140,29 +140,29 @@ BASE_SCRIPTS= [ @@ -140,29 +140,29 @@ BASE_SCRIPTS= [
EXTENDED_SCRIPTS = [
# These tests are not run by the travis build process.
# Longest test should go first, to favor running tests in parallel
'pruning.py',
'feature_pruning.py',
# vv Tests less than 20m vv
'smartfees.py',
'feature_fee_estimation.py',
# vv Tests less than 5m vv
'maxuploadtarget.py',
'feature_maxuploadtarget.py',
'mempool_packages.py',
'dbcrash.py',
'feature_dbcrash.py',
# vv Tests less than 2m vv
'bip68-sequence.py',
'getblocktemplate_longpoll.py',
'p2p-timeouts.py',
'feature_bip68_sequence.py',
'mining_getblocktemplate_longpoll.py',
'p2p_timeouts.py',
# vv Tests less than 60s vv
'bip9-softforks.py',
'p2p-feefilter.py',
'rpcbind_test.py',
'feature_bip9_softforks.py',
'p2p_feefilter.py',
'rpc_bind.py',
# vv Tests less than 30s vv
'assumevalid.py',
'feature_assumevalid.py',
'example_test.py',
'txn_doublespend.py',
'txn_clone.py --mineblock',
'notifications.py',
'invalidateblock.py',
'replace-by-fee.py',
'wallet_txn_doublespend.py',
'wallet_txn_clone.py --mineblock',
'feature_notifications.py',
'rpc_invalidateblock.py',
'feature_rbf.py',
]
# Place EXTENDED_SCRIPTS first since it has the 3 longest running tests
@ -472,9 +472,8 @@ class TestResult(): @@ -472,9 +472,8 @@ class TestResult():
def check_script_prefixes():
"""Check that no more than `EXPECTED_VIOLATION_COUNT` of the
"""Check that at most a handful of the
test scripts don't start with one of the allowed name prefixes."""
EXPECTED_VIOLATION_COUNT = 77
# LEEWAY is provided as a transition measure, so that pull-requests
# that introduce new tests that don't conform with the naming
@ -484,13 +483,10 @@ def check_script_prefixes(): @@ -484,13 +483,10 @@ def check_script_prefixes():
good_prefixes_re = re.compile("(example|feature|interface|mempool|mining|p2p|rpc|wallet)_")
bad_script_names = [script for script in ALL_SCRIPTS if good_prefixes_re.match(script) is None]
if len(bad_script_names) < EXPECTED_VIOLATION_COUNT:
print("{}HURRAY!{} Number of functional tests violating naming convention reduced!".format(BOLD[1], BOLD[0]))
print("Consider reducing EXPECTED_VIOLATION_COUNT from %d to %d" % (EXPECTED_VIOLATION_COUNT, len(bad_script_names)))
elif len(bad_script_names) > EXPECTED_VIOLATION_COUNT:
print("INFO: %d tests not meeting naming conventions (expected %d):" % (len(bad_script_names), EXPECTED_VIOLATION_COUNT))
if len(bad_script_names) > 0:
print("INFO: %d tests not meeting naming conventions:" % (len(bad_script_names)))
print(" %s" % ("\n ".join(sorted(bad_script_names))))
assert len(bad_script_names) <= EXPECTED_VIOLATION_COUNT + LEEWAY, "Too many tests not following naming convention! (%d found, expected: <= %d)" % (len(bad_script_names), EXPECTED_VIOLATION_COUNT)
assert len(bad_script_names) <= LEEWAY, "Too many tests not following naming convention! (%d found, maximum: %d)" % (len(bad_script_names), LEEWAY)
def check_script_list(src_dir):

0
test/functional/abandonconflict.py → test/functional/wallet_abandonconflict.py

0
test/functional/wallet-accounts.py → test/functional/wallet_accounts.py

0
test/functional/address_types.py → test/functional/wallet_address_types.py

0
test/functional/walletbackup.py → test/functional/wallet_backup.py

0
test/functional/wallet.py → test/functional/wallet_basic.py

0
test/functional/bumpfee.py → test/functional/wallet_bumpfee.py

0
test/functional/disablewallet.py → test/functional/wallet_disable.py

0
test/functional/wallet-dump.py → test/functional/wallet_dump.py

0
test/functional/wallet-encryption.py → test/functional/wallet_encryption.py

0
test/functional/wallet-hd.py → test/functional/wallet_hd.py

0
test/functional/import-rescan.py → test/functional/wallet_import_rescan.py

0
test/functional/importmulti.py → test/functional/wallet_importmulti.py

0
test/functional/importprunedfunds.py → test/functional/wallet_importprunedfunds.py

0
test/functional/keypool.py → test/functional/wallet_keypool.py

0
test/functional/keypool-topup.py → test/functional/wallet_keypool_topup.py

0
test/functional/receivedby.py → test/functional/wallet_listreceivedby.py

0
test/functional/listsinceblock.py → test/functional/wallet_listsinceblock.py

0
test/functional/multiwallet.py → test/functional/wallet_multiwallet.py

0
test/functional/resendwallettransactions.py → test/functional/wallet_resendwallettransactions.py

0
test/functional/txn_clone.py → test/functional/wallet_txn_clone.py

0
test/functional/txn_doublespend.py → test/functional/wallet_txn_doublespend.py

0
test/functional/zapwallettxes.py → test/functional/wallet_zapwallettxes.py

Loading…
Cancel
Save