Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
167 changes: 11 additions & 156 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,171 +10,26 @@ on:
env:
CARGO_TERM_COLOR: always

# Draft scope: only the VSS durability gap tests run, and they are expected
# to fail until the gaps are fixed. The full job matrix returns before this
# PR leaves draft.
jobs:
feature-matrix:
vss-durability-gap-tests:
runs-on: warp-ubuntu-latest-x64-16x
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
mode: [rest-uniffi-with-vls, wasm-without-vls]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
rustflags: ""
# Needed by the `wasm-without-vls` mode, which runs `cargo check --target
# wasm32-unknown-unknown` against the wasm-sdk crate.
target: wasm32-unknown-unknown
- name: Run feature-matrix checks
run: |
set -euo pipefail
if [ "${{ matrix.mode }}" = "rest-uniffi-with-vls" ]; then
cargo check --features "uniffi,vls" --lib
cargo test --features "uniffi,vls" --lib 'uniffi_smoke_tests::' -- --test-threads=1
cargo test --features "uniffi,vls" --lib 'sdk::tests::attached_external_unlock_with_mismatched_bootstrap_fails' -- --test-threads=1
cargo test --features "uniffi,vls" --lib 'sdk::tests::attached_external_unlock_without_registered_signer_is_unavailable' -- --test-threads=1
cargo test --features "uniffi,vls" --lib 'signer::in_process_transport::tests::' -- --test-threads=1
elif [ "${{ matrix.mode }}" = "wasm-without-vls" ]; then
# WASM SDK crate is tracked in a separate workspace/repo path in current layout.
# It never pulls VLS, so this gate is inherently non-VLS.
cargo check --no-default-features -p uniffi-bindgen --manifest-path bindings/uniffi-bindgen/Cargo.toml
if [ -f bindings/wasm-sdk/Cargo.toml ]; then
# Build with default features: `real-wasm-rgb` is the crate's whole purpose and
# enables `lightning/rgb-wasm`. With `--no-default-features` the rust-lightning RGB
# backend code fails to compile, and the crate has no `vls` feature to exclude anyway.
cargo check --target wasm32-unknown-unknown --manifest-path bindings/wasm-sdk/Cargo.toml
else
echo "bindings/wasm-sdk/Cargo.toml not found; skipping direct wasm-sdk cargo check in this repository layout"
fi
else
echo "unknown matrix mode: ${{ matrix.mode }}"
exit 1
fi

external-signer-regressions:
runs-on: warp-ubuntu-latest-x64-16x
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
rustflags: ""
- name: Run external signer regression gates
run: |
set -euo pipefail
cargo check --features "uniffi,vls" --lib
cargo test --features "uniffi,vls" --lib 'sdk::tests::external_init_persists_key_source_file' -- --test-threads=1
cargo test --features "uniffi,vls" --lib 'sdk::tests::internal_init_is_rejected_in_external_mode' -- --test-threads=1
cargo test --features "uniffi,vls" --lib 'sdk::tests::internal_unlock_is_rejected_in_external_mode' -- --test-threads=1
cargo test --features "uniffi,vls" --lib 'sdk::tests::external_init_is_idempotent_for_existing_key_source' -- --test-threads=1
cargo test --features "uniffi,vls" --lib 'sdk::tests::attached_external_unlock_without_registered_signer_is_unavailable' -- --test-threads=1
cargo test --features "uniffi,vls" --lib 'sdk::tests::attached_external_unlock_with_mismatched_bootstrap_fails' -- --test-threads=1
cargo test --features "uniffi,vls" --lib 'signer::channel_signer::tests::' -- --test-threads=1
cargo test --features "uniffi,vls" --lib 'signer::in_process_transport::tests::' -- --test-threads=1

test:
runs-on: warp-ubuntu-latest-x64-16x
timeout-minutes: 90
steps:
- uses: actions/checkout@v6
with:
submodules: true
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
rustflags: ""
- name: Tests
run: cargo test -- --test-threads=1 --skip test::gossip_
- name: UniFFI SDK smoke tests
run: cargo test --features uniffi --lib 'uniffi_smoke_tests::' -- --test-threads=1

parity-tests:
runs-on: warp-ubuntu-latest-x64-16x
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
test_name: [zero_amount_invoice, send_receive]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
rustflags: ""
- name: Run parity test by name
run: cargo test ${{ matrix.test_name }} -- --test-threads=1

lib-sdk-tests:
runs-on: warp-ubuntu-latest-x64-16x
timeout-minutes: 90
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
rustflags: ""
- name: Start regtest services
run: ./regtest.sh start
- name: Run lib_sdk tests
run: cargo test --features "uniffi,test-utils,vls" --test lib_sdk -- --test-threads=1
- name: Stop regtest services
if: always()
run: ./regtest.sh stop

vss-tests:
runs-on: warp-ubuntu-latest-x64-16x
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
rustflags: ""
- name: Build with vss feature
run: cargo build --features vss
- name: Start regtest and VSS services
run: VSS=1 ./regtest.sh start
- name: Run VSS tests (e2e against regtest + VSS server)
run: cargo test --features vss "test::vss::tests" -- --test-threads=1
- name: Run VSS unreachable openchannel e2e test
run: cargo test --features vss "test::vss_unreachable_openchannel" -- --test-threads=1
- name: Run VSS full-restore e2e test (wipe node dir, restore from seed)
run: cargo test --features "uniffi,test-utils,vls,vss" --test lib_sdk vss_restore -- --test-threads=1
- name: Run consignment re-import e2e test (restore without RGB backup)
run: cargo test --features "uniffi,test-utils,vls,vss" --test lib_sdk vss_consignment_reimport -- --test-threads=1
- name: Stop regtest and VSS services
- name: Start VSS services
run: docker compose --profile vss up -d --wait
- name: Wait for VSS server
run: timeout 60 bash -c 'until (echo > /dev/tcp/127.0.0.1/8081) 2>/dev/null; do sleep 2; done'
- name: Run VSS durability gap tests
run: cargo test --features vss "test::vss_durability_gaps" -- --test-threads=1
- name: Stop VSS services
if: always()
run: docker compose --profile vss down -v --remove-orphans

gossip-tests:
runs-on: warp-ubuntu-latest-x64-16x
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
rustflags: ""
- name: Pre-build RGS server image
run: docker compose --profile gossip build rgs-server
- name: Start regtest services
run: ./regtest.sh start
- name: Run gossip tests (e2e against regtest + RGS server)
run: cargo test "test::gossip_" -- --test-threads=1
- name: Dump gossip service logs (on failure)
if: failure()
run: |
echo "===== rgs-server ====="; docker logs $(docker ps -a --filter "name=rgs-server" -q) 2>&1 || true
echo "===== rgs-postgres ====="; docker logs $(docker ps -a --filter "name=rgs-postgres" -q) 2>&1 || true
echo "===== rgs-http ====="; docker logs $(docker ps -a --filter "name=rgs-http" -q) 2>&1 || true
- name: Stop regtest and gossip services
if: always()
run: docker compose --profile gossip down -v --remove-orphans
4 changes: 2 additions & 2 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ services:
bitcoind:
platform: linux/amd64
image: registry.gitlab.com/hashbeam/docker/bitcoind:30.2
command: ["-fallbackfee=0.0002", "-rest"]
command: ["-fallbackfee=0.0002", "-rest", "-rpcallowip=0.0.0.0/0"]
environment:
MYUID: 1000
MYGID: 1000
RPCAUTH: "user:84c66d54d736d8b02aaa5b02e07e759b$$cc56c229b2a49ae2bfd5932cc8a6135d435bb9a7ac037ddd351d65936082c03d"
ports:
- 18443:18443
- 127.0.0.1:18443:18443
volumes:
- ./datacore:/srv/app/.bitcoin
electrs:
Expand Down
25 changes: 24 additions & 1 deletion regtest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,28 @@ _wait_for_proxy() {
done
}

_wait_for_esplora() {
start_time=$(date +%s)
until curl --fail --silent "http://127.0.0.1:3002/block-height/0" >/dev/null; do
current_time=$(date +%s)
if [ $((current_time - start_time)) -gt $TIMEOUT ]; then
echo "Timeout waiting for Esplora to start"
$COMPOSE --profile esplora logs esplora
exit 1
fi
sleep 1
done
}

_start_services() {
_stop_services

mkdir -p data{core,index,ldk0,ldk1,ldk2,rgs}
# see compose.yaml for the exposed ports
EXPOSED_PORTS=(3000 50001)
if [ "${ESPLORA:-}" = "1" ]; then
EXPOSED_PORTS+=(3002)
fi
for port in "${EXPOSED_PORTS[@]}"; do
if _is_port_bound "$port"; then
_die "port $port is already bound, services can't be started"
Expand All @@ -102,6 +118,13 @@ _start_services() {
echo "waiting for proxy to be ready"
_wait_for_proxy

if [ "${ESPLORA:-}" = "1" ]; then
echo "starting Esplora server..."
$COMPOSE --profile esplora up -d esplora
_wait_for_esplora
echo "Esplora server available at http://localhost:3002"
fi

# optionally start VSS server
if [ "${VSS:-}" = "1" ]; then
echo "starting VSS server..."
Expand All @@ -111,7 +134,7 @@ _start_services() {
}

_stop_services() {
$COMPOSE --profile gossip down -v --remove-orphans
$COMPOSE --profile gossip --profile vss --profile esplora down -v --remove-orphans
rm -rf data{core,index,ldk0,ldk1,ldk2,rgs} 2>/dev/null || sudo rm -rf data{core,index,ldk0,ldk1,ldk2,rgs}
}

Expand Down
Loading
Loading