diff --git a/contrib/pyln-testing/pyln/testing/utils.py b/contrib/pyln-testing/pyln/testing/utils.py index 2317c96c315f..e841268396d9 100644 --- a/contrib/pyln-testing/pyln/testing/utils.py +++ b/contrib/pyln-testing/pyln/testing/utils.py @@ -82,6 +82,7 @@ def env(name, default=None): EXPERIMENTAL_DUAL_FUND = env("EXPERIMENTAL_DUAL_FUND", "0") == "1" EXPERIMENTAL_SPLICING = env("EXPERIMENTAL_SPLICING", "0") == "1" GENERATE_EXAMPLES = env("GENERATE_EXAMPLES", "0") == "1" +RUST = env("RUST", "0") == "1" def wait_for(success, timeout=TIMEOUT): diff --git a/tests/test_cln_lsps.py b/tests/test_cln_lsps.py index 68ae13792b07..28f09d64d750 100644 --- a/tests/test_cln_lsps.py +++ b/tests/test_cln_lsps.py @@ -1,5 +1,8 @@ from fixtures import * # noqa: F401,F403 +from pyln.testing.utils import RUST + import os +import unittest RUST_PROFILE = os.environ.get("RUST_PROFILE", "debug") @@ -15,6 +18,7 @@ def test_lsps_service_disabled(node_factory): l1.daemon.is_in_log("`lsps-service` not enabled") +@unittest.skipUnless(RUST, 'RUST is not enabled') def test_lsps0_listprotocols(node_factory): l1, l2 = node_factory.get_nodes(2, opts=[ {}, {"dev-lsps-service": True} diff --git a/tests/test_cln_rs.py b/tests/test_cln_rs.py index 6363e7830458..dec0800f44ed 100644 --- a/tests/test_cln_rs.py +++ b/tests/test_cln_rs.py @@ -1,7 +1,7 @@ from fixtures import * # noqa: F401,F403 from pathlib import Path from pyln import grpc as clnpb -from pyln.testing.utils import env, TEST_NETWORK, wait_for, sync_blockheight, TIMEOUT, RpcError +from pyln.testing.utils import RUST, TEST_NETWORK, wait_for, sync_blockheight, TIMEOUT, RpcError from utils import first_scid import grpc import pytest @@ -11,7 +11,7 @@ # Skip the entire module if we don't have Rust. pytestmark = pytest.mark.skipif( - env('RUST') != '1', + not RUST, reason='RUST is not enabled skipping rust-dependent tests' ) diff --git a/tests/test_clnrest.py b/tests/test_clnrest.py index f9c14a28a985..ece1f813b052 100644 --- a/tests/test_clnrest.py +++ b/tests/test_clnrest.py @@ -1,5 +1,5 @@ from fixtures import * # noqa: F401,F403 -from pyln.testing.utils import TEST_NETWORK, wait_for +from pyln.testing.utils import RUST, TEST_NETWORK, wait_for from pyln.client import Millisatoshi import requests from pathlib import Path @@ -10,6 +10,12 @@ import pytest import json +# Skip the entire module if we don't have Rust. +pytestmark = pytest.mark.skipif( + not RUST, + reason='RUST is not enabled; skipping Rust-dependent tests' +) + def http_session_with_retry(): # All requests are done after matching "REST server running" in the log, diff --git a/tests/test_connection.py b/tests/test_connection.py index ed81c75f52d4..dd7bed0b17e5 100644 --- a/tests/test_connection.py +++ b/tests/test_connection.py @@ -12,7 +12,7 @@ mine_funding_to_announce, first_scid, CHANNEL_SIZE ) -from pyln.testing.utils import SLOW_MACHINE, VALGRIND, EXPERIMENTAL_DUAL_FUND, FUNDAMOUNT +from pyln.testing.utils import SLOW_MACHINE, VALGRIND, EXPERIMENTAL_DUAL_FUND, FUNDAMOUNT, RUST import os import pytest @@ -4563,6 +4563,7 @@ def test_last_stable_connection(node_factory): assert only_one(l2.rpc.listpeerchannels()['channels'])['last_stable_connection'] >= recon_time + STABLE_TIME +@unittest.skipUnless(RUST, 'RUST is not enabled') def test_wss_proxy(node_factory): wss_port = node_factory.get_unused_port() ws_port = node_factory.get_unused_port()