diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 72fc77d6e..0555de4fd 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -9,7 +9,13 @@ on: concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true - + +env: + # Makes the upload-artifact work more reliably at the cost + # of a bit of compile time. + RUST_PROFILE: release + SLOW_MACHINE: 1 + jobs: prebuild: name: Pre-build checks @@ -138,8 +144,6 @@ jobs: CFG: ${{ matrix.CFG }} run: | set -e - export SLOW_MACHINE=1 - pip3 install --user pip wheel poetry poetry export -o requirements.txt --with dev --without-hashes python3 -m pip install -r requirements.txt @@ -148,11 +152,11 @@ jobs: make -j $(nproc) testpack.tar.bz2 # Rename now so we don't clash - mv testpack.tar cln-${CFG}.tar + mv testpack.tar.bz2 cln-${CFG}.tar.bz2 - uses: actions/upload-artifact@v3 with: - name: cln-${{ matrix.CFG }}.tar - path: cln-${{ matrix.CFG }}.tar + name: cln-${{ matrix.CFG }}.tar.bz2 + path: cln-${{ matrix.CFG }}.tar.bz2 integration: name: Test CLN ${{ matrix.cfg }} @@ -161,6 +165,7 @@ jobs: COMPAT: 1 BITCOIN_VERSION: 0.20.1 ELEMENTS_VERSION: 0.18.1.8 + RUST_PROFILE: release # Has to match the one in the compile step needs: - compile strategy: @@ -227,7 +232,7 @@ jobs: - name: Download build uses: actions/download-artifact@v3 with: - name: cln-${{ matrix.CFG }}.tar + name: cln-${{ matrix.CFG }}.tar.bz2 - name: Test env: @@ -241,8 +246,8 @@ jobs: PYTEST_PAR: 10 TEST_DEBUG: 1 run: | - tar -xf cln-${CFG}.tar - poetry run pytest tests/ -n ${PYTEST_PAR} ${PYTEST_OPTS} + tar -xaf cln-${CFG}.tar.bz2 + poetry run pytest tests/ -vvv -n ${PYTEST_PAR} ${PYTEST_OPTS} gather: # A dummy task that depends on the full matrix of tests, and diff --git a/cln-rpc/Makefile b/cln-rpc/Makefile index 9f2595a92..499844612 100644 --- a/cln-rpc/Makefile +++ b/cln-rpc/Makefile @@ -1,7 +1,7 @@ cln-rpc-wrongdir: $(MAKE) -C .. cln-rpc-all -CLN_RPC_EXAMPLES := target/debug/examples/cln-rpc-getinfo +CLN_RPC_EXAMPLES := target/${RUST_PROFILE}/examples/cln-rpc-getinfo CLN_RPC_GENALL = cln-rpc/src/model.rs CLN_RPC_SOURCES = $(shell find cln-rpc -name *.rs) ${CLN_RPC_GENALL} JSON_SCHEMAS = $(wildcard doc/schemas/*.request.json doc/schemas/*.schema.json) diff --git a/tests/test_cln_rs.py b/tests/test_cln_rs.py index 9d6e619a6..442c11657 100644 --- a/tests/test_cln_rs.py +++ b/tests/test_cln_rs.py @@ -8,6 +8,7 @@ from pyln.testing.utils import env, TEST_NETWORK, wait_for import grpc import pytest import subprocess +import os # Skip the entire module if we don't have Rust. pytestmark = pytest.mark.skipif( @@ -15,6 +16,8 @@ pytestmark = pytest.mark.skipif( reason='RUST is not enabled skipping rust-dependent tests' ) +RUST_PROFILE = os.environ.get("RUST_PROFILE", "debug") + def wait_for_grpc_start(node): """This can happen before "public key" which start() swallows""" @@ -23,7 +26,7 @@ def wait_for_grpc_start(node): def test_rpc_client(node_factory): l1 = node_factory.get_node() - bin_path = Path.cwd() / "target" / "debug" / "examples" / "cln-rpc-getinfo" + bin_path = Path.cwd() / "target" / RUST_PROFILE / "examples" / "cln-rpc-getinfo" rpc_path = Path(l1.daemon.lightning_dir) / TEST_NETWORK / "lightning-rpc" out = subprocess.check_output([bin_path, rpc_path], stderr=subprocess.STDOUT) assert(b'0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518' in out) @@ -32,7 +35,7 @@ def test_rpc_client(node_factory): def test_plugin_start(node_factory): """Start a minimal plugin and ensure it is well-behaved """ - bin_path = Path.cwd() / "target" / "debug" / "examples" / "cln-plugin-startup" + bin_path = Path.cwd() / "target" / RUST_PROFILE / "examples" / "cln-plugin-startup" l1 = node_factory.get_node(options={"plugin": str(bin_path), 'test-option': 31337}) l2 = node_factory.get_node() @@ -75,7 +78,7 @@ def test_plugin_start(node_factory): def test_plugin_optional_opts(node_factory): """Start a minimal plugin and ensure it is well-behaved """ - bin_path = Path.cwd() / "target" / "debug" / "examples" / "cln-plugin-startup" + bin_path = Path.cwd() / "target" / RUST_PROFILE / "examples" / "cln-plugin-startup" l1 = node_factory.get_node(options={"plugin": str(bin_path), 'opt-option': 31337}) opts = l1.rpc.testoptions() print(opts)