From 98deaf6c4ca8547a006736e1ef1648e386a4e98e Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Fri, 23 Aug 2024 16:22:59 -0400 Subject: [PATCH] Still trying to get subprocess to run the same in CI --- tests/test_orchestration.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/test_orchestration.py b/tests/test_orchestration.py index 59d0613..9e2b419 100644 --- a/tests/test_orchestration.py +++ b/tests/test_orchestration.py @@ -1,4 +1,5 @@ import pytest +import os def test_cadorchestrator_command_line(): """ @@ -15,8 +16,16 @@ def test_cadorchestrator_command_line(): if os.path.exists(build_dir): shutil.rmtree(build_dir) + if "PYTHONPATH" in os.environ: + py_path = os.getcwd() + ":" + os.environ["PYTHONPATH"] + else: + py_path = None + # Run the cadorchestrator with the test configuration file - result = subprocess.run(["cadorchestrator", "generate", "[\"NUC10i5FNH\", \"Raspberry_Pi_4B\", \"Raspberry_Pi_4B\"]"], env=dict(PATH=os.environ['PATH'] + ":" + os.getcwd())) + if py_path == None: + result = subprocess.run(["cadorchestrator", "generate", "[\"NUC10i5FNH\", \"Raspberry_Pi_4B\", \"Raspberry_Pi_4B\"]"]) + else: + result = subprocess.run(["cadorchestrator", "generate", "[\"NUC10i5FNH\", \"Raspberry_Pi_4B\", \"Raspberry_Pi_4B\"]"], env=dict(PYTHONPATH=py_path)) # Make sure that the command ran successfully assert result.returncode == 0