0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-08 10:31:50 -05:00

Merge #17675: tests: Enable tests which are incorrectly skipped when running test_runner.py --usecli

5ac804a9eb tests: Use a default of supports_cli=True (instead of supports_cli=False) (practicalswift)
993e38a4e2 tests: Mark functional tests not supporting bitcoin-cli (--usecli) as such (practicalswift)

Pull request description:

  Annotate functional tests supporting `bitcoin-cli` (`--usecli`) as such.

  Prior to this commit 74 tests were unnecessarily skipped when running `test_runner.py --usecli`.

  Before:

  ```
  $ test/functional/test_runner.py --usecli > /dev/null 2>&1
  $ echo $?
  0
  $ test/functional/test_runner.py --usecli 2>&1 | cut -f2 -d'|' | \
      grep -E ' (Passed|Skipped) *$' | sort | uniq -c
        9  ✓ Passed
      126  ○ Skipped
  ```

  After:

  ```
  $ test/functional/test_runner.py --usecli > /dev/null 2>&1
  $ echo $?
  0
  $ test/functional/test_runner.py --usecli 2>&1 | cut -f2 -d'|' | \
      grep -E ' (Passed|Skipped) *$' | sort | uniq -c
       83  ✓ Passed
       52  ○ Skipped
  ```

  Context: `--usecli` was introduced in f6ade9ce1a

ACKs for top commit:
  laanwj:
    Code review ACK 5ac804a9eb

Tree-SHA512: 249c0b691a74cf201c729df86c3db2b3faefa53b94703941e566943d252c6d14924e935a8da4f592951574235923fbb7cd22612a5e7e02ff6c762c55a2320ca3
This commit is contained in:
MarcoFalke 2019-12-09 13:52:38 -05:00
commit df2b743759
No known key found for this signature in database
GPG key ID: CE2B75697E69A548
55 changed files with 50 additions and 6 deletions

View file

@ -16,7 +16,6 @@ class CreateCache(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 0
self.supports_cli = True
def setup_network(self):
pass

View file

@ -13,6 +13,7 @@ class ConfArgsTest(BitcoinTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 1
self.supports_cli = False
def test_config_file_parser(self):
# Assume node is stopped

View file

@ -139,6 +139,7 @@ class BIP68_112_113Test(BitcoinTestFramework):
self.num_nodes = 1
self.setup_clean_chain = True
self.extra_args = [['-whitelist=127.0.0.1', '-blockversion=4', '-addresstype=legacy']]
self.supports_cli = False
def skip_test_if_missing_module(self):
self.skip_if_no_wallet()

View file

@ -51,6 +51,7 @@ class ChainstateWriteCrashTest(BitcoinTestFramework):
self.num_nodes = 4
self.setup_clean_chain = False
self.rpc_timeout = 480
self.supports_cli = False
# Set -maxmempool=0 to turn off mempool memory sharing with dbcache
# Set -rpcservertimeout=900 to reduce socket disconnects in this

View file

@ -26,6 +26,7 @@ class LoadblockTest(BitcoinTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 2
self.supports_cli = False
def run_test(self):
self.nodes[1].setnetworkactive(state=False)

View file

@ -36,6 +36,7 @@ class MaxUploadTest(BitcoinTestFramework):
self.setup_clean_chain = True
self.num_nodes = 1
self.extra_args = [["-maxuploadtarget=800", "-acceptnonstdtxn=1"]]
self.supports_cli = False
# Cache for utxos, as the listunspent may take a long time later in the test
self.utxo_cache = []

View file

@ -78,6 +78,7 @@ class PruneTest(BitcoinTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 6
self.supports_cli = False
# Create nodes 0 and 1 to mine.
# Create node 2 to test pruning.

View file

@ -76,6 +76,7 @@ class ReplaceByFeeTest(BitcoinTestFramework):
"-limitdescendantsize=101",
],
]
self.supports_cli = False
def skip_test_if_missing_module(self):
self.skip_if_no_wallet()

View file

@ -72,6 +72,7 @@ class SegWitTest(BitcoinTestFramework):
"-addresstype=legacy",
],
]
self.supports_cli = False
def skip_test_if_missing_module(self):
self.skip_if_no_wallet()

View file

@ -17,6 +17,7 @@ class ShutdownTest(BitcoinTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 1
self.supports_cli = False
def run_test(self):
node = get_rpc_proxy(self.nodes[0].url, 1, timeout=600, coveragedir=self.nodes[0].coverage_dir)

View file

@ -13,6 +13,7 @@ import urllib.parse
class HTTPBasicsTest (BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 3
self.supports_cli = False
def setup_network(self):
self.setup_nodes()

View file

@ -44,6 +44,7 @@ class RESTTest (BitcoinTestFramework):
self.setup_clean_chain = True
self.num_nodes = 2
self.extra_args = [["-rest"], []]
self.supports_cli = False
def skip_test_if_missing_module(self):
self.skip_if_no_wallet()

View file

@ -22,6 +22,7 @@ class RPCInterfaceTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 1
self.setup_clean_chain = True
self.supports_cli = False
def test_getrpcinfo(self):
self.log.info("Testing getrpcinfo...")

View file

@ -37,6 +37,7 @@ class MempoolAcceptanceTest(BitcoinTestFramework):
self.extra_args = [[
'-txindex',
]] * self.num_nodes
self.supports_cli = False
def skip_test_if_missing_module(self):
self.skip_if_no_wallet()

View file

@ -18,6 +18,7 @@ class MempoolLimitTest(BitcoinTestFramework):
"-maxmempool=5",
"-spendzeroconfchange=0",
]]
self.supports_cli = False
def skip_test_if_missing_module(self):
self.skip_if_no_wallet()

View file

@ -19,6 +19,7 @@ class MempoolPackagesTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 1
self.extra_args = [["-maxorphantx=1000"]]
self.supports_cli = False
def skip_test_if_missing_module(self):
self.skip_if_no_wallet()

View file

@ -27,6 +27,7 @@ class MempoolPackagesTest(BitcoinTestFramework):
["-maxorphantx=1000"],
["-maxorphantx=1000", "-limitancestorcount={}".format(MAX_ANCESTORS_CUSTOM)],
]
self.supports_cli = False
def skip_test_if_missing_module(self):
self.skip_if_no_wallet()

View file

@ -43,6 +43,7 @@ class MiningTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 2
self.setup_clean_chain = True
self.supports_cli = False
def mine_chain(self):
self.log.info('Create some old blocks')

View file

@ -27,6 +27,7 @@ class LongpollThread(threading.Thread):
class GetBlockTemplateLPTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 2
self.supports_cli = False
def skip_test_if_missing_module(self):
self.skip_if_no_wallet()

View file

@ -18,6 +18,7 @@ class PrioritiseTransactionTest(BitcoinTestFramework):
"-printpriority=1",
"-acceptnonstdtxn=1",
]] * self.num_nodes
self.supports_cli = False
def skip_test_if_missing_module(self):
self.skip_if_no_wallet()

View file

@ -16,6 +16,7 @@ from test_framework.util import (
class DisconnectBanTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 2
self.supports_cli = False
def run_test(self):
self.log.info("Connect nodes both way")

View file

@ -191,6 +191,7 @@ class SegWitTest(BitcoinTestFramework):
["-whitelist=127.0.0.1", "-acceptnonstdtxn=0", "-segwitheight={}".format(SEGWIT_HEIGHT)],
["-whitelist=127.0.0.1", "-acceptnonstdtxn=1", "-segwitheight=-1"]
]
self.supports_cli = False
def skip_test_if_missing_module(self):
self.skip_if_no_wallet()

View file

@ -15,6 +15,7 @@ class RPCBindTest(BitcoinTestFramework):
self.setup_clean_chain = True
self.bind_to_localhost_only = False
self.num_nodes = 1
self.supports_cli = False
def setup_network(self):
self.add_nodes(self.num_nodes, None)

View file

@ -49,6 +49,7 @@ class BlockchainTest(BitcoinTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 1
self.supports_cli = False
def run_test(self):
self.mine_chain()

View file

@ -22,6 +22,7 @@ class RpcCreateMultiSigTest(BitcoinTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 3
self.supports_cli = False
def skip_test_if_missing_module(self):
self.skip_if_no_wallet()

View file

@ -10,7 +10,6 @@ from test_framework.util import assert_equal, assert_raises_rpc_error
class DeriveaddressesTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 1
self.supports_cli = 1
def run_test(self):
assert_raises_rpc_error(-5, "Missing checksum", self.nodes[0].deriveaddresses, "a")

View file

@ -31,6 +31,7 @@ class RawTransactionsTest(BitcoinTestFramework):
# This test isn't testing tx relay. Set whitelist on the peers for
# instant tx relay.
self.extra_args = [['-whitelist=127.0.0.1']] * self.num_nodes
self.supports_cli = False
def skip_test_if_missing_module(self):
self.skip_if_no_wallet()

View file

@ -33,6 +33,7 @@ class GetblockstatsTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 1
self.setup_clean_chain = True
self.supports_cli = False
def get_stats(self):
return [self.nodes[0].getblockstats(hash_or_height=self.start_height + i) for i in range(self.max_stat_pos+1)]

View file

@ -13,6 +13,7 @@ import os
class HelpRpcTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 1
self.supports_cli = False
def run_test(self):
self.test_categories()

View file

@ -19,6 +19,7 @@ from test_framework.authproxy import JSONRPCException
class RpcMiscTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 1
self.supports_cli = False
def run_test(self):
node = self.nodes[0]

View file

@ -13,6 +13,7 @@ from test_framework.util import (
class NamedArgumentTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 1
self.supports_cli = False
def run_test(self):
node = self.nodes[0]

View file

@ -45,6 +45,7 @@ class NetTest(BitcoinTestFramework):
self.setup_clean_chain = True
self.num_nodes = 2
self.extra_args = [["-minrelaytxfee=0.00001000"],["-minrelaytxfee=0.00000500"]]
self.supports_cli = False
def run_test(self):
self.log.info('Connect nodes both way')

View file

@ -36,6 +36,7 @@ class PreciousTest(BitcoinTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 3
self.supports_cli = False
def setup_network(self):
self.setup_nodes()

View file

@ -32,6 +32,7 @@ class PSBTTest(BitcoinTestFramework):
["-walletrbf=0"],
[]
]
self.supports_cli = False
def skip_test_if_missing_module(self):
self.skip_if_no_wallet()

View file

@ -53,6 +53,7 @@ class RawTransactionsTest(BitcoinTestFramework):
["-txindex"],
["-txindex"],
]
self.supports_cli = False
def skip_test_if_missing_module(self):
self.skip_if_no_wallet()

View file

@ -15,6 +15,7 @@ class SignRawTransactionsTest(BitcoinTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 2
self.supports_cli = False
def skip_test_if_missing_module(self):
self.skip_if_no_wallet()

View file

@ -14,6 +14,7 @@ class MerkleBlockTest(BitcoinTestFramework):
self.setup_clean_chain = True
# Nodes 0/1 are "wallet" nodes, Nodes 2/3 are used for testing
self.extra_args = [[], [], [], ["-txindex"]]
self.supports_cli = False
def skip_test_if_missing_module(self):
self.skip_if_no_wallet()

View file

@ -35,6 +35,7 @@ def call_with_auth(node, user, password):
class HTTPBasicsTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 2
self.supports_cli = False
def setup_chain(self):
super().setup_chain()

View file

@ -97,7 +97,7 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
self.nodes = []
self.network_thread = None
self.rpc_timeout = 60 # Wait for up to 60 seconds for the RPC server to respond
self.supports_cli = False
self.supports_cli = True
self.bind_to_localhost_only = True
self.set_test_params()
self.parse_args()

View file

@ -26,6 +26,7 @@ class AbandonConflictTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 2
self.extra_args = [["-minrelaytxfee=0.00001"], []]
self.supports_cli = False
def skip_test_if_missing_module(self):
self.skip_if_no_wallet()

View file

@ -83,6 +83,7 @@ class AddressTypeTest(BitcoinTestFramework):
# whitelist all peers to speed up tx relay / mempool sync
for args in self.extra_args:
args.append("-whitelist=127.0.0.1")
self.supports_cli = False
def skip_test_if_missing_module(self):
self.skip_if_no_wallet()

View file

@ -54,6 +54,7 @@ class WalletTest(BitcoinTestFramework):
['-limitdescendantcount=3'], # Limit mempool descendants as a hack to have wallet txs rejected from the mempool
[],
]
self.supports_cli = False
def skip_test_if_missing_module(self):
self.skip_if_no_wallet()

View file

@ -28,6 +28,7 @@ class WalletTest(BitcoinTestFramework):
"-acceptnonstdtxn=1",
]] * self.num_nodes
self.setup_clean_chain = True
self.supports_cli = False
def skip_test_if_missing_module(self):
self.skip_if_no_wallet()

View file

@ -40,6 +40,7 @@ class BumpFeeTest(BitcoinTestFramework):
"-deprecatedrpc=totalFee",
"-addresstype=bech32",
] for i in range(self.num_nodes)]
self.supports_cli = False
def skip_test_if_missing_module(self):
self.skip_if_no_wallet()

View file

@ -16,6 +16,7 @@ class BumpFeeWithTotalFeeArgumentDeprecationTest(BitcoinTestFramework):
"-walletrbf={}".format(i),
"-mintxfee=0.00002",
] for i in range(self.num_nodes)]
self.supports_cli = False
def skip_test_if_missing_module(self):
self.skip_if_no_wallet()

View file

@ -15,7 +15,6 @@ class CreateWalletTest(BitcoinTestFramework):
def set_test_params(self):
self.setup_clean_chain = False
self.num_nodes = 1
self.supports_cli = True
def skip_test_if_missing_module(self):
self.skip_if_no_wallet()

View file

@ -20,6 +20,7 @@ class WalletHDTest(BitcoinTestFramework):
self.setup_clean_chain = True
self.num_nodes = 2
self.extra_args = [[], ['-keypool=0']]
self.supports_cli = False
def skip_test_if_missing_module(self):
self.skip_if_no_wallet()

View file

@ -41,6 +41,7 @@ def check_implicit_transactions(implicit_keys, implicit_node):
class ImplicitSegwitTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 2
self.supports_cli = False
def skip_test_if_missing_module(self):
self.skip_if_no_wallet()

View file

@ -145,6 +145,7 @@ def get_rand_amount():
class ImportRescanTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 2 + len(IMPORT_NODES)
self.supports_cli = False
def skip_test_if_missing_module(self):
self.skip_if_no_wallet()

View file

@ -19,6 +19,7 @@ class ListSinceBlockTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 4
self.setup_clean_chain = True
self.supports_cli = False
def skip_test_if_missing_module(self):
self.skip_if_no_wallet()

View file

@ -24,7 +24,6 @@ class MultiWalletTest(BitcoinTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 2
self.supports_cli = True
def skip_test_if_missing_module(self):
self.skip_if_no_wallet()

View file

@ -27,6 +27,7 @@ from test_framework.util import (
class ReorgsRestoreTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 3
self.supports_cli = False
def skip_test_if_missing_module(self):
self.skip_if_no_wallet()

View file

@ -16,6 +16,7 @@ from test_framework.messages import CTransaction, COIN
class TxnMallTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 4
self.supports_cli = False
def skip_test_if_missing_module(self):
self.skip_if_no_wallet()

View file

@ -16,6 +16,7 @@ from test_framework.util import (
class TxnMallTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 4
self.supports_cli = False
def skip_test_if_missing_module(self):
self.skip_if_no_wallet()

View file

@ -16,7 +16,6 @@ class CreateWalletWatchonlyTest(BitcoinTestFramework):
def set_test_params(self):
self.setup_clean_chain = False
self.num_nodes = 1
self.supports_cli = True
def skip_test_if_missing_module(self):
self.skip_if_no_wallet()