Skip to content

feat(test): add interop test harness for CLN, LND, Eclair #234

feat(test): add interop test harness for CLN, LND, Eclair

feat(test): add interop test harness for CLN, LND, Eclair #234

name: CI Checks - CLN Integration Tests
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check-cln:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Create temporary directory for CLN data
run: echo "CLN_DATA_DIR=$(mktemp -d)" >> $GITHUB_ENV
- name: Start bitcoind, electrs, and lightningd
run: docker compose -p ldk-node -f tests/docker/docker-compose-cln.yml up -d
env:
CLN_DATA_DIR: ${{ env.CLN_DATA_DIR }}
- name: Wait for CLN to be ready
run: |
for i in $(seq 1 30); do
if docker exec ldk-node-cln-1 lightning-cli --regtest getinfo 2>/dev/null | grep -q '"id"'; then
echo "CLN is ready"
break
fi
echo "Waiting for CLN... ($i/30)"
sleep 2
done
docker exec ldk-node-cln-1 lightning-cli --regtest getinfo || {
echo "ERROR: CLN not responding"
docker compose -p ldk-node -f tests/docker/docker-compose-cln.yml logs cln
exit 1
}
- name: Set permissions for CLN data directory
run: |
sudo chown -R $(id -u):$(id -g) $CLN_DATA_DIR
sudo chmod -R 755 $CLN_DATA_DIR
env:
CLN_DATA_DIR: ${{ env.CLN_DATA_DIR }}
- name: Run CLN keysend test with trace logging
run: CLN_SOCKET_PATH=$CLN_DATA_DIR/regtest/lightning-rpc
RUSTFLAGS="--cfg cln_test" cargo test --test integration_tests_cln test_cln_receive_keysend -- --show-output --test-threads=1
env:
CLN_DATA_DIR: ${{ env.CLN_DATA_DIR }}
- name: Dump LDK logs
if: always()
run: find /tmp -maxdepth 3 -name "ldk_node.log" -exec echo "=== {} ===" \; -exec grep -i "keysend\|Failing\|fail_htlc\|payment_hash\|INCORRECT\|reject\|Spontaneous" {} \; 2>/dev/null || echo "No LDK log found"
env:
CLN_DATA_DIR: ${{ env.CLN_DATA_DIR }}