Skip to content

Commit

Permalink
Activate assertExitCodes for 3 missing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
christophfroehlich committed Feb 25, 2025
1 parent 41a1982 commit 271d0ae
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 25 deletions.
15 changes: 7 additions & 8 deletions example_1/test/test_rrbot_launch_cli_direct.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch_testing.actions import ReadyToTest

# import launch_testing.markers
import launch_testing.markers
import rclpy
from controller_manager.test_utils import check_controllers_running

Expand Down Expand Up @@ -109,11 +109,10 @@ def test_main(self, proc_output):
check_controllers_running(self.node, [cname], state="active")


# TODO(anyone): enable this if shutdown of ros2_control_node does not fail anymore
# @launch_testing.post_shutdown_test()
# # These tests are run after the processes in generate_test_description() have shutdown.
# class TestDescriptionCraneShutdown(unittest.TestCase):
@launch_testing.post_shutdown_test()
# These tests are run after the processes in generate_test_description() have shutdown.
class TestDescriptionCraneShutdown(unittest.TestCase):

# def test_exit_codes(self, proc_info):
# """Check if the processes exited normally."""
# launch_testing.asserts.assertExitCodes(proc_info)
def test_exit_codes(self, proc_info):
"""Check if the processes exited normally."""
launch_testing.asserts.assertExitCodes(proc_info)
15 changes: 7 additions & 8 deletions example_11/test/test_carlikebot_launch_remapped.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
from launch_testing.actions import ReadyToTest
from launch_testing_ros import WaitForTopics

# import launch_testing.markers
import launch_testing.markers
import rclpy
from controller_manager.test_utils import (
check_controllers_running,
Expand Down Expand Up @@ -110,11 +110,10 @@ def test_remapped_topic(self):
wait_for_topics.shutdown()


# TODO(anyone): enable this if shutdown of ros2_control_node does not fail anymore
# @launch_testing.post_shutdown_test()
# # These tests are run after the processes in generate_test_description() have shutdown.
# class TestDescriptionCraneShutdown(unittest.TestCase):
@launch_testing.post_shutdown_test()
# These tests are run after the processes in generate_test_description() have shutdown.
class TestDescriptionCraneShutdown(unittest.TestCase):

# def test_exit_codes(self, proc_info):
# """Check if the processes exited normally."""
# launch_testing.asserts.assertExitCodes(proc_info)
def test_exit_codes(self, proc_info):
"""Check if the processes exited normally."""
launch_testing.asserts.assertExitCodes(proc_info)
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch_testing.actions import ReadyToTest

# import launch_testing.markers
import launch_testing.markers
import rclpy
from controller_manager.test_utils import (
check_controllers_running,
Expand Down Expand Up @@ -96,12 +96,10 @@ def test_check_if_msgs_published(self):
check_if_js_published("/joint_states", ["joint1", "joint2"])


# TODO(anyone): enable this if shutdown of ros2_control_node does not fail anymore
# see https://github.com/ros-controls/ros2_control_demos/issues/542
# @launch_testing.post_shutdown_test()
# # These tests are run after the processes in generate_test_description() have shutdown.
# class TestDescriptionCraneShutdown(unittest.TestCase):
@launch_testing.post_shutdown_test()
# These tests are run after the processes in generate_test_description() have shutdown.
class TestDescriptionCraneShutdown(unittest.TestCase):

# def test_exit_codes(self, proc_info):
# """Check if the processes exited normally."""
# launch_testing.asserts.assertExitCodes(proc_info)
def test_exit_codes(self, proc_info):
"""Check if the processes exited normally."""
launch_testing.asserts.assertExitCodes(proc_info)

0 comments on commit 271d0ae

Please sign in to comment.