From 84b3e80d16e7b305bd601a5fb2251f87989e2d3c Mon Sep 17 00:00:00 2001 From: ShahanaFarooqui Date: Tue, 3 Sep 2024 20:29:47 -0700 Subject: [PATCH] test: testplugpass requirements.txt updated to install local pyln-client Python was installing `pyln-client` directly from the server for testplugpass plugin. This commit is updating the requirements.txt file to install pyln-client with absolute local path. --- tests/test_reckless.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/test_reckless.py b/tests/test_reckless.py index 8f32447b0..7723c8692 100644 --- a/tests/test_reckless.py +++ b/tests/test_reckless.py @@ -39,6 +39,14 @@ def canned_github_server(directory): repo_dir = os.path.join(directory, "lightningd") os.mkdir(repo_dir, 0o777) plugins_path = str(FILE_PATH / 'data/recklessrepo/lightningd') + + # Create requirements.txt file for the testpluginpass + # with pyln-client installed from the local source + requirements_file_path = os.path.join(plugins_path, 'testplugpass', 'requirements.txt') + with open(requirements_file_path, 'w') as f: + pyln_client_path = os.path.abspath(os.path.join(FILE_PATH, '..', 'contrib', 'pyln-client')) + f.write(f"pyln-client @ file://{pyln_client_path}\n") + # This lets us temporarily set .gitconfig user info in order to commit my_env['HOME'] = directory with open(os.path.join(directory, '.gitconfig'), 'w') as conf: @@ -77,6 +85,9 @@ def canned_github_server(directory): # We also need the github api data for the repo which will be served via http shutil.copyfile(str(FILE_PATH / 'data/recklessrepo/rkls_api_lightningd_plugins.json'), os.path.join(directory, 'rkls_api_lightningd_plugins.json')) yield + # Delete requirements.txt from the testplugpass directory + with open(requirements_file_path, 'w') as f: + f.write(f"pyln-client\n\n") server.terminate()