Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ROS2 python tests #663

Merged
merged 3 commits into from
Feb 22, 2024
Merged

Conversation

MateuszWasilewski
Copy link
Contributor

@MateuszWasilewski MateuszWasilewski commented Feb 1, 2024

What does this PR do?

fixes #575
resolves #574

Adds pip dependencies (connected to ros2) to o3de/python if ros2 gem is enabled.

How was this PR tested?

On non headless device run:

cd <o3de>

scripts/o3de.sh enable-gem --gem-path ../o3de-extras/Gems/ROS2 --project-name AutomatedTesting
# Build all tests for AutomatedTesting project
python/python.sh -u scripts/build/ci_build.py --platform Linux --type profile_nounity

cd build/linux
ctest -C profile -R "ROS2.PythonTests" --output-on-failure

On o3de commit 5ae4e51252

Signed-off-by: Mateusz Wasilewski <mateusz.wasilewski@robotec.ai>
Signed-off-by: Mateusz Wasilewski <mateusz.wasilewski@robotec.ai>
@MateuszWasilewski MateuszWasilewski changed the title Mw/ros2 python tests Fix ROS2 python tests Feb 1, 2024
Copy link
Contributor

@jhanca-robotecai jhanca-robotecai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on o3de cec608023e

Tests passed correctly after changing the default level name - my project did not have DefaultLevel level.

diff --git a/Gems/ROS2/Code/PythonTests/tests/SmokeTests_EnterGameModeWorks.py b/Gems/ROS2/Code/PythonTests/tests/SmokeTests_EnterGameModeWorks.py
index e97d406b..7c5c728b 100644
--- a/Gems/ROS2/Code/PythonTests/tests/SmokeTests_EnterGameModeWorks.py
+++ b/Gems/ROS2/Code/PythonTests/tests/SmokeTests_EnterGameModeWorks.py
@@ -72,7 +72,7 @@ def SmokeTest_EnterGameModeWorks():
     # - /tf
     # - /tf_static
     # - /clock
-    helper.open_level(level="DefaultLevel", directory='')
+    helper.open_level(level="DemoLevel", directory='')
 
     topics_before_game_mode = check_topics()

Co-authored-by: Jan Hanca <jan.hanca@robotec.ai>
Signed-off-by: Mateusz Wasilewski <mateuszwasilewski12@gmail.com>
Copy link
Contributor

@pijaro pijaro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with a minor nitpick.

helper.open_level(level="Warehouse", directory='')
# Open the level called "DefaultLevel".
# We use a DefaultLevel level for a smoke test.
# ROS2 System Component should publish topics listed below regardless of level
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: ROS2SystemComponent if referring to the "ROS2" gem component, or ROS 2 system component if referring to ROS 2 as a general behavior.

@michalpelka michalpelka merged commit cc1a6e0 into o3de:development Feb 22, 2024
2 checks passed
adamkrawczyk pushed a commit to RobotecAI/o3de-extras that referenced this pull request Apr 10, 2024
* Add pip requirements for ROS2 Gem
* Change test level to DefaultLevel

---------

Signed-off-by: Mateusz Wasilewski <mateusz.wasilewski@robotec.ai>
Signed-off-by: Mateusz Wasilewski <mateuszwasilewski12@gmail.com>
Co-authored-by: Jan Hanca <jan.hanca@robotec.ai>
jhanca-robotecai added a commit to RobotecAI/o3de-extras that referenced this pull request Apr 24, 2024
* Add pip requirements for ROS2 Gem
* Change test level to DefaultLevel

---------

Signed-off-by: Mateusz Wasilewski <mateusz.wasilewski@robotec.ai>
Signed-off-by: Mateusz Wasilewski <mateuszwasilewski12@gmail.com>
Co-authored-by: Jan Hanca <jan.hanca@robotec.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Python tests do not work anymore. Issue with missing typeguard and pyYaml in bundled python.
4 participants