[tests] functional tests should call BitcoinTestFramework start/stop node methods#10359
Conversation
|
Concept ACK. Needs rebase. |
883081d to
fb580db
Compare
fb580db to
e42627d
Compare
|
rebased |
This commit changes the individual test scripts to call the start_node(s) and stop_node(s) methods in BitcoinTestFramework.
This commit marks the start/stop functions in util.py as private module functions. A future PR will remove these entirely and move the functionality directly into the BitcoinTestFramework class, but setting them as private in this PR will prevent anyone from accidentally calling them before that future PR is merged.
e42627d to
a433d8a
Compare
|
rebased. It'd be really helpful to get this merged so we can make some progress on #10082 . This is the only disruptive changeset in that larger PR - the rest of the changes are restricted to the test_framework directory. This PR touches a lot of files, but it should be a trivial review. It's simply changing calls from @MarcoFalke , @TheBlueMatt , @ryanofsky , @sdaftuar, @jimmysong, @kallewoof - if I could convince any of you to review, I'd be very grateful! |
test/functional/blockchain.py
Outdated
| assert_raises_jsonrpc, | ||
| assert_is_hex_string, | ||
| assert_is_hash_string, | ||
| connect_nodes_bi, |
There was a problem hiding this comment.
Change seems unrelated, maybe revert.
There was a problem hiding this comment.
yes. not sure how that snuck in. Reverted.
| ############################################################ | ||
| # locked wallet test | ||
| self.nodes[1].encryptwallet("test") | ||
| self.stop_node(0) |
There was a problem hiding this comment.
Maybe move these up one line so nodes[1].encrypt and pop(1) can be next to each other.
| stop_node(self.nodes[0],0) | ||
| self.nodes[0]=start_node(0, self.options.tmpdir, ["-minrelaytxfee=0.0001"]) | ||
| self.stop_node(0) | ||
| self.nodes[0] = self.start_node(0, self.options.tmpdir, ["-minrelaytxfee=0.0001"]) |
There was a problem hiding this comment.
The plan is to change start_node so assignment here would be unnecessary in the future?
There was a problem hiding this comment.
yes - that's certainly something we can do in a future PR once the BitcoinTestFramework class is responsible for tracking and stop/starting the nodes.
test/functional/blockchain.py
Outdated
| assert_raises_jsonrpc, | ||
| assert_is_hex_string, | ||
| assert_is_hash_string, | ||
| connect_nodes_bi, |
There was a problem hiding this comment.
Not sure why this was added?
There was a problem hiding this comment.
me neither 😳. Removed
| stop_node(self.nodes[2], 3) | ||
|
|
||
| self.nodes = start_nodes(self.num_nodes, self.options.tmpdir) | ||
| self.nodes = self.start_nodes(self.num_nodes, self.options.tmpdir) |
There was a problem hiding this comment.
I assume that self.start_nodes would also do the assignment in the future?
There was a problem hiding this comment.
Unless it should be possible to append nodes.
There was a problem hiding this comment.
certainly something we can do in a future PR.
BitcoinTestFramework could include two functions - start_nodes() to start the nodes in self.nodes, and add_nodes() if you need to append nodes to that list.
test/functional/net.py
Outdated
| connect_nodes_bi, | ||
| p2p_port, | ||
| ) | ||
| p2p_port) |
There was a problem hiding this comment.
Nit: I personally like comma endings so adding new imports has cleaner diffs.
|
Tested, ACK a433d8a A couple of really small nits. Excited to keep this moving! |
| stop_node(self.nodes[2], 3) | ||
|
|
||
| self.nodes = start_nodes(self.num_nodes, self.options.tmpdir) | ||
| self.nodes = self.start_nodes(self.num_nodes, self.options.tmpdir) |
There was a problem hiding this comment.
Unless it should be possible to append nodes.
test/functional/net.py
Outdated
| connect_nodes_bi, | ||
| p2p_port, | ||
| ) | ||
| p2p_port) |
|
Thanks @ryanofsky @jimmysong @kallewoof . Nits fixed in fixup commit. Will squash when this is ready for merge. |
|
utACK 53f6775 |
…rk start/stop node methods 53f6775 fixup: fix nits (John Newbery) a433d8a [tests] Update start/stop node functions to be private module functions (John Newbery) d8c218f [tests] Functional tests call self.start_node(s) and self.stop_node(s) (John Newbery) Tree-SHA512: 9cc01584a5e57686b7e7cb1c4c5186ad8cc7eb650d6d4f27b06bdb5e249a10966705814bdfb22d9ff2d5d3326911e489bf3d22257d751a299c0b24b7f40bffb5
…Framework start/stop node methods 53f6775 fixup: fix nits (John Newbery) a433d8a [tests] Update start/stop node functions to be private module functions (John Newbery) d8c218f [tests] Functional tests call self.start_node(s) and self.stop_node(s) (John Newbery) Tree-SHA512: 9cc01584a5e57686b7e7cb1c4c5186ad8cc7eb650d6d4f27b06bdb5e249a10966705814bdfb22d9ff2d5d3326911e489bf3d22257d751a299c0b24b7f40bffb5
Second step towards #10082
This PR changes the individual test cases to call the
BitcoinTestFramework.start_nodeand.stop_nodemethods rather than the util.py functions. This is in preparation for moving the start/stop node functionality into BitcoinTestFramework (currently the BitcoinTestFramework start/stop node methods are just wrappers for the util.py functions).The second commit changes the names of the functions in util.py to mark them as private. This is so no test cases are added/modified to call the functions directly before the next step of #10082 is merged.