Skip to content
Open
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
1 change: 1 addition & 0 deletions contrib/pyln-testing/pyln/testing/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
4 changes: 4 additions & 0 deletions tests/test_cln_lsps.py
Original file line number Diff line number Diff line change
@@ -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")

Expand All @@ -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}
Expand Down
4 changes: 2 additions & 2 deletions tests/test_cln_rs.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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'
)

Expand Down
8 changes: 7 additions & 1 deletion tests/test_clnrest.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion tests/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down
Loading