Page MenuHomePhabricator

Fix abc-cmdline, part 1 (enable out-of-tree running)
AbandonedPublic

Authored by freetrader on Jun 13 2017, 00:00.

Details

Reviewers
deadalnix
sickpig
kyuupichan
Group Reviewers
Restricted Project
Summary

Add some special workaround code in abc-cmdline.py for out-of-tree running
If all fails and the script cannot locate a reliable bitcoind, it will issue an error:

Unable to locate bitcoind for this test.

We add a get_srcdir() utility method to util.py to help us.

The workaround section in abc-cmdline.py can be removed in future
once the test runner has been made capable of executing the test.
(This will be a separate part 2.)

Test Plan

Follow the description in T32 to produce an out-of-tree build.
From the build/ folder, run

$ ../qa/rpc-tests/abc-cmdline.py 2>/dev/null

You should see output like this:

Initializing test directory /tmp/test0j0w2nm3/15688
Testing -excessiveblocksize
  Set to twice the default, i.e. 2000000 bytes
  Attempt to set below legacy limit of 1MB - try 999999 bytes
  Attempt to set below blockmaxsize (mining limit)
Stopping nodes
Cleaning up
Tests successful

Remove the out-of-tree bitcoind binary and run again:

$ rm src/bitcoind && ../qa/rpc-tests/abc-cmdline.py

You should get an error message saying it cannot locate the binary:

$ rm -f src/bitcoind && ../qa/rpc-tests/abc-cmdline.py 
Unable to locate bitcoind for this test.

Diff Detail

Repository
rABC Bitcoin ABC
Branch
cmdline_locate_bitcoind
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 250
Build 250: arc lint + arc unit

Event Timeline

Herald added 1 blocking reviewer(s): Restricted Project. · View Herald TranscriptJun 13 2017, 00:00
NOTE: it is not an oversight that this diff does not re-enable abc-cmdline.py in the rpc-tests.py wrapper. This must wait until part 2 of this series has been implemented.

It does looks like this whole mechanism is altering global state that should have been defined by the test framework. I don't think this is moving in the right direction. There are numerous test which invoke start_node and they all fail when run standalone from a place it doesn't expect. If we want these to run standalone, then patching this function seems more appropriate.

qa/rpc-tests/test_framework/util.py
716

I assume there are no test for the test framework ? If there are, then this is a good candidate for testing.

qa/rpc-tests/test_framework/util.py
716

You are correct.

The first step would be to add some Python doctests to modules.

Adding more comprehensive portable self-tests to the framework is a bigger job which I won't tackle prior to a fork.

Abandoning this as I have a better fix implemented now (in final testing).