126 lines
4.6 KiB
YAML
126 lines
4.6 KiB
YAML
task:
|
|
name: 'Functional tests'
|
|
container:
|
|
image: rust:1-bookworm
|
|
timeout_in: 90m # https://cirrus-ci.org/faq/#instance-timed-out
|
|
|
|
env:
|
|
EXECUTOR_WORKERS: 3
|
|
VERBOSE: 0
|
|
LOG_LEVEL: debug
|
|
TIMEOUT: 120
|
|
matrix:
|
|
- name: 'Misc functional tests'
|
|
env:
|
|
TEST_GROUP: tests/test_misc.py
|
|
matrix:
|
|
- USE_MIN_BITCOIN_VERSION: 'TRUE'
|
|
- USE_MIN_BITCOIN_VERSION: 'FALSE'
|
|
- USE_TAPROOT: 1
|
|
BITCOIN_BACKEND_TYPE: 'bitcoind'
|
|
- USE_TAPROOT: 1
|
|
BITCOIN_BACKEND_TYPE: 'electrs'
|
|
- USE_TAPROOT: 0
|
|
BITCOIN_BACKEND_TYPE: 'electrs'
|
|
- name: 'RPC functional tests'
|
|
env:
|
|
TEST_GROUP: tests/test_rpc.py
|
|
matrix:
|
|
- USE_TAPROOT: 0
|
|
BITCOIN_BACKEND_TYPE: 'bitcoind'
|
|
- USE_TAPROOT: 1
|
|
BITCOIN_BACKEND_TYPE: 'bitcoind'
|
|
- USE_TAPROOT: 0
|
|
BITCOIN_BACKEND_TYPE: 'electrs'
|
|
- USE_TAPROOT: 1
|
|
BITCOIN_BACKEND_TYPE: 'electrs'
|
|
- name: 'Chain functional tests'
|
|
env:
|
|
TEST_GROUP: tests/test_chain.py
|
|
matrix:
|
|
- USE_TAPROOT: 0
|
|
BITCOIN_BACKEND_TYPE: 'bitcoind'
|
|
- USE_TAPROOT: 1
|
|
BITCOIN_BACKEND_TYPE: 'bitcoind'
|
|
- USE_TAPROOT: 0
|
|
BITCOIN_BACKEND_TYPE: 'electrs'
|
|
- USE_TAPROOT: 1
|
|
BITCOIN_BACKEND_TYPE: 'electrs'
|
|
- name: 'Spend functional tests'
|
|
env:
|
|
TEST_GROUP: tests/test_spend.py
|
|
matrix:
|
|
- USE_TAPROOT: 0
|
|
BITCOIN_BACKEND_TYPE: 'bitcoind'
|
|
- USE_TAPROOT: 1
|
|
BITCOIN_BACKEND_TYPE: 'bitcoind'
|
|
- USE_TAPROOT: 0
|
|
BITCOIN_BACKEND_TYPE: 'electrs'
|
|
- USE_TAPROOT: 1
|
|
BITCOIN_BACKEND_TYPE: 'electrs'
|
|
|
|
cargo_registry_cache:
|
|
folders: $CARGO_HOME/registry
|
|
fingerprint_script: cat Cargo.lock
|
|
cargo_git_cache:
|
|
folders: $CARGO_HOME/git # It will fail if they aren't separated
|
|
fingerprint_script: cat Cargo.lock
|
|
target_cache:
|
|
folder: target
|
|
fingerprint_script:
|
|
- rustc --version
|
|
- cat Cargo.lock
|
|
tests_tools_cache:
|
|
folder: tests/tools/taproot_signer/target
|
|
fingerprint_script:
|
|
- rustc --version
|
|
- cat tests/tools/taproot_signer/Cargo.lock
|
|
lianad_build_script: cd lianad && cargo build --release && cd ../tests/tools/taproot_signer && cargo build --release
|
|
|
|
deps_script: apt update && apt install -y python3 python3-pip
|
|
|
|
pip_cache:
|
|
folder: ~/.cache/pip
|
|
python_deps_script: pip install --break-system-packages -r tests/requirements.txt
|
|
|
|
test_script: |
|
|
set -xe
|
|
|
|
# We always need bitcoind, even when using a different backend.
|
|
if [ "$USE_MIN_BITCOIN_VERSION" = "TRUE" ]; then
|
|
# Download the minimum required bitcoind binary
|
|
curl -O https://bitcoincore.org/bin/bitcoin-core-24.0.1/bitcoin-24.0.1-x86_64-linux-gnu.tar.gz
|
|
echo "49df6e444515d457ea0b885d66f521f2a26ca92ccf73d5296082e633544253bf bitcoin-24.0.1-x86_64-linux-gnu.tar.gz" | sha256sum -c
|
|
tar -xzf bitcoin-24.0.1-x86_64-linux-gnu.tar.gz
|
|
export BITCOIND_PATH=bitcoin-24.0.1/bin/bitcoind
|
|
export IS_NOT_BITCOIND_24=0
|
|
else
|
|
# Download the bitcoind binary
|
|
curl -O https://bitcoincore.org/bin/bitcoin-core-26.0/bitcoin-26.0-x86_64-linux-gnu.tar.gz
|
|
echo "23e5ab226d9e01ffaadef5ffabe8868d0db23db952b90b0593652993680bb8ab bitcoin-26.0-x86_64-linux-gnu.tar.gz" | sha256sum -c
|
|
tar -xzf bitcoin-26.0-x86_64-linux-gnu.tar.gz
|
|
export BITCOIND_PATH=bitcoin-26.0/bin/bitcoind
|
|
fi
|
|
|
|
if [ "$BITCOIN_BACKEND_TYPE" = "electrs" ]; then
|
|
curl -OL https://github.com/RCasatta/electrsd/releases/download/electrs_releases/electrs_linux_v0.9.11.zip
|
|
echo "2b2f8aef35cd8e16e109b948a903d010aa472f6cdf2147d47e01fd95cd1785da electrs_linux_v0.9.11.zip" | sha256sum -c
|
|
unzip electrs_linux_v0.9.11.zip
|
|
chmod 754 electrs
|
|
export ELECTRS_PATH=$PWD/electrs
|
|
fi
|
|
|
|
# The misc tests have a backward compat test that need the path to a previous version of Liana.
|
|
# For now it requires using 0.3.
|
|
if [ "$TEST_GROUP" = "tests/test_misc.py" ]; then
|
|
curl -LO https://github.com/wizardsardine/liana/releases/download/0.3.1/liana-0.3.1-x86_64-linux-gnu.tar.gz
|
|
echo "70c8595554b6f78ccc7b66ef5f5ebc5bac03a7b1ce28afe8a076f69adf59c583 liana-0.3.1-x86_64-linux-gnu.tar.gz" | sha256sum -c
|
|
tar -xzf liana-0.3.1-x86_64-linux-gnu.tar.gz
|
|
export OLD_LIANAD_PATH="$PWD/liana-0.3.1-x86_64-linux-gnu/lianad"
|
|
fi
|
|
|
|
# Run the functional tests
|
|
LIANAD_PATH=$PWD/target/release/lianad pytest $TEST_GROUP -vvv -n 2
|
|
|
|
before_cache_script: rm -rf $CARGO_HOME/registry/index
|