Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
[tests] [utils] test bitcoin-cli #10798
+236
−94
Conversation
jnewbery
changed the title from
test bitcoin-cli to [tests] [utils] test bitcoin-cli
Jul 11, 2017
fanquake
added the
Tests
label
Jul 11, 2017
|
Changed |
laanwj
referenced
this pull request
Jul 20, 2017
Open
Handle getinfo in bitcoin-cli w/ -getinfo (revival of #8843) #10871
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
jnewbery commentedJul 11, 2017
•
edited
We don't test bitcoin-cli at all. That means that we can miss inconsistencies between the bitcoin-cli client and the RPC interface, such as #10698 and #10747. It also means that the various bitcoin-cli options and features are untested and regressions could be silently introduced.
Let's fix that.
This PR adds bitcoin-cli testing in the python functional test_framework:
getinfois the same if you run it as an RPC or through bitcoin-cli, but can easily be extended to test additional bitcoin-cli featuresEDIT:
--useclioption is moved to a separate PR. This PR now only covers the bitcoin_cli.py test.Add a--useclioption to the test framework. This changes the test to use bitcoin-cli for all RPC calls instead of using direct HTTP requests. This is somewhat experimental. It works for most tests, but there are some cases where it can't work transparently because:the testcase is asserting on a specific error code, and bitcoin-cli returns a different error code from the direct RPCwe're sending a very large RPC request (egsubmitblock) and it can't be serialized into a shell bitcoin-cli call.I think that even though--useclidoesn't work on all tests, it's still a useful experimental feature. Future potential enhancements:enhance the framework to automatically skip tests that are known to fail with bitcoin-cli if the--useclioption is used.run a subset of tests in Travis with-usecliThis builds on and requires the
TestNodePR #10711 . As an aside, this is a good demonstration of how tidy it is to add additional features/interfaces now that test node logic/state is encapsulated in a TestNode class.Addresses #10791