Skip to content

Commit

Permalink
Activate assertExitCodes for missing tests (#720) (#724)
Browse files Browse the repository at this point in the history
(cherry picked from commit 78d6c0f)

Co-authored-by: Christoph Fröhlich <[email protected]>
  • Loading branch information
mergify[bot] and christophfroehlich authored Feb 26, 2025
1 parent 6d60442 commit be6d81f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 17 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 ros2_control_demo_testing.test_utils import check_controllers_running

Expand Down Expand Up @@ -98,11 +98,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 ros2_control_demo_testing.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 @@ -97,7 +97,7 @@ def test_check_if_msgs_published(self):


# 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
# see https://github.com/ros-controls/ros2_control_demos/issues/721
# @launch_testing.post_shutdown_test()
# # These tests are run after the processes in generate_test_description() have shutdown.
# class TestDescriptionCraneShutdown(unittest.TestCase):
Expand Down

0 comments on commit be6d81f

Please sign in to comment.