New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[test] Add getblockchaininfo functional test #11370

Merged
merged 2 commits into from Sep 25, 2017

Conversation

Projects
None yet
5 participants
@promag
Member

promag commented Sep 19, 2017

Adds functional test for getblockchaininfo. Also deals with the fact that pruneheight is only in the response when pruning is enabled (related to #11366).

@jnewbery

concept ACK. Thanks for improving coverage here!

A few nits inline. Nothing blocking this from being merged if you don't want to take them.

@@ -44,6 +45,38 @@ def run_test(self):
self._test_stopatheight()
assert self.nodes[0].verifychain(4, 0)
def _test_getblockchaininfo(self):

This comment has been minimized.

@jnewbery

jnewbery Sep 20, 2017

Member

suggestion: perhaps add `self.log.info("test getblockchaininfo")

@jnewbery

jnewbery Sep 20, 2017

Member

suggestion: perhaps add `self.log.info("test getblockchaininfo")

This comment has been minimized.

@promag

promag Sep 20, 2017

Member

Done.

@promag

promag Sep 20, 2017

Member

Done.

Show outdated Hide outdated test/functional/blockchain.py
Show outdated Hide outdated test/functional/blockchain.py
Show outdated Hide outdated test/functional/blockchain.py
@@ -44,6 +45,38 @@ def run_test(self):
self._test_stopatheight()
assert self.nodes[0].verifychain(4, 0)
def _test_getblockchaininfo(self):

This comment has been minimized.

@promag

promag Sep 20, 2017

Member

Done.

@promag

promag Sep 20, 2017

Member

Done.

Show outdated Hide outdated test/functional/test_framework/test_framework.py
@jnewbery

I like the new restart_node() helper function. A couple of comments inline.

Show outdated Hide outdated test/functional/blockchain.py
Show outdated Hide outdated test/functional/test_framework/test_framework.py
@@ -273,6 +273,11 @@ def stop_nodes(self):
# Wait for nodes to stop
node.wait_until_stopped()
def restart_node(self, i, extra_args=None):

This comment has been minimized.

@promag

promag Sep 20, 2017

Member

@jnewbery added the option to override node.extra_args. I wonder if that this new extra_arg should be saved in node.

@promag

promag Sep 20, 2017

Member

@jnewbery added the option to override node.extra_args. I wonder if that this new extra_arg should be saved in node.

This comment has been minimized.

@jnewbery

jnewbery Sep 20, 2017

Member

Looks good. I don't think you need to update node.extra_args

@jnewbery

jnewbery Sep 20, 2017

Member

Looks good. I don't think you need to update node.extra_args

@esotericnonsense

This comment has been minimized.

Show comment
Hide comment
@esotericnonsense

esotericnonsense Sep 20, 2017

Contributor

Noted for #11367, can update to include relevant checks (or vice versa, whichever goes in first I guess)

Contributor

esotericnonsense commented Sep 20, 2017

Noted for #11367, can update to include relevant checks (or vice versa, whichever goes in first I guess)

@promag

This comment has been minimized.

Show comment
Hide comment
@promag

promag Sep 20, 2017

Member

I guess this could go in first since #11367 is a new feature. But if #11367 goes first then I'm happy to update this.

Member

promag commented Sep 20, 2017

I guess this could go in first since #11367 is a new feature. But if #11367 goes first then I'm happy to update this.

@jnewbery

This comment has been minimized.

Show comment
Hide comment
@jnewbery

jnewbery Sep 20, 2017

Member

Tested ACK f6ffb14

Member

jnewbery commented Sep 20, 2017

Tested ACK f6ffb14

@jnewbery

This comment has been minimized.

Show comment
Hide comment
@jnewbery

jnewbery Sep 22, 2017

Member

@promag @esotericnonsense - I think it's a good idea if you decide between yourselves which should go in first and then rebase the other on top of it (otherwise there's a risk they both get merged independently and no tests are added for #11367)

Member

jnewbery commented Sep 22, 2017

@promag @esotericnonsense - I think it's a good idea if you decide between yourselves which should go in first and then rebase the other on top of it (otherwise there's a risk they both get merged independently and no tests are added for #11367)

@esotericnonsense

This comment has been minimized.

Show comment
Hide comment
@esotericnonsense

esotericnonsense Sep 22, 2017

Contributor

I'll rebase on top, given that there seem to be a few niggles with #11367 this one can go in first.

Contributor

esotericnonsense commented Sep 22, 2017

I'll rebase on top, given that there seem to be a few niggles with #11367 this one can go in first.

@laanwj laanwj merged commit f6ffb14 into bitcoin:master Sep 25, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

laanwj added a commit that referenced this pull request Sep 25, 2017

Merge #11370: [test] Add getblockchaininfo functional test
f6ffb14 [test] Add getblockchaininfo functional test (João Barbosa)
fd8f45f [test] Add restart_node to BitcoinTestFramework (João Barbosa)

Pull request description:

  Adds functional test for `getblockchaininfo`. Also deals with the fact that `pruneheight` is only in the response when pruning is enabled (related to #11366).

Tree-SHA512: 56cdec0921f572874f2fdded0990d1722d1435c3ff9979e6bff1afdccdca6f8b214dbe8d7490cdac07b5758909db085132d14340de2cce943241f7ebde7e5b6c

luke-jr added a commit to bitcoinknots/bitcoin that referenced this pull request Nov 11, 2017

luke-jr added a commit to bitcoinknots/bitcoin that referenced this pull request Nov 11, 2017

luke-jr added a commit to bitcoinknots/bitcoin that referenced this pull request Nov 11, 2017

luke-jr added a commit to bitcoinknots/bitcoin that referenced this pull request Nov 11, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment