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

Don't use launch_testing features that will be deprecated #222

Merged
merged 1 commit into from
Oct 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions test/test_services_across_dynamic_bridge.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ from launch.actions import ExecuteProcess
from launch.actions import OpaqueFunction

import launch_testing
import launch_testing.actions


TEST_BRIDGE_ROS1_ENV = '@TEST_BRIDGE_ROS1_ENV@'
Expand All @@ -38,7 +39,7 @@ TEST_BRIDGE_ROS2_SERVER = '@TEST_BRIDGE_ROS2_SERVER@'
[TEST_BRIDGE_ROS2_SERVER],
[TEST_BRIDGE_ROS1_ENV, TEST_BRIDGE_ROS1_CLIENT]),
])
def generate_test_description(test_name, server_cmd, client_cmd, ready_fn):
def generate_test_description(test_name, server_cmd, client_cmd):
launch_description = LaunchDescription()

# ROS 1 core
Expand All @@ -65,15 +66,17 @@ def generate_test_description(test_name, server_cmd, client_cmd, ready_fn):
launch_description.add_action(client_process)

launch_description.add_action(
OpaqueFunction(function=lambda context: ready_fn())
launch_testing.actions.ReadyToTest()
)
return launch_description, locals()


class TestServicesAcrossDynamicBridge(unittest.TestCase):
def test_client_process_terminates_after_a_finite_amount_of_time(self, client_process):
def test_client_process_terminates_after_a_finite_amount_of_time(self,
client_process,
proc_info):
"""Test that the client executables terminates after a finite amount of time."""
self.proc_info.assertWaitForShutdown(process=client_process, timeout=30)
proc_info.assertWaitForShutdown(process=client_process, timeout=30)


@launch_testing.post_shutdown_test()
Expand Down
5 changes: 3 additions & 2 deletions test/test_topics_across_dynamic_bridge.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ from launch.actions import ExecuteProcess
from launch.actions import OpaqueFunction

import launch_testing
import launch_testing.actions
import launch_testing_ros

from ros2run.api import get_executable_path
Expand All @@ -47,7 +48,7 @@ TEST_BRIDGE_RMW = '@TEST_BRIDGE_RMW@'
[TEST_BRIDGE_ROS2_TALKER],
[TEST_BRIDGE_ROS1_ENV] + TEST_BRIDGE_ROS1_LISTENER),
])
def generate_test_description(test_name, talker_cmd, listener_cmd, ready_fn):
def generate_test_description(test_name, talker_cmd, listener_cmd):
launch_description = LaunchDescription()

# ROS 1 core
Expand Down Expand Up @@ -76,7 +77,7 @@ def generate_test_description(test_name, talker_cmd, listener_cmd, ready_fn):
launch_description.add_action(listener_process)

launch_description.add_action(
OpaqueFunction(function=lambda context: ready_fn())
launch_testing.actions.ReadyToTest()
)
return launch_description, locals()

Expand Down