File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
libs/gl-testing/gltesting Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 1414from gltesting .network import node_factory
1515from pyln .testing .fixtures import directory as str_directory
1616from decimal import Decimal
17+ from clnvm import ClnVersionManager
1718
1819logging .basicConfig (level = logging .DEBUG , stream = sys .stdout )
1920logging .getLogger ().addHandler (logging .StreamHandler (sys .stdout ))
2021logging .getLogger ("sh" ).setLevel (logging .ERROR )
2122logging .getLogger ("hpack" ).setLevel (logging .ERROR )
2223logger = logging .getLogger (__name__ )
2324
25+
26+ @pytest .fixture (autouse = True )
27+ def paths ():
28+ """A fixture to ensure that we have all CLN versions and that
29+ `PATH` points to the latest one.
30+
31+ If you'd like to test a development version rather than the
32+ released ones, ensure that its executable path is in the PATH
33+ before calling `pytest` since this appends to the end.
34+
35+ """
36+ vm = ClnVersionManager ()
37+ versions = vm .get_versions ()
38+
39+ # Should be a no-op after the first run
40+ vm .get_all ()
41+
42+ latest = [v for v in versions if 'gl' in v .tag ][- 1 ]
43+
44+ os .environ ['PATH' ] += f":{ vm .get_target_path (latest ) / 'usr' / 'local' / 'bin' } "
45+
46+ yield
47+
48+
2449@pytest .fixture ()
2550def directory (str_directory : str ) -> Path :
2651 return Path (str_directory ) / "gl-testing"
2752
53+
2854@pytest .fixture ()
2955def cert_directory (directory ):
3056 yield directory / "certs"
You can’t perform that action at this time.
0 commit comments