Skip to content

Commit f41160c

Browse files
committed
testing: Ensure we have a CLN version to use in NodeFactory
It turns out we were accessing the external `$PATH` which may or may not contain a valid `lightningd`.`
1 parent 16bf769 commit f41160c

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

libs/gl-testing/gltesting/fixtures.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,3 +160,20 @@ def clients(directory, scheduler, nobody_id):
160160
directory=directory / "clients", scheduler=scheduler, nobody_id=nobody_id
161161
)
162162
yield clients
163+
164+
165+
@pytest.fixture(scope='session', autouse=True)
166+
def cln_path() -> Path:
167+
"""Ensure that the latest CLN version is in PATH.
168+
169+
Some tests use the NodeFactory directly, which relies on being
170+
able to pick a recent CLN version from the `$PATH`. By appending
171+
at the end we just ensure that there is a CLN version to be found.
172+
173+
This is our Elephant in Cairo :-)
174+
https://en.wikipedia.org/wiki/Elephant_in_Cairo
175+
"""
176+
manager = ClnVersionManager()
177+
v = manager.latest()
178+
os.environ['PATH'] += f":{v.bin_path}"
179+
return v.bin_path

0 commit comments

Comments
 (0)