From 69333213afcc05f0014f34b5885b6ee94e2c32db Mon Sep 17 00:00:00 2001 From: JulienThevenoz Date: Mon, 22 Jan 2024 19:30:20 +0100 Subject: [PATCH] tried to change the env variables --- .github/workflows/systemtests_sim.yml | 8 ++++---- systemtests/test_flights.py | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/systemtests_sim.yml b/.github/workflows/systemtests_sim.yml index f4cdffb36..634094eb8 100644 --- a/.github/workflows/systemtests_sim.yml +++ b/.github/workflows/systemtests_sim.yml @@ -54,11 +54,12 @@ jobs: cd ros2_ws source /opt/ros/humble/setup.bash . install/local_setup.bash + ########## pip show cffirmware export PYTHONPATH="${PYTHONPATH}:/home/github/.local/lib/python3.10/site-packages/" printenv PYTHONPATH unzip /home/github/.local/lib/python3.10/site-packages/cffirmware-0.1-py3.10.egg - + ########## export ROS_LOCALHOST_ONLY=1 python3 src/crazyswarm2/systemtests/test_flights.py --sim @@ -69,9 +70,8 @@ jobs: with: name: pdf_rosbags_and_logs path: | - /home/github/.local/lib/python3.10/site-packages/cffirmware-0.1-py3.10.egg /home/github/.local/lib/python3.10/site-packages/cffirmware.py - + #/home/github/.local/lib/python3.10/site-packages/cffirmware-0.1-py3.10.egg #ros2_ws/results @@ -79,7 +79,7 @@ jobs: id: step8 if: '!cancelled()' run: | - ls /home/github/.local/lib/python3.10/ + ls /home/github/.local/lib/python3.10/site-packages/ diff --git a/systemtests/test_flights.py b/systemtests/test_flights.py index a8e4fb9fe..259f92592 100644 --- a/systemtests/test_flights.py +++ b/systemtests/test_flights.py @@ -78,12 +78,14 @@ def setUp(self): self.test_file = None # launch server + current_env = None src = "source " + str(Path(__file__).parents[3] / "install/setup.bash") # -> "source /home/github/actions-runner/_work/crazyswarm2/crazyswarm2/ros2_ws/install/setup.bash" command = f"{src} && ros2 launch crazyflie launch.py" if TestFlights.SIM : command += " backend:=sim" #launch crazyswarm from simulation backend + current_env = os.environ.copy() self.launch_crazyswarm = Popen(command, shell=True, stderr=PIPE, stdout=PIPE, text=True, - start_new_session=True, executable="/bin/bash") + start_new_session=True, executable="/bin/bash", env=current_env) atexit.register(clean_process, self.launch_crazyswarm) #atexit helps us to make sure processes are cleaned even if script exits unexpectedly time.sleep(1)