HomePhabricator

[chronik-client] Add support for integration tests

Description

[chronik-client] Add support for integration tests

Summary:
This is an initial framework to run chronik-client integration tests against the built-in chronik version.
This leverage the existing test framework so setup scripts can be easily developed, and a state machinebased on IPC communication with nodejs makes it possible to construct complex scenarios.

The exit code is success only if both the python and the JS returns 0, so assertions in the python setup are possible.

If run directly, it is possible to interact with the python script by sending commands from the terminal. This enables testing the setup script standalone.

Integration with the CI will be done in a follow-up.

Test Plan:
Build the node with chronik:

mkdir buildChronik
pushd buildChronik
cmake -GNinja .. -DBUILD_BITCOIN_CHRONIK=ON
ninja

Run the setup script standalone:

./test/functional/test_runner.py setup_scripts/chronik-client_blockchain_info

Type the following sequence in the terminal to see the setup steps:

next
next
next
next
stop

Then run the integration tests:

popd
pushd modules/chronik-client
npm ci
BUILD_DIR="${PWD}/../../buildChronik" npm run integration-tests
popd

Reviewers: #bitcoin_abc, bytesofman, PiRK

Reviewed By: #bitcoin_abc, bytesofman, PiRK

Subscribers: PiRK, bytesofman

Differential Revision: https://reviews.bitcoinabc.org/D14915

Details

Provenance
FabienAuthored on Dec 5 2023, 17:15
FabienPushed on Dec 10 2023, 09:40
Reviewer
Restricted Project
Differential Revision
D14915: [chronik-client] Add support for integration tests
Parents
rABCcc6452241bae: [avalanche] Inline getPeerScoreFromNodeId
Branches
Unknown
Tags
Unknown