Skip to content

Commit 2d283be

Browse files
authored
Use EnableRmwIsolation in launch tests (#724)
* Revert "Set envars to run tests with rmw_zenoh_cpp with multicast discovery" This reverts commit 88828e9. Signed-off-by: Scott K Logan <logans@cottsay.net> * Use EnableRmwIsolation in launch tests Signed-off-by: Scott K Logan <logans@cottsay.net> --------- Signed-off-by: Scott K Logan <logans@cottsay.net>
1 parent 3978592 commit 2d283be

File tree

14 files changed

+37
-56
lines changed

14 files changed

+37
-56
lines changed

composition/CMakeLists.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,6 @@ if(BUILD_TESTING)
165165
set(EXPECTED_OUTPUT_SRV "${CMAKE_CURRENT_SOURCE_DIR}/test/composition_srv")
166166

167167
set(rmw_implementation_env_var RMW_IMPLEMENTATION=${rmw_implementation})
168-
# If the rmw_implementation is rmw_zenoh_cpp, run the tests with multicast discovery enabled.
169-
# Note: This is a temporary change that will be reverted before we branch into Kilted.
170-
if(rmw_implementation STREQUAL "rmw_zenoh_cpp")
171-
list(APPEND rmw_implementation_env_var
172-
ZENOH_CONFIG_OVERRIDE=scouting/multicast/enabled=true
173-
)
174-
endif()
175168

176169
set(test_names
177170
"test_dlopen_composition"

composition/test/test_manual_composition.py.in

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,13 @@ import launch_testing
2121
import launch_testing.actions
2222
import launch_testing.asserts
2323
import launch_testing_ros
24+
from launch_testing_ros.actions import EnableRmwIsolation
2425

2526

2627
def generate_test_description():
27-
launch_description = LaunchDescription()
28+
launch_description = LaunchDescription([
29+
EnableRmwIsolation(),
30+
])
2831
process_under_test = ExecuteProcess(
2932
cmd=['@MANUAL_COMPOSITION_EXECUTABLE@'],
3033
name='test_manual_composition',

demo_nodes_cpp/CMakeLists.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -249,13 +249,6 @@ if(BUILD_TESTING)
249249
)
250250

251251
set(rmw_implementation_env_var RMW_IMPLEMENTATION=${rmw_implementation})
252-
# If the rmw_implementation is rmw_zenoh_cpp, run the tests with multicast discovery enabled.
253-
# Note: This is a temporary change that will be reverted before we branch into Kilted.
254-
if(rmw_implementation STREQUAL "rmw_zenoh_cpp")
255-
list(APPEND rmw_implementation_env_var
256-
ZENOH_CONFIG_OVERRIDE=scouting/multicast/enabled=true
257-
)
258-
endif()
259252

260253
add_launch_test(
261254
"${CMAKE_CURRENT_BINARY_DIR}/test_${exe_list_underscore}${target_suffix}_$<CONFIG>.py"

demo_nodes_cpp/test/test_executables_tutorial.py.in

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,18 @@ import launch_testing.actions
1414
import launch_testing.asserts
1515
import launch_testing.util
1616
import launch_testing_ros
17+
from launch_testing_ros.actions import EnableRmwIsolation
1718

1819

1920
def generate_test_description():
20-
env = os.environ.copy()
2121
# bare minimum formatting for console output matching
22-
env['RCUTILS_CONSOLE_OUTPUT_FORMAT'] = '{message}'
22+
additional_env = {
23+
'RCUTILS_CONSOLE_OUTPUT_FORMAT': '{message}',
24+
}
2325

24-
launch_description = LaunchDescription()
26+
launch_description = LaunchDescription([
27+
EnableRmwIsolation(),
28+
])
2529

2630
processes_under_test = []
2731
exes_and_params = '@DEMO_NODES_CPP_EXECUTABLE@'.split(';')
@@ -39,7 +43,7 @@ def generate_test_description():
3943
cmd=cmd,
4044
name='test_executable_' + str(i),
4145
output='screen',
42-
env=env,
46+
additional_env=additional_env,
4347
)
4448
)
4549

image_tools/CMakeLists.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,6 @@ if(BUILD_TESTING)
8282
)
8383

8484
set(rmw_implementation_env_var RMW_IMPLEMENTATION=${rmw_implementation})
85-
# If the rmw_implementation is rmw_zenoh_cpp, run the tests with multicast discovery enabled.
86-
# Note: This is a temporary change that will be reverted before we branch into Kilted.
87-
if(rmw_implementation STREQUAL "rmw_zenoh_cpp")
88-
list(APPEND rmw_implementation_env_var
89-
ZENOH_CONFIG_OVERRIDE=scouting/multicast/enabled=true
90-
)
91-
endif()
9285

9386
add_launch_test(
9487
"${CMAKE_CURRENT_BINARY_DIR}/test_showimage_cam2image${target_suffix}_$<CONFIG>.py"

image_tools/test/test_executables_demo.py.in

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,13 @@ import launch_testing
2424
import launch_testing.actions
2525
import launch_testing.asserts
2626
import launch_testing_ros
27+
from launch_testing_ros.actions import EnableRmwIsolation
2728

2829

2930
def generate_test_description():
30-
launch_description = LaunchDescription()
31+
launch_description = LaunchDescription([
32+
EnableRmwIsolation(),
33+
])
3134
publisher_node_parameters = {
3235
'reliability': 'reliable',
3336
'show_camera': False,

intra_process_demo/CMakeLists.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,6 @@ if(BUILD_TESTING)
145145
)
146146

147147
set(rmw_implementation_env_var RMW_IMPLEMENTATION=${rmw_implementation})
148-
# If the rmw_implementation is rmw_zenoh_cpp, run the tests with multicast discovery enabled.
149-
# Note: This is a temporary change that will be reverted before we branch into Kilted.
150-
if(rmw_implementation STREQUAL "rmw_zenoh_cpp")
151-
list(APPEND rmw_implementation_env_var
152-
ZENOH_CONFIG_OVERRIDE=scouting/multicast/enabled=true
153-
)
154-
endif()
155148

156149
add_launch_test(
157150
"${CMAKE_CURRENT_BINARY_DIR}/test_${exe_list_underscore}${target_suffix}_$<CONFIG>.py"

intra_process_demo/package.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
<test_depend>ament_lint_common</test_depend>
3030
<test_depend>launch</test_depend>
3131
<test_depend>launch_testing</test_depend>
32+
<test_depend>launch_testing_ros</test_depend>
3233
<test_depend>launch_testing_ament_cmake</test_depend>
3334
<test_depend>rmw_implementation_cmake</test_depend>
3435

intra_process_demo/test/test_executables_demo.py.in

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@ from launch.actions import ExecuteProcess
99
import launch_testing
1010
import launch_testing.actions
1111
import launch_testing.asserts
12+
from launch_testing_ros.actions import EnableRmwIsolation
1213

1314

1415
def generate_test_description():
15-
launch_description = LaunchDescription()
16+
launch_description = LaunchDescription([
17+
EnableRmwIsolation(),
18+
])
1619
processes_under_test = [
1720
ExecuteProcess(
1821
cmd=[executable, 'test_executable'],

logging_demo/CMakeLists.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,6 @@ if(BUILD_TESTING)
9393
)
9494

9595
set(rmw_implementation_env_var RMW_IMPLEMENTATION=${rmw_implementation})
96-
# If the rmw_implementation is rmw_zenoh_cpp, run the tests with multicast discovery enabled.
97-
# Note: This is a temporary change that will be reverted before we branch into Kilted.
98-
if(rmw_implementation STREQUAL "rmw_zenoh_cpp")
99-
list(APPEND rmw_implementation_env_var
100-
ZENOH_CONFIG_OVERRIDE=scouting/multicast/enabled=true
101-
)
102-
endif()
10396

10497
add_launch_test(
10598
"${CMAKE_CURRENT_BINARY_DIR}/test_logging_demo${target_suffix}_$<CONFIG>.py"

0 commit comments

Comments
 (0)