HomePhabricator

test: re-enable CLI test support by using EncodeDecimal in json.dumps()

Description

test: re-enable CLI test support by using EncodeDecimal in json.dumps()

Summary:

As mentioned in
https://github.com/bitcoin/bitcoin/pull/17675#issuecomment-563188648

This makes more functional tests compatible with option --usecli, by fixing the JSON serialization error for Decimal objects. This was the most common error preventing tests to run with --usecli in D8316.

I found two more tests that are fixed by this change, that were not activated in the original PR: wallet_address_types.py and feature_csv_activation.py

Before:

$ ninja && test/functional/test_runner.py --usecli 2>&1 | cut -f2 -d'|' |     grep -E ' (Passed|Skipped|Failed|) *$' | sort | uniq -c
     97  ✓ Passed
     49  ○ Skipped

After:

$ ninja && test/functional/test_runner.py --usecli 2>&1 | cut -f2 -d'|' |     grep -E ' (Passed|Skipped|Failed|) *$' | sort | uniq -c
    110  ✓ Passed
     36  ○ Skipped

This is a backport of Core PR17705
Depends on D8317

Test Plan: test/functional/test_runner.py --usecli

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D8320

Details

Provenance
fanquake <fanquake@gmail.com>Authored on Dec 9 2019, 20:02
PiRKCommitted on Nov 10 2020, 09:53
PiRKPushed on Nov 10 2020, 09:53
Reviewer
Restricted Project
Differential Revision
D8320: test: re-enable CLI test support by using EncodeDecimal in json.dumps()
Parents
rABCbb9efe91c101: tests: Use a default of supports_cli=True (instead of supports_cli=False)
Branches
Unknown
Tags
Unknown