This allow to initially apply the same arg to all nodes in all tests.
e.g.: test_runner.py --nodes_arg="-greatwallactivationtime=1546300800"
will initially set all the nodes with an extra argument
-greatwallactivationtime=1546300800.
This option can be set multiple times to add multiple arguments.
These arguments are appended to the fixed argument list from TestNode,
then the extra_args from the tests are appended to these.
This still allow to override any argument from a test as the last cli argument
takes precedence over the previous occurrences.
Details
Should pass:
./test/functional/test_runner.py --nodes_arg="-greatwallactivationtime=1546300800"
Should fail:
./test/functional/test_runner.py --nodes_arg="-uacomment=foo" feature_uacomment
Should fail:
./test/functional/test_runner.py --nodes_arg="-rpcuser=foo" rpc_users
Should pass:
./test/functional/test_runner.py --nodes_arg="-rpcuser=foo" --nodes_arg="-rpcuser=rpcuser💻" rpc_users
Note: the "computer" character in the above command is not a mistake
Diff Detail
- Repository
- rABC Bitcoin ABC
- Branch
- test_runner_node_args
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 4856 Build 7775: Bitcoin ABC Buildbot (legacy) Build 7774: arc lint + arc unit
Event Timeline
I really fail to see what's the goal here.
- This will almost certainly break everything for most flags - without it actually being an error, just the flag undermining the test assumptions. There fore it doesn't seems useful as a general purpose mechanism.
- This will not work predictably for tests that override the setup_network or setup_nodes method.
- This will not work properly for multiarg.
I believe the approach to be fundamentally broken. I cannot suggest alternative as there is no motivation statement.
@deadalnix The idea is to provide a mechanism for running the tests with greatwallactivationtime enabled. This diff together with D2460 allow for running the tests both pre and post update using the CI.
This is a followup of the discussion on slack regarding D2431.
Regarding your points:
- That's correct, it's useless for other flags. I did it this way rather than a specific option for -greatwallactivationtime so the feature can be used the same for the future updates with the later flags.
- Tests that override these methods do it on purpose, I found it safer to not enforce arguments for these. It effectively makes the argument ineffective on these tests ; this behavior can be changed if required.
- Yes multiargs are prepended with this argument, which is not very intuitive
Here are the motivation and some explanations. If you think the idea is bad, I can abandon these diffs or update them to a better solution.
- Show the mechanism is not adapted. If 99% of the possible of a tool are shooting yourself in the foot, then that means the tool is badly design, end of story.
- If the intended use case is to be able to check the state of the test suite post activation, then it fail flat on its face as random tests will not do it, silently.
So this is completely wrong. I don't think this is salvageable as the whole approach is wrong. You need to go back to the drawing board with your use case in mind.