Skip to content

Commit dcd28c8

Browse files
test: fix RPC coverage check
1 parent 415f2b4 commit dcd28c8

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

test/functional/create_cache.py

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
class CreateCache(BitcoinTestFramework):
1515
# Test network and test nodes are not required:
1616

17+
def add_options(self, parser):
18+
self.add_wallet_options(parser)
19+
1720
def set_test_params(self):
1821
self.num_nodes = 0
1922

test/functional/test_framework/test_framework.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,7 @@ def _initialize_chain(self):
829829
cache_node_dir,
830830
chain=self.chain,
831831
extra_conf=["bind=127.0.0.1"],
832-
extra_args=['-disablewallet'],
832+
extra_args=[],
833833
rpchost=None,
834834
timewait=self.rpc_timeout,
835835
timeout_factor=self.options.timeout_factor,

test/functional/test_runner.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,7 @@ def main():
424424
parser.add_argument('--tmpdirprefix', '-t', default=tempfile.gettempdir(), help="Root directory for datadirs")
425425
parser.add_argument('--failfast', '-F', action='store_true', help='stop execution after the first test failure')
426426
parser.add_argument('--filter', help='filter scripts to run by regular expression')
427+
parser.add_argument("--legacy-wallet", action='store_const', const=False, help="Run test using legacy wallets", dest='legacy_wallet')
427428

428429

429430
args, unknown_args = parser.parse_known_args()
@@ -535,9 +536,10 @@ def main():
535536
combined_logs_len=args.combinedlogslen,
536537
failfast=args.failfast,
537538
use_term_control=args.ansi,
539+
legacy=args.legacy_wallet,
538540
)
539541

540-
def run_tests(*, test_list, src_dir, build_dir, tmpdir, jobs=1, enable_coverage=False, args=None, combined_logs_len=0, failfast=False, use_term_control):
542+
def run_tests(*, test_list, src_dir, build_dir, tmpdir, jobs=1, enable_coverage=False, args=None, combined_logs_len=0, failfast=False, use_term_control, legacy=False):
541543
args = args or []
542544

543545
# Warn if bitcoind is already running
@@ -572,7 +574,10 @@ def run_tests(*, test_list, src_dir, build_dir, tmpdir, jobs=1, enable_coverage=
572574
if len(test_list) > 1 and jobs > 1:
573575
# Populate cache
574576
try:
575-
subprocess.check_output([sys.executable, tests_dir + 'create_cache.py'] + flags + ["--tmpdir=%s/cache" % tmpdir])
577+
# Disable '--descriptors' flag on create_cache if '--legacy-wallet' flag is provided
578+
wallet_flag = '--legacy-wallet' if legacy else '--descriptors'
579+
580+
subprocess.check_output([sys.executable, tests_dir + 'create_cache.py'] + flags + [f"--tmpdir={tmpdir}/cache", wallet_flag])
576581
except subprocess.CalledProcessError as e:
577582
sys.stdout.buffer.write(e.output)
578583
raise

0 commit comments

Comments
 (0)