Skip to content

Commit

Permalink
Still trying to get subprocess to run the same in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
jmwright committed Aug 23, 2024
1 parent bbce13a commit 98deaf6
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests/test_orchestration.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest
import os

def test_cadorchestrator_command_line():
"""
Expand All @@ -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
Expand Down

0 comments on commit 98deaf6

Please sign in to comment.