7f3b0b021858cfb2fe914f3ba6b30a39e3ae05ff qa: test a PSBT has only the BIP32 derivations for a single spending path (Antoine Poinsot)
b71bd693d6ea4c1c3567194fc82be43fb70c05bb qa: don't use a static dummy origin for descriptor xpubs (Antoine Poinsot)
a81d39c81a89cdf5e70b9888cbeb3abaf290a365 commands: do not include BIP32 derivations for other spending paths (Antoine Poinsot)
Pull request description:
ACKs for top commit:
edouardparis:
ACK 7f3b0b021858cfb2fe914f3ba6b30a39e3ae05ff
Tree-SHA512: f0e132edf8d653c5575f843b1e85d995f155a2435a6e6257564dc945562df70ec2049c29d77f7580858d9e4a58290b0798f298f77c18255415c4cf26ccc07f33
Lianad blackbox tests
Here we test lianad by starting it on a regression testing Bitcoin network,
and by then talking to it as an user would, from the outside.
Python scripts are used for the automation, and specifically the pytest framework.
Credits: this test framework was taken and adapted from revaultd, which was itself adapted from C-lightning's test framework.
Building the project for testing
To run the tests, we must build the debug version of lianad. Follow the instructions at doc/BUILD.md but instead of running
$ cargo build --release
Run
$ cargo build
to build the daemon for testing.
The lianad and liana-cli binaries will be in the target/debug directory at the root of the
repository.
Test dependencies
Functional tests dependencies can be installed using pip. Use a virtual environment.
# Create a new virtual environment, preferably.
python3 -m venv venv
. venv/bin/activate
# Get the deps
pip install -r tests/requirements.txt
Additionaly you need to have bitcoind installed on your computer, please
refer to bitcoincore for installation. You may use a
specific bitcoind binary by specifying the BITCOIND_PATH env var.
Running the tests
From the root of the repository:
pytest tests/
Tips and tricks
Logging
We use the Live Logging
functionality from pytest. It is configured in (pyproject.toml)[../pyproject.toml] to
output INFO-level to the console. If a test fails, the entire DEBUG log is output.
You can override the config at runtime with the --log-cli-level option:
pytest -vvv --log-cli-level=DEBUG -k test_startup
Note that we record all logs from daemons, and we start them with log_level = "debug".
Test lints
Just use black.
More
See the environment variables in test_framework/utils.py.