Skip to content

Commit

Permalink
Replace ready_fn with ReadyToTest action (#404)
Browse files Browse the repository at this point in the history
Signed-off-by: Pete Baughman <pete.baughman@apex.ai>
  • Loading branch information
pbaughman authored and sloretz committed Oct 21, 2019
1 parent a92aeb2 commit bf679d7
Show file tree
Hide file tree
Showing 14 changed files with 42 additions and 41 deletions.
6 changes: 3 additions & 3 deletions composition/test/test_api_pubsub_composition.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ import unittest

from launch import LaunchDescription
from launch.actions import ExecuteProcess
from launch.actions import OpaqueFunction

import launch_testing
import launch_testing.actions
import launch_testing.asserts
import launch_testing_ros


def generate_test_description(ready_fn):
def generate_test_description():
launch_description = LaunchDescription()
process_under_test = ExecuteProcess(
cmd=['@API_COMPOSITION_EXECUTABLE@'],
Expand All @@ -50,7 +50,7 @@ def generate_test_description(ready_fn):
)
)
launch_description.add_action(
OpaqueFunction(function=lambda context: ready_fn())
launch_testing.actions.ReadyToTest()
)
return launch_description, locals()

Expand Down
6 changes: 3 additions & 3 deletions composition/test/test_api_srv_composition.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ import unittest

from launch import LaunchDescription
from launch.actions import ExecuteProcess
from launch.actions import OpaqueFunction

import launch_testing
import launch_testing.actions
import launch_testing.asserts
import launch_testing_ros


def generate_test_description(ready_fn):
def generate_test_description():
launch_description = LaunchDescription()
process_under_test = ExecuteProcess(
cmd=['@API_COMPOSITION_EXECUTABLE@'],
Expand All @@ -50,7 +50,7 @@ def generate_test_description(ready_fn):
)
)
launch_description.add_action(
OpaqueFunction(function=lambda context: ready_fn())
launch_testing.actions.ReadyToTest()
)
return launch_description, locals()

Expand Down
6 changes: 3 additions & 3 deletions composition/test/test_api_srv_composition_client_first.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ import unittest

from launch import LaunchDescription
from launch.actions import ExecuteProcess
from launch.actions import OpaqueFunction

import launch_testing
import launch_testing.actions
import launch_testing.asserts
import launch_testing_ros


def generate_test_description(ready_fn):
def generate_test_description():
launch_description = LaunchDescription()
process_under_test = ExecuteProcess(
cmd=['@API_COMPOSITION_EXECUTABLE@'],
Expand Down Expand Up @@ -51,7 +51,7 @@ def generate_test_description(ready_fn):
)
)
launch_description.add_action(
OpaqueFunction(function=lambda context: ready_fn())
launch_testing.actions.ReadyToTest()
)
return launch_description, locals()

Expand Down
6 changes: 3 additions & 3 deletions composition/test/test_dlopen_composition.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ import unittest

from launch import LaunchDescription
from launch.actions import ExecuteProcess
from launch.actions import OpaqueFunction

import launch_testing
import launch_testing.actions
import launch_testing.asserts
import launch_testing_ros


def generate_test_description(ready_fn):
def generate_test_description():
launch_description = LaunchDescription()
process_under_test = ExecuteProcess(
cmd=[
Expand All @@ -38,7 +38,7 @@ def generate_test_description(ready_fn):
)
launch_description.add_action(process_under_test)
launch_description.add_action(
OpaqueFunction(function=lambda context: ready_fn())
launch_testing.actions.ReadyToTest()
)
return launch_description, locals()

Expand Down
6 changes: 3 additions & 3 deletions composition/test/test_linktime_composition.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ from unittest.case import SkipTest

from launch import LaunchDescription
from launch.actions import ExecuteProcess
from launch.actions import OpaqueFunction

import launch_testing
import launch_testing.actions
import launch_testing.asserts
import launch_testing_ros


def generate_test_description(ready_fn):
def generate_test_description():
launch_description = LaunchDescription()
process_under_test = ExecuteProcess(
cmd=['@LINKTIME_COMPOSITION_EXECUTABLE@'],
Expand All @@ -35,7 +35,7 @@ def generate_test_description(ready_fn):
)
launch_description.add_action(process_under_test)
launch_description.add_action(
OpaqueFunction(function=lambda context: ready_fn())
launch_testing.actions.ReadyToTest()
)
return launch_description, locals()

Expand Down
6 changes: 3 additions & 3 deletions composition/test/test_manual_composition.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ import unittest

from launch import LaunchDescription
from launch.actions import ExecuteProcess
from launch.actions import OpaqueFunction

import launch_testing
import launch_testing.actions
import launch_testing.asserts
import launch_testing_ros


def generate_test_description(ready_fn):
def generate_test_description():
launch_description = LaunchDescription()
process_under_test = ExecuteProcess(
cmd=['@MANUAL_COMPOSITION_EXECUTABLE@'],
Expand All @@ -32,7 +32,7 @@ def generate_test_description(ready_fn):
)
launch_description.add_action(process_under_test)
launch_description.add_action(
OpaqueFunction(function=lambda context: ready_fn())
launch_testing.actions.ReadyToTest()
)
return launch_description, locals()

Expand Down
6 changes: 3 additions & 3 deletions demo_nodes_cpp/test/test_executables_tutorial.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ import unittest

from launch import LaunchDescription
from launch.actions import ExecuteProcess
from launch.actions import OpaqueFunction

import launch_testing
import launch_testing.actions
import launch_testing.asserts
import launch_testing.util
import launch_testing_ros


def generate_test_description(ready_fn):
def generate_test_description():
os.environ['OSPL_VERBOSITY'] = '8' # 8 = OS_NONE
# bare minimum formatting for console output matching
os.environ['RCUTILS_CONSOLE_OUTPUT_FORMAT'] = '{message}'
Expand All @@ -29,7 +29,7 @@ def generate_test_description(ready_fn):
launch_description.add_action(process)
launch_description.add_action(launch_testing.util.KeepAliveProc())
launch_description.add_action(
OpaqueFunction(function=lambda context: ready_fn())
launch_testing.actions.ReadyToTest()
)
return launch_description, locals()

Expand Down
6 changes: 3 additions & 3 deletions demo_nodes_cpp_native/test/test_executables_tutorial.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import unittest

from launch import LaunchDescription
from launch.actions import ExecuteProcess
from launch.actions import OpaqueFunction

import launch_testing
import launch_testing.actions
import launch_testing.asserts
import launch_testing_ros


def generate_test_description(ready_fn):
def generate_test_description():
launch_description = LaunchDescription()
processes_under_test = [
ExecuteProcess(cmd=[executable], name='test_executable_' + str(i), output='screen')
Expand All @@ -21,7 +21,7 @@ def generate_test_description(ready_fn):
for process in processes_under_test:
launch_description.add_action(process)
launch_description.add_action(
OpaqueFunction(function=lambda context: ready_fn())
launch_testing.actions.ReadyToTest()
)
return launch_description, locals()

Expand Down
6 changes: 3 additions & 3 deletions image_tools/test/test_executables_demo.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ import unittest

from launch import LaunchDescription
from launch.actions import ExecuteProcess
from launch.actions import OpaqueFunction
from launch.actions import SetEnvironmentVariable
from launch_ros.actions import Node

import launch_testing
import launch_testing.actions
import launch_testing.asserts
import launch_testing_ros


def generate_test_description(ready_fn):
def generate_test_description():
launch_description = LaunchDescription()
publisher_node_parameters = {
'reliability': 'reliable',
Expand Down Expand Up @@ -74,7 +74,7 @@ def generate_test_description(ready_fn):
launch_description.add_action(cam2image_node)

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

return launch_description, locals()
Expand Down
6 changes: 3 additions & 3 deletions intra_process_demo/test/test_executables_demo.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import unittest

from launch import LaunchDescription
from launch.actions import ExecuteProcess
from launch.actions import OpaqueFunction

import launch_testing
import launch_testing.actions
import launch_testing.asserts


def generate_test_description(ready_fn):
def generate_test_description():
launch_description = LaunchDescription()
processes_under_test = [
ExecuteProcess(
Expand All @@ -23,7 +23,7 @@ def generate_test_description(ready_fn):
for process in processes_under_test:
launch_description.add_action(process)
launch_description.add_action(
OpaqueFunction(function=lambda context: ready_fn())
launch_testing.actions.ReadyToTest()
)
return launch_description, locals()

Expand Down
5 changes: 3 additions & 2 deletions lifecycle/test/test_lifecycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@
import launch_ros.events.lifecycle

import launch_testing
import launch_testing.actions
import launch_testing.asserts

import lifecycle_msgs.msg


def generate_test_description(ready_fn):
def generate_test_description():
talker_node = launch_ros.actions.LifecycleNode(
package='lifecycle', node_executable='lifecycle_talker',
node_name='lc_talker', output='screen'
Expand Down Expand Up @@ -110,7 +111,7 @@ def generate_test_description(ready_fn):
],
)
),
launch.actions.OpaqueFunction(function=lambda context: ready_fn()),
launch_testing.actions.ReadyToTest()
]), locals()


Expand Down
6 changes: 3 additions & 3 deletions logging_demo/test/test_logging_demo.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ import unittest

from launch import LaunchDescription
from launch.actions import ExecuteProcess
from launch.actions import OpaqueFunction

import launch_testing
import launch_testing.actions
import launch_testing.asserts
import launch_testing_ros


def generate_test_description(ready_fn):
def generate_test_description():
launch_description = LaunchDescription()
process_under_test = ExecuteProcess(
cmd=['@LOGGING_DEMO_MAIN_EXECUTABLE@'],
Expand All @@ -32,7 +32,7 @@ def generate_test_description(ready_fn):
)
launch_description.add_action(process_under_test)
launch_description.add_action(
OpaqueFunction(function=lambda context: ready_fn())
launch_testing.actions.ReadyToTest()
)
return launch_description, locals()

Expand Down
6 changes: 3 additions & 3 deletions pendulum_control/test/test_pendulum_demo.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import unittest

from launch import LaunchDescription
from launch.actions import ExecuteProcess
from launch.actions import OpaqueFunction

import launch_testing
import launch_testing.actions
import launch_testing.asserts
import launch_testing_ros


def generate_test_description(ready_fn):
def generate_test_description():
os.environ['OSPL_VERBOSITY'] = '8' # 8 = OS_NONE
# bare minimum formatting for console output matching
os.environ['RCUTILS_CONSOLE_OUTPUT_FORMAT'] = '{message}'
Expand All @@ -39,7 +39,7 @@ def generate_test_description(ready_fn):
launch_description.add_action(pendulum_demo_process)

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

Expand Down
6 changes: 3 additions & 3 deletions pendulum_control/test/test_pendulum_teleop.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import unittest

from launch import LaunchDescription
from launch.actions import ExecuteProcess
from launch.actions import OpaqueFunction

import launch_testing
import launch_testing.actions
import launch_testing.asserts
import launch_testing_ros


def generate_test_description(ready_fn):
def generate_test_description():
os.environ['OSPL_VERBOSITY'] = '8' # 8 = OS_NONE
# bare minimum formatting for console output matching
os.environ['RCUTILS_CONSOLE_OUTPUT_FORMAT'] = '{message}'
Expand Down Expand Up @@ -43,7 +43,7 @@ def generate_test_description(ready_fn):
launch_description.add_action(pendulum_teleop_process)

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

Expand Down

0 comments on commit bf679d7

Please sign in to comment.