Page MenuHomePhabricator

Add two simple test framework self-tests
ClosedPublic

Authored by freetrader on Jun 20 2017, 14:23.

Details

Summary

Created a new test_framework/tests/ subdirectory for test framework
self-tests.

A test runner for these tests is provided in run_self_tests.sh.
This is not integrated into routine test suite execution targets,
it must be run manually for now.
It is possible to call these self-tests directly provided your
PYTHONPATH is to the location of your rpc-tests/ folder, and your
SRCDIR is set to the parent of the top level src/ folder, so that
tests can find the bitcoind executable.

Test framework self-tests are just regular Python tests in the same
manner as the Bitcoin regression tests.

The two first tests were used during development of internal framework
changes for ABC.

This diff has purposefully been separated from the stderr checking feature
patch to reduce overall review efforts and keep it focused.

Test Plan

export SRCDIR=</path/to/your/toplevel/folder>
export PYTHONPATH=$SRCDIR/qa/rpc-tests
sh qa/rpc-tests/test_framework/tests/run_self_tests.sh

You should see output of the self-tests executing successfully.

Diff Detail

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

Event Timeline

Herald added 1 blocking reviewer(s): Restricted Project. · View Herald TranscriptJun 20 2017, 14:23

Most likely needs changes after recent D230 changes.
The SimpleInitializeTest might be obsolete.

Updated after the initial stderr checkers are no longer
passed to initialize_chain. It is transformed instead into
a test which calls initialize_chain directly to set up
a test chain.

deadalnix added inline comments.
qa/rpc-tests/test_framework/tests/run_self_tests.sh
12 ↗(On Diff #642)

Writting this in python would allow to use the config file, and get the folder and all figured out. This guy run from the wrong place won't do anything useful.

This revision is now accepted and ready to land.Jun 22 2017, 20:47
qa/rpc-tests/test_framework/tests/run_self_tests.sh
12 ↗(On Diff #642)

Yes, the runner should be unified, and should be Python.

The reg test suite definitions should move out of the runner to some sensible test config file.
Then one could just create a definition file for the self-tests and run that.

This revision was automatically updated to reflect the committed changes.