Package Summary

Version 1.0.15
License Apache License 2.0
Build type AMENT_PYTHON
Use RECOMMENDED

Repository Summary

Description
Checkout URI https://github.com/ros2/launch.git
VCS Type git
VCS Version humble
Last Updated 2026-10-13
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

A package to create tests which involve launch files and multiple processes.

Maintainers

  • Aditya Pande
  • Michel Hidalgo

Authors

  • Dirk Thomas
  • Esteve Fernandez
  • Pete Baughman
  • William Woodall

launch_testing

This tool is a framework for launch integration testing. For example:

  • The exit codes of all processes are available to the tests.
  • Tests can check that all processes shut down normally, or with specific exit codes.
  • Tests can fail when a process dies unexpectedly.
  • The stdout and stderr of all processes are available to the tests.
  • The command-line used to launch the processes are available to the tests.
  • Some tests run concurrently with the launch and can interact with the running processes.

Quick start example

Start with the launch_testing example good_proc_launch_test.py.

Run the example by doing:

launch_test test/launch_testing/examples/good_proc_launch_test.py

launch_test will launch the nodes found in the generate_test_description function, run the tests from the TestGoodProcess class, shut down the launched nodes, and then run the tests from the TestProcessOutput class.

The Launch Description

def generate_test_description():

    return launch.LaunchDescription([
        launch.actions.ExecuteProcess(
            cmd=[path_to_process],
        ),

        # Start tests right away - no need to wait for anything in this example.
        # In a more complicated launch description, we might want this action happen
        # once some process starts or once some other event happens
        launch_testing.actions.ReadyToTest()
    ])

The generate_test_description function should return a launch.LaunchDescription object that launches the system to be tested.

The launch description needs to include a ReadyToTest action to signal to the test framework that it’s safe to start the active tests.

In the above example, there is no need to delay the start of the tests so the ReadyToTest action is a peer to the process under test and will signal to the framework that it’s safe to start around the same time the ExecuteProcess action is run.

Active Tests

Any classes that inherit from unittest.TestCase and not decorated with the post_shutdown_test descriptor will be run concurrently with the process under test. These tests are expected to interact with the running processes in some way.

Post-Shutdown Tests

Any classes that inherit from unittest.TestCase that are decorated with the post_shutdown_test descriptor will be run after the launched processes have been shut down. These tests have access to the exit codes and the stdout of all of the launched processes, as well as any data created as a side-effect of running the processes.

Exit Codes and Standard Out

The launch_testing framework automatically adds some member fields to each test case so that the tests can access process output and exit codes.

These objects provide dictionary like access to information about the running processes. They also contain methods that the active tests can use to wait for a process to exit or to wait for specific output.

Assertions

The launch_testing framework automatically records all stdout from the launched processes as well as the exit codes from any processes that are launched. This information is made available to the tests via the proc_info and proc_output object. These objects can be used by one of several assert methods to check the output or exit codes of the process:

launch_testing.asserts.assertInStdout(proc_output, msg, process, cmd_args=None, *, strict_proc_matching=True)

Asserts that a message is found in the stdout of a particular process.

  • msg:

    The text to look for in the process standard out

  • process:

    Either the process name as a string, or a launch.actions.ExecuteProcess object that was used to start the process. Pass None or an empty string to search all processes.

  • cmd_args:

    When looking up processes by process by name, cmd_args can be used to disambiguate multiple processes with the same name.

  • strict_proc_matching:

    When looking up a process by name, strict_proc_matching=True will make it an error to match multiple processes. This prevents an assert from accidentally passing if the output came from a different process than the one the user was expecting.

launch_testing.asserts.assertExitCodes(proc_info, allowable_exit_codes=[EXIT_OK], process, cmd_args=None, *, strict_proc_matching=True)

Asserts that the specified processes exited with a particular exit code.

  • allowable_exit_codes:

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package launch_testing

1.0.15 (2026-09-06)

  • Correct typos (backport #961) (#964)
  • Contributors: mergify[bot]

1.0.14 (2026-01-12)

  • Fixed typos (backport #692) (#693)
  • Contributors: mergify[bot]

1.0.13 (2025-11-07)

1.0.12 (2025-10-17)

1.0.11 (2025-10-06)

1.0.10 (2025-07-16)

1.0.9 (2025-06-06)

1.0.8 (2025-03-25)

1.0.7 (2024-11-25)

1.0.6 (2024-05-17)

  • Add consider_namespace_packages=False (#766) (#777)
  • Contributors: mergify[bot]

1.0.5 (2024-02-16)

1.0.4 (2023-01-10)

  • Allow ReadyToTest() usage in event handler (#681)
  • Inherit markers from generate_test_description (#670) (#674)
  • Contributors: Nikolai Morin, mergify[bot]

1.0.3 (2022-10-18)

  • Fix Typo (#641) (#644)
  • Switch to using a comprehension for process_names. (#614) (#615)
  • Contributors: mergify[bot]

1.0.2 (2022-05-10)

1.0.1 (2022-04-13)

1.0.0 (2022-04-12)

  • Removed the deprecated [ready_fn]{.title-ref} feature (#589)
  • Contributors: William Woodall

0.23.1 (2022-04-08)

0.23.0 (2022-03-30)

0.22.0 (2022-03-28)

0.21.1 (2022-03-01)

  • Added case for instances of ExecuteLocal in resolveProcess function (#587)
  • Add compatitibility with pytest 7 (#592)
  • Contributors: Matt Lanting, Shane Loretz

0.21.0 (2022-01-14)

  • Renamed three files from example_processes (#573)
  • Fix launch_testing README.md proc keyword to process. (#554) (#560)
  • Contributors: Jacob Perron, Khush Jain

0.20.0 (2021-11-29)

  • Declare frontend group dependency & use explicit dependencies in launch_testing (#520)
  • Update maintainers to Aditya Pande and Michel Hidalgo (#559)
  • Updated maintainers (#555)
  • First prototype of native pytest plugin for launch based tests (#528)

File truncated at 100 lines see the full file

Dependant Packages

Name Deps
async_web_server_cpp
beluga_example
diagnostic_updater
flexbe_core
flexbe_onboard
flexbe_testing
fmi_adapter
gps_tools
gpsd_client
stereo_image_proc
joint_state_publisher
swri_transform_util
moveit_task_constructor_capabilities
moveit_task_constructor_visualization
mrpt_navigation
mrpt_trajectory_follower
novatel_oem7_driver
realsense2_camera
robot_calibration
slam_toolbox
joy_teleop
twist_mux
composition
demo_nodes_cpp
demo_nodes_cpp_native
image_tools
intra_process_demo
logging_demo
pendulum_control
quality_of_service_demo_cpp
dolly_tests
domain_bridge
dynamixel_hardware
launch_testing_examples
generate_parameter_library_example
generate_parameter_library_example_external
kobuki_velocity_smoother
launch_pytest
launch_testing_ament_cmake
test_launch_testing
launch_testing_ros
nav2_amcl
nav2_bringup
nav2_core
nav2_costmap_2d
nav2_map_server
nav2_route
nav2_system_tests
ament_nodl
rcl
rcl_logging_noop
rclc
rclcpp_components
rcutils
ros1_bridge
controller_manager
rqt_controller_manager
rqt_joint_trajectory_controller
plansys2_bringup
ros2action
ros2doctor
ros2interface
ros2lifecycle
ros2node
ros2param
ros2pkg
ros2service
ros2topic
ros2launch_security_examples
ros_gz_bridge
test_ros_gz_bridge
ros2test
ros_testing
ros2bag
test_cli_remapping
test_communication
test_rclcpp
test_security
topic_based_ros2_control
ros_core
webots_ros2_tests
autoware_default_adapi
mujoco_ros2_control_tests
ros2ai
adi_iio
automatika_ros_sugar
rosgraph_monitor_test
greenwave_monitor
mola_state_estimation_smoother
network_bridge
play_motion2_cli
soar_ros
ros2_medkit_integration_tests
ros2_medkit_graph_watchdog
jig_example
roadmap_explorer
kuka_gazebo
mapoi_server
franka_bringup
franka_fr3_moveit_config
franka_gripper
franka_spine_server
stcamera_components
stcamera_grabber
stcamera_launch

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged launch_testing at Robotics Stack Exchange

Package Summary

Version 3.4.12
License Apache License 2.0
Build type AMENT_PYTHON
Use RECOMMENDED

Repository Summary

Description
Checkout URI https://github.com/ros2/launch.git
VCS Type git
VCS Version jazzy
Last Updated 2026-10-13
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

A package to create tests which involve launch files and multiple processes.

Maintainers

  • Aditya Pande
  • Brandon Ong
  • William Woodall

Authors

  • Dirk Thomas
  • Esteve Fernandez
  • Michel Hidalgo
  • Pete Baughman
  • William Woodall

launch_testing

This tool is a framework for launch integration testing. For example:

  • The exit codes of all processes are available to the tests.
  • Tests can check that all processes shut down normally, or with specific exit codes.
  • Tests can fail when a process dies unexpectedly.
  • The stdout and stderr of all processes are available to the tests.
  • The command-line used to launch the processes are available to the tests.
  • Some tests run concurrently with the launch and can interact with the running processes.

Quick start example

Start with the launch_testing example good_proc_launch_test.py.

Run the example by doing:

launch_test test/launch_testing/examples/good_proc_launch_test.py

launch_test will launch the nodes found in the generate_test_description function, run the tests from the TestGoodProcess class, shut down the launched nodes, and then run the tests from the TestProcessOutput class.

The Launch Description

def generate_test_description():

    return launch.LaunchDescription([
        launch.actions.ExecuteProcess(
            cmd=[path_to_process],
        ),

        # Start tests right away - no need to wait for anything in this example.
        # In a more complicated launch description, we might want this action happen
        # once some process starts or once some other event happens
        launch_testing.actions.ReadyToTest()
    ])

The generate_test_description function should return a launch.LaunchDescription object that launches the system to be tested.

The launch description needs to include a ReadyToTest action to signal to the test framework that it’s safe to start the active tests.

In the above example, there is no need to delay the start of the tests so the ReadyToTest action is a peer to the process under test and will signal to the framework that it’s safe to start around the same time the ExecuteProcess action is run.

Active Tests

Any classes that inherit from unittest.TestCase and not decorated with the post_shutdown_test descriptor will be run concurrently with the process under test. These tests are expected to interact with the running processes in some way.

Post-Shutdown Tests

Any classes that inherit from unittest.TestCase that are decorated with the post_shutdown_test descriptor will be run after the launched processes have been shut down. These tests have access to the exit codes and the stdout of all of the launched processes, as well as any data created as a side-effect of running the processes.

Exit Codes and Standard Out

The launch_testing framework automatically adds some member fields to each test case so that the tests can access process output and exit codes.

These objects provide dictionary like access to information about the running processes. They also contain methods that the active tests can use to wait for a process to exit or to wait for specific output.

Assertions

The launch_testing framework automatically records all stdout from the launched processes as well as the exit codes from any processes that are launched. This information is made available to the tests via the proc_info and proc_output object. These objects can be used by one of several assert methods to check the output or exit codes of the process:

launch_testing.asserts.assertInStdout(proc_output, msg, process, cmd_args=None, *, strict_proc_matching=True)

Asserts that a message is found in the stdout of a particular process.

  • msg:

    The text to look for in the process standard out

  • process:

    Either the process name as a string, or a launch.actions.ExecuteProcess object that was used to start the process. Pass None or an empty string to search all processes.

  • cmd_args:

    When looking up processes by process by name, cmd_args can be used to disambiguate multiple processes with the same name.

  • strict_proc_matching:

    When looking up a process by name, strict_proc_matching=True will make it an error to match multiple processes. This prevents an assert from accidentally passing if the output came from a different process than the one the user was expecting.

launch_testing.asserts.assertExitCodes(proc_info, allowable_exit_codes=[EXIT_OK], process, cmd_args=None, *, strict_proc_matching=True)

Asserts that the specified processes exited with a particular exit code.

  • allowable_exit_codes:

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package launch_testing

3.4.12 (2026-09-18)

  • Robust pytest_ignore_collect for multi-version Pytest compatibility (#974) (#1006)
  • Fix Pytest 8/9 compatibility and coroutine leaks in launch_pytest (#972) (#1008)
  • Contributors: Guilhem Saurel

3.4.11 (2026-06-02)

  • Correct typos (backport #961) (#963)

    * Correct typos (#961) (cherry picked from commit b51d67a0fb3c572a8255855ac73364ca53ed3691) Co-authored-by: Auguste Lalande <<auguste.lalande@gmail.com>> Co-authored-by: Alejandro Hernandez Cordero <<ahcorde@gmail.com>>

  • Contributors: mergify[bot]

3.4.10 (2026-01-12)

3.4.9 (2025-11-07)

3.4.8 (2025-10-17)

3.4.7 (2025-10-06)

3.4.6 (2025-08-06)

3.4.5 (2025-06-23)

3.4.4 (2025-04-02)

  • Merge pull request #834 from ros2/mergify/bp/jazzy/pr-833 Fix function params indentation (backport #833)
  • Fix function params indentation (#833) (cherry picked from commit 151b024a7cfac06f0d56798cbe87ab180b9ea3ab)
  • Contributors: Alejandro Hernández Cordero, Christophe Bedard

3.4.3 (2024-12-18)

3.4.2 (2024-04-16)

  • Fix a warning in modern unittest. (#773) Newer versions of unittest no longer store an errors list; instead, they store a result, which then stores an error list. Update the code here to be able to deal with either version.
  • Contributors: Chris Lalancette

3.4.1 (2024-03-28)

  • Add consider_namespace_packages=False (#766)
  • Contributors: Tony Najjar

3.4.0 (2024-02-07)

3.3.0 (2024-01-24)

3.2.1 (2023-12-26)

3.2.0 (2023-10-04)

  • to open expected outpout file with an encoding parameter (#717)
  • Contributors: Chen Lihui

3.1.0 (2023-09-08)

3.0.1 (2023-09-07)

3.0.0 (2023-08-21)

2.2.1 (2023-07-11)

2.2.0 (2023-06-07)

2.1.0 (2023-04-27)

2.0.1 (2023-04-12)

2.0.0 (2023-04-11)

  • Improve type checking (#679)
  • Contributors: Hervé Audren

1.4.1 (2023-02-24)

  • Fixed typos (#692)
  • Contributors: Alejandro Hernández Cordero

File truncated at 100 lines see the full file

Dependant Packages

Name Deps
async_web_server_cpp
beluga_example
diagnostic_updater
flexbe_core
flexbe_onboard
flexbe_testing
fmi_adapter
gps_tools
gpsd_client
stereo_image_proc
joint_state_publisher
swri_transform_util
moveit_task_constructor_capabilities
moveit_task_constructor_visualization
mrpt_navigation
mrpt_trajectory_follower
novatel_oem7_driver
pcl_ros
realsense2_camera
robot_calibration
slam_toolbox
joy_teleop
twist_mux
composition
demo_nodes_cpp
demo_nodes_cpp_native
image_tools
intra_process_demo
logging_demo
pendulum_control
quality_of_service_demo_cpp
dolly_tests
domain_bridge
dynamixel_hardware
launch_testing_examples
generate_parameter_library_example
generate_parameter_library_example_external
kobuki_velocity_smoother
launch_pytest
launch_testing_ament_cmake
test_launch_testing
launch_testing_ros
nav2_amcl
nav2_bringup
nav2_core
nav2_costmap_2d
nav2_map_server
nav2_route
nav2_system_tests
ament_nodl
rcl
rcl_logging_noop
rcl_logging_rcutils
rclc
rclcpp_components
rcutils
ros1_bridge
controller_manager
rqt_controller_manager
rqt_joint_trajectory_controller
plansys2_bringup
ros2action
ros2doctor
ros2interface
ros2lifecycle
ros2node
ros2param
ros2pkg
ros2service
ros2topic
ros2launch_security_examples
ros_gz_bridge
ros_gz_sim
test_ros_gz_bridge
ros2test
ros_testing
ros2bag
test_cli_remapping
test_communication
test_rclcpp
test_security
ros_core
webots_ros2_tests
autoware_default_adapi
mujoco_ros2_control_tests
ros2ai
rosbot_utils
adi_iio
automatika_ros_sugar
rosgraph_monitor_test
greenwave_monitor
mola_state_estimation_smoother
network_bridge
play_motion2_cli
soar_ros
joint_state_topic_hardware_interface
ros2_medkit_integration_tests
ros2_medkit_graph_watchdog
trimble_driver
jig_example
roadmap_explorer
kuka_gazebo
mapoi_server
pybullet_fleet_ros

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged launch_testing at Robotics Stack Exchange

Package Summary

Version 3.8.9
License Apache License 2.0
Build type AMENT_PYTHON
Use RECOMMENDED

Repository Summary

Description
Checkout URI https://github.com/ros2/launch.git
VCS Type git
VCS Version kilted
Last Updated 2026-10-13
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

A package to create tests which involve launch files and multiple processes.

Maintainers

  • Aditya Pande
  • Brandon Ong
  • William Woodall

Authors

  • Dirk Thomas
  • Esteve Fernandez
  • Michel Hidalgo
  • Pete Baughman
  • William Woodall

launch_testing

This tool is a framework for launch integration testing. For example:

  • The exit codes of all processes are available to the tests.
  • Tests can check that all processes shut down normally, or with specific exit codes.
  • Tests can fail when a process dies unexpectedly.
  • The stdout and stderr of all processes are available to the tests.
  • The command-line used to launch the processes are available to the tests.
  • Some tests run concurrently with the launch and can interact with the running processes.

Quick start example

Start with the launch_testing example good_proc_launch_test.py.

Run the example by doing:

launch_test test/launch_testing/examples/good_proc_launch_test.py

launch_test will launch the nodes found in the generate_test_description function, run the tests from the TestGoodProcess class, shut down the launched nodes, and then run the tests from the TestProcessOutput class.

The Launch Description

def generate_test_description():

    return launch.LaunchDescription([
        launch.actions.ExecuteProcess(
            cmd=[path_to_process],
        ),

        # Start tests right away - no need to wait for anything in this example.
        # In a more complicated launch description, we might want this action happen
        # once some process starts or once some other event happens
        launch_testing.actions.ReadyToTest()
    ])

The generate_test_description function should return a launch.LaunchDescription object that launches the system to be tested.

The launch description needs to include a ReadyToTest action to signal to the test framework that it’s safe to start the active tests.

In the above example, there is no need to delay the start of the tests so the ReadyToTest action is a peer to the process under test and will signal to the framework that it’s safe to start around the same time the ExecuteProcess action is run.

Active Tests

Any classes that inherit from unittest.TestCase and not decorated with the post_shutdown_test descriptor will be run concurrently with the process under test. These tests are expected to interact with the running processes in some way.

Post-Shutdown Tests

Any classes that inherit from unittest.TestCase that are decorated with the post_shutdown_test descriptor will be run after the launched processes have been shut down. These tests have access to the exit codes and the stdout of all of the launched processes, as well as any data created as a side-effect of running the processes.

Exit Codes and Standard Out

The launch_testing framework automatically adds some member fields to each test case so that the tests can access process output and exit codes.

These objects provide dictionary like access to information about the running processes. They also contain methods that the active tests can use to wait for a process to exit or to wait for specific output.

Assertions

The launch_testing framework automatically records all stdout from the launched processes as well as the exit codes from any processes that are launched. This information is made available to the tests via the proc_info and proc_output object. These objects can be used by one of several assert methods to check the output or exit codes of the process:

launch_testing.asserts.assertInStdout(proc_output, msg, process, cmd_args=None, *, strict_proc_matching=True)

Asserts that a message is found in the stdout of a particular process.

  • msg:

    The text to look for in the process standard out

  • process:

    Either the process name as a string, or a launch.actions.ExecuteProcess object that was used to start the process. Pass None or an empty string to search all processes.

  • cmd_args:

    When looking up processes by process by name, cmd_args can be used to disambiguate multiple processes with the same name.

  • strict_proc_matching:

    When looking up a process by name, strict_proc_matching=True will make it an error to match multiple processes. This prevents an assert from accidentally passing if the output came from a different process than the one the user was expecting.

launch_testing.asserts.assertExitCodes(proc_info, allowable_exit_codes=[EXIT_OK], process, cmd_args=None, *, strict_proc_matching=True)

Asserts that the specified processes exited with a particular exit code.

  • allowable_exit_codes:

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package launch_testing

3.8.9 (2026-09-18)

  • Robust pytest_ignore_collect for multi-version Pytest compatibility (#974) (#1005)
  • Fix Pytest 8/9 compatibility and coroutine leaks in launch_pytest (#972) (#1007)
  • Contributors: Guilhem Saurel

3.8.8 (2026-07-14)

  • Correct typos (backport #961) (#962)
  • Contributors: mergify[bot]

3.8.7 (2026-01-12)

3.8.6 (2025-11-07)

3.8.5 (2025-10-17)

3.8.4 (2025-10-06)

3.8.3 (2025-09-11)

3.8.2 (2025-06-23)

3.8.1 (2025-04-18)

  • Fix function params indentation (#833)
  • Contributors: Christophe Bedard

3.8.0 (2025-02-27)

  • Cleanup the launch dependencies. (#819)
  • Contributors: Chris Lalancette

3.7.1 (2024-12-20)

3.7.0 (2024-11-20)

  • Add test_xmllint to all of the ament_python packages. (#804)
  • Contributors: Chris Lalancette

3.6.1 (2024-07-29)

3.6.0 (2024-06-25)

3.5.1 (2024-06-17)

  • Add mechanism to disable workaround for dependency groups (#775)
  • Contributors: Scott K Logan

3.5.0 (2024-04-26)

3.4.2 (2024-04-16)

  • Fix a warning in modern unittest. (#773) Newer versions of unittest no longer store an errors list; instead, they store a result, which then stores an error list. Update the code here to be able to deal with either version.
  • Contributors: Chris Lalancette

3.4.1 (2024-03-28)

  • Add consider_namespace_packages=False (#766)
  • Contributors: Tony Najjar

3.4.0 (2024-02-07)

3.3.0 (2024-01-24)

3.2.1 (2023-12-26)

3.2.0 (2023-10-04)

  • to open expected outpout file with an encoding parameter (#717)
  • Contributors: Chen Lihui

3.1.0 (2023-09-08)

3.0.1 (2023-09-07)

3.0.0 (2023-08-21)

2.2.1 (2023-07-11)

2.2.0 (2023-06-07)

File truncated at 100 lines see the full file

Dependant Packages

Name Deps
async_web_server_cpp
beluga_example
diagnostic_updater
flexbe_core
flexbe_onboard
flexbe_testing
fmi_adapter
gps_tools
gpsd_client
stereo_image_proc
joint_state_publisher
swri_transform_util
moveit_task_constructor_capabilities
moveit_task_constructor_visualization
mrpt_navigation
mrpt_trajectory_follower
novatel_oem7_driver
pcl_ros
realsense2_camera
robot_calibration
slam_toolbox
joy_teleop
twist_mux
composition
demo_nodes_cpp
demo_nodes_cpp_native
image_tools
intra_process_demo
logging_demo
pendulum_control
quality_of_service_demo_cpp
dolly_tests
domain_bridge
dynamixel_hardware
launch_testing_examples
generate_parameter_library_example
generate_parameter_library_example_external
kobuki_velocity_smoother
launch_pytest
launch_testing_ament_cmake
test_launch_testing
launch_testing_ros
nav2_bringup
nav2_costmap_2d
nav2_map_server
nav2_route
nav2_system_tests
ament_nodl
rcl
rcl_logging_noop
rcl_logging_rcutils
rclc
rclcpp_components
rcutils
ros1_bridge
controller_manager
plansys2_bringup
ros2action
ros2doctor
ros2interface
ros2lifecycle
ros2node
ros2param
ros2pkg
ros2service
ros2topic
ros2launch_security_examples
ros_gz_bridge
ros_gz_sim
test_ros_gz_bridge
ros2test
ros_testing
ros2bag
test_cli_remapping
test_communication
test_rclcpp
test_security
ros_core
webots_ros2_tests
mujoco_ros2_control_tests
ros2ai
adi_iio
automatika_ros_sugar
rosgraph_monitor_test
greenwave_monitor
mola_state_estimation_smoother
network_bridge
play_motion2_cli
soar_ros
joint_state_topic_hardware_interface
jig_example
roadmap_explorer

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged launch_testing at Robotics Stack Exchange

Package Summary

Version 3.9.8
License Apache License 2.0
Build type AMENT_PYTHON
Use RECOMMENDED

Repository Summary

Description
Checkout URI https://github.com/ros2/launch.git
VCS Type git
VCS Version lyrical
Last Updated 2026-10-19
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

A package to create tests which involve launch files and multiple processes.

Maintainers

  • Aditya Pande
  • Brandon Ong
  • William Woodall

Authors

  • Dirk Thomas
  • Esteve Fernandez
  • Michel Hidalgo
  • Pete Baughman
  • William Woodall

launch_testing

This tool is a framework for launch integration testing. For example:

  • The exit codes of all processes are available to the tests.
  • Tests can check that all processes shut down normally, or with specific exit codes.
  • Tests can fail when a process dies unexpectedly.
  • The stdout and stderr of all processes are available to the tests.
  • The command-line used to launch the processes are available to the tests.
  • Some tests run concurrently with the launch and can interact with the running processes.

Quick start example

Start with the launch_testing example good_proc_launch_test.py.

Run the example by doing:

launch_test test/launch_testing/examples/good_proc_launch_test.py

launch_test will launch the nodes found in the generate_test_description function, run the tests from the TestGoodProcess class, shut down the launched nodes, and then run the tests from the TestProcessOutput class.

The Launch Description

def generate_test_description():

    return launch.LaunchDescription([
        launch.actions.ExecuteProcess(
            cmd=[path_to_process],
        ),

        # Start tests right away - no need to wait for anything in this example.
        # In a more complicated launch description, we might want this action happen
        # once some process starts or once some other event happens
        launch_testing.actions.ReadyToTest()
    ])

The generate_test_description function should return a launch.LaunchDescription object that launches the system to be tested.

The launch description needs to include a ReadyToTest action to signal to the test framework that it’s safe to start the active tests.

In the above example, there is no need to delay the start of the tests so the ReadyToTest action is a peer to the process under test and will signal to the framework that it’s safe to start around the same time the ExecuteProcess action is run.

Active Tests

Any classes that inherit from unittest.TestCase and not decorated with the post_shutdown_test descriptor will be run concurrently with the process under test. These tests are expected to interact with the running processes in some way.

Post-Shutdown Tests

Any classes that inherit from unittest.TestCase that are decorated with the post_shutdown_test descriptor will be run after the launched processes have been shut down. These tests have access to the exit codes and the stdout of all of the launched processes, as well as any data created as a side-effect of running the processes.

Exit Codes and Standard Out

The launch_testing framework automatically adds some member fields to each test case so that the tests can access process output and exit codes.

These objects provide dictionary like access to information about the running processes. They also contain methods that the active tests can use to wait for a process to exit or to wait for specific output.

Assertions

The launch_testing framework automatically records all stdout from the launched processes as well as the exit codes from any processes that are launched. This information is made available to the tests via the proc_info and proc_output object. These objects can be used by one of several assert methods to check the output or exit codes of the process:

launch_testing.asserts.assertInStdout(proc_output, msg, process, cmd_args=None, *, strict_proc_matching=True)

Asserts that a message is found in the stdout of a particular process.

  • msg:

    The text to look for in the process standard out

  • process:

    Either the process name as a string, or a launch.actions.ExecuteProcess object that was used to start the process. Pass None or an empty string to search all processes.

  • cmd_args:

    When looking up processes by process by name, cmd_args can be used to disambiguate multiple processes with the same name.

  • strict_proc_matching:

    When looking up a process by name, strict_proc_matching=True will make it an error to match multiple processes. This prevents an assert from accidentally passing if the output came from a different process than the one the user was expecting.

launch_testing.asserts.assertExitCodes(proc_info, allowable_exit_codes=[EXIT_OK], process, cmd_args=None, *, strict_proc_matching=True)

Asserts that the specified processes exited with a particular exit code.

  • allowable_exit_codes:

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package launch_testing

3.9.8 (2026-07-14)

  • Fix Pytest 8/9 compatibility in hooks (backport #972) (#973)
  • Contributors: mergify[bot]

3.9.7 (2026-04-09)

  • Correct typos (#961)
  • Fix test_io_tests for Ubuntu26 (#960)
  • Fix flake8 (#952)
  • Contributors: Auguste Lalande, Michael Carlstrom

3.9.6 (2026-01-12)

3.9.5 (2025-11-07)

3.9.4 (2025-10-17)

  • Switch osrf_pycommon dependency to system package (#817)
  • Contributors: Scott K Logan

3.9.3 (2025-10-06)

3.9.2 (2025-07-29)

  • Fix Setuptoolsdeprecations (#898)
  • Contributors: mosfet80

3.9.1 (2025-06-19)

  • Make sure to install py.typed files (#886)
  • Add remaining [py.typed]{.title-ref} (#884)
  • Updated [launch]{.title-ref} typings (#831)
  • Contributors: Christophe Bedard, Michael Carlstrom

3.9.0 (2025-04-24)

3.8.1 (2025-04-18)

  • Fix function params indentation (#833)
  • Contributors: Christophe Bedard

3.8.0 (2025-02-27)

  • Cleanup the launch dependencies. (#819)
  • Contributors: Chris Lalancette

3.7.1 (2024-12-20)

3.7.0 (2024-11-20)

  • Add test_xmllint to all of the ament_python packages. (#804)
  • Contributors: Chris Lalancette

3.6.1 (2024-07-29)

3.6.0 (2024-06-25)

3.5.1 (2024-06-17)

  • Add mechanism to disable workaround for dependency groups (#775)
  • Contributors: Scott K Logan

3.5.0 (2024-04-26)

3.4.2 (2024-04-16)

  • Fix a warning in modern unittest. (#773) Newer versions of unittest no longer store an errors list; instead, they store a result, which then stores an error list. Update the code here to be able to deal with either version.
  • Contributors: Chris Lalancette

3.4.1 (2024-03-28)

  • Add consider_namespace_packages=False (#766)
  • Contributors: Tony Najjar

3.4.0 (2024-02-07)

3.3.0 (2024-01-24)

3.2.1 (2023-12-26)

File truncated at 100 lines see the full file

Dependant Packages

Name Deps
async_web_server_cpp
diagnostic_updater
flexbe_core
flexbe_onboard
flexbe_testing
fmi_adapter
gps_tools
gpsd_client
stereo_image_proc
joint_state_publisher
swri_transform_util
moveit_task_constructor_capabilities
moveit_task_constructor_visualization
mrpt_navigation
mrpt_trajectory_follower
pcl_ros
realsense2_camera
robot_calibration
slam_toolbox
joy_teleop
twist_mux
composition
demo_nodes_cpp
demo_nodes_cpp_native
image_tools
intra_process_demo
logging_demo
pendulum_control
quality_of_service_demo_cpp
dolly_tests
domain_bridge
dynamixel_hardware
launch_testing_examples
generate_parameter_library_example
generate_parameter_library_example_external
kobuki_velocity_smoother
launch_pytest
launch_testing_ament_cmake
test_launch_testing
launch_testing_ros
nav2_bringup
nav2_costmap_2d
nav2_map_server
nav2_route
nav2_system_tests
ament_nodl
rcl
rcl_logging_rcutils
rclc
rcutils
ros1_bridge
controller_manager
rqt_controller_manager
rqt_joint_trajectory_controller
plansys2_bringup
ros2action
ros2doctor
ros2interface
ros2lifecycle
ros2node
ros2param
ros2pkg
ros2service
ros2topic
ros2launch_security_examples
ros_gz_bridge
ros_gz_sim
test_ros_gz_bridge
ros2test
ros_testing
ros2bag
test_cli_remapping
test_communication
test_rclcpp
test_rosidl_buffer
test_security
ros_core
webots_ros2_tests
mujoco_ros2_control_tests
ros2ai
adi_iio
automatika_ros_sugar
rosgraph_monitor_test
greenwave_monitor
mola_state_estimation_smoother
network_bridge
play_motion2_cli
cuda_buffer_backend
shmem_buffer_backend
soar_ros
joint_state_topic_hardware_interface
ros2_medkit_integration_tests
ros2_medkit_graph_watchdog
trimble_driver

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged launch_testing at Robotics Stack Exchange

Package Summary

Version 3.10.2
License Apache-2.0
Build type AMENT_PYTHON
Use RECOMMENDED

Repository Summary

Description
Checkout URI https://github.com/ros2/launch.git
VCS Type git
VCS Version rolling
Last Updated 2026-10-16
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

A package to create tests which involve launch files and multiple processes.

Maintainers

  • Aditya Pande
  • Brandon Ong
  • William Woodall

Authors

  • Dirk Thomas
  • Esteve Fernandez
  • Michel Hidalgo
  • Pete Baughman
  • William Woodall

launch_testing

This tool is a framework for launch integration testing. For example:

  • The exit codes of all processes are available to the tests.
  • Tests can check that all processes shut down normally, or with specific exit codes.
  • Tests can fail when a process dies unexpectedly.
  • The stdout and stderr of all processes are available to the tests.
  • The command-line used to launch the processes are available to the tests.
  • Some tests run concurrently with the launch and can interact with the running processes.

Quick start example

Start with the launch_testing example good_proc_launch_test.py.

Run the example by doing:

launch_test test/launch_testing/examples/good_proc_launch_test.py

launch_test will launch the nodes found in the generate_test_description function, run the tests from the TestGoodProcess class, shut down the launched nodes, and then run the tests from the TestProcessOutput class.

The Launch Description

def generate_test_description():

    return launch.LaunchDescription([
        launch.actions.ExecuteProcess(
            cmd=[path_to_process],
        ),

        # Start tests right away - no need to wait for anything in this example.
        # In a more complicated launch description, we might want this action happen
        # once some process starts or once some other event happens
        launch_testing.actions.ReadyToTest()
    ])

The generate_test_description function should return a launch.LaunchDescription object that launches the system to be tested.

The launch description needs to include a ReadyToTest action to signal to the test framework that it’s safe to start the active tests.

In the above example, there is no need to delay the start of the tests so the ReadyToTest action is a peer to the process under test and will signal to the framework that it’s safe to start around the same time the ExecuteProcess action is run.

Active Tests

Any classes that inherit from unittest.TestCase and not decorated with the post_shutdown_test descriptor will be run concurrently with the process under test. These tests are expected to interact with the running processes in some way.

Post-Shutdown Tests

Any classes that inherit from unittest.TestCase that are decorated with the post_shutdown_test descriptor will be run after the launched processes have been shut down. These tests have access to the exit codes and the stdout of all of the launched processes, as well as any data created as a side-effect of running the processes.

Exit Codes and Standard Out

The launch_testing framework automatically adds some member fields to each test case so that the tests can access process output and exit codes.

These objects provide dictionary like access to information about the running processes. They also contain methods that the active tests can use to wait for a process to exit or to wait for specific output.

Assertions

The launch_testing framework automatically records all stdout from the launched processes as well as the exit codes from any processes that are launched. This information is made available to the tests via the proc_info and proc_output object. These objects can be used by one of several assert methods to check the output or exit codes of the process:

launch_testing.asserts.assertInStdout(proc_output, msg, process, cmd_args=None, *, strict_proc_matching=True)

Asserts that a message is found in the stdout of a particular process.

  • msg:

    The text to look for in the process standard out

  • process:

    Either the process name as a string, or a launch.actions.ExecuteProcess object that was used to start the process. Pass None or an empty string to search all processes.

  • cmd_args:

    When looking up processes by process by name, cmd_args can be used to disambiguate multiple processes with the same name.

  • strict_proc_matching:

    When looking up a process by name, strict_proc_matching=True will make it an error to match multiple processes. This prevents an assert from accidentally passing if the output came from a different process than the one the user was expecting.

launch_testing.asserts.assertExitCodes(proc_info, allowable_exit_codes=[EXIT_OK], process, cmd_args=None, *, strict_proc_matching=True)

Asserts that the specified processes exited with a particular exit code.

  • allowable_exit_codes:

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package launch_testing

3.10.2 (2026-10-01)

  • Preserve CTest target identity in JUnit results (#1002)
  • Use the SPDX identifier Apache-2.0 in license declarations (#1013)
  • Contributors: Michael Carroll, 渠超胜

3.10.1 (2026-09-02)

3.10.0 (2026-05-07)

  • Robust pytest_ignore_collect for multi-version Pytest compatibility (#974)
  • Fix Pytest 8/9 compatibility and coroutine leaks in launch_pytest (#972)
  • Contributors: Michael Carroll

3.9.7 (2026-04-09)

  • Correct typos (#961)
  • Fix test_io_tests for Ubuntu26 (#960)
  • Fix flake8 (#952)
  • Contributors: Auguste Lalande, Michael Carlstrom

3.9.6 (2026-01-12)

3.9.5 (2025-11-07)

3.9.4 (2025-10-17)

  • Switch osrf_pycommon dependency to system package (#817)
  • Contributors: Scott K Logan

3.9.3 (2025-10-06)

3.9.2 (2025-07-29)

  • Fix Setuptoolsdeprecations (#898)
  • Contributors: mosfet80

3.9.1 (2025-06-19)

  • Make sure to install py.typed files (#886)
  • Add remaining [py.typed]{.title-ref} (#884)
  • Updated [launch]{.title-ref} typings (#831)
  • Contributors: Christophe Bedard, Michael Carlstrom

3.9.0 (2025-04-24)

3.8.1 (2025-04-18)

  • Fix function params indentation (#833)
  • Contributors: Christophe Bedard

3.8.0 (2025-02-27)

  • Cleanup the launch dependencies. (#819)
  • Contributors: Chris Lalancette

3.7.1 (2024-12-20)

3.7.0 (2024-11-20)

  • Add test_xmllint to all of the ament_python packages. (#804)
  • Contributors: Chris Lalancette

3.6.1 (2024-07-29)

3.6.0 (2024-06-25)

3.5.1 (2024-06-17)

  • Add mechanism to disable workaround for dependency groups (#775)
  • Contributors: Scott K Logan

3.5.0 (2024-04-26)

3.4.2 (2024-04-16)

  • Fix a warning in modern unittest. (#773) Newer versions of unittest no longer store an errors list; instead, they store a result, which then stores an error list. Update the code here to be able to deal with either version.
  • Contributors: Chris Lalancette

3.4.1 (2024-03-28)

File truncated at 100 lines see the full file

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged launch_testing at Robotics Stack Exchange

Package symbol

launch_testing package from bitbots_main repo

bitbots_blackboard bitbots_body_behavior bitbots_bringup bitbots_diagnostic bitbots_docs bitbots_education bitbots_extrinsic_calibration bitbots_ipm bitbots_parameter_blackboard bitbots_player_state bitbots_robot_description bitbots_teleop bitbots_tts bitbots_utils bitbots_whistle_detector system_monitor bitbots_animation_rqt bitbots_animation_server bitbots_emergency bitbots_hcm bitbots_head_mover bitbots_rl_motion bitbots_splines bitbots_msgs bitbots_localization bitbots_localization_handler bitbots_odometry bitbots_path_planning piplus_animations piplus_description bitbots_mujoco_sim bitbots_team_communication bitbots_team_data_sim_rqt bitbots_vision bitbots_ball_filter bitbots_robot_filter audio_common audio_common_msgs biped_interfaces bitbots_tf_buffer domain_bridge dynamic_stack_decider dynamic_stack_decider_visualization game_controller_hsl game_controller_hsl_interfaces humanoid_base_footprint imu_complementary_filter rviz_imu_plugin ipm_image_node ipm_interfaces ipm_library ipm_service launch launch_pytest launch_testing launch_testing_ament_cmake launch_xml launch_yaml test_launch_testing livelybot_bringup livelybot_msg livelybot_oled livelybot_power livelybot_serial serial yesense_imu particle_filter ros2_numpy ros2_python_extension rot_conv soccer_field_map_generator soccer_geometry_msgs soccer_interfaces soccer_model_msgs soccer_vision_2d_msgs soccer_vision_3d_msgs soccer_vision_attribute_msgs soccer_ipm soccer_vision_3d_rviz_markers udp_bridge zed_msgs zed_components zed_ros2 zed_wrapper

ROS Distro
github

Package Summary

Version 3.4.11
License Apache License 2.0
Build type AMENT_PYTHON
Use RECOMMENDED

Repository Summary

Description
Checkout URI https://github.com/bit-bots/bitbots_main.git
VCS Type git
VCS Version main
Last Updated 2026-10-19
Dev Status UNKNOWN
Released UNRELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

A package to create tests which involve launch files and multiple processes.

Maintainers

  • Aditya Pande
  • Brandon Ong
  • William Woodall

Authors

  • Dirk Thomas
  • Esteve Fernandez
  • Michel Hidalgo
  • Pete Baughman
  • William Woodall

launch_testing

This tool is a framework for launch integration testing. For example:

  • The exit codes of all processes are available to the tests.
  • Tests can check that all processes shut down normally, or with specific exit codes.
  • Tests can fail when a process dies unexpectedly.
  • The stdout and stderr of all processes are available to the tests.
  • The command-line used to launch the processes are available to the tests.
  • Some tests run concurrently with the launch and can interact with the running processes.

Quick start example

Start with the launch_testing example good_proc_launch_test.py.

Run the example by doing:

launch_test test/launch_testing/examples/good_proc_launch_test.py

launch_test will launch the nodes found in the generate_test_description function, run the tests from the TestGoodProcess class, shut down the launched nodes, and then run the tests from the TestProcessOutput class.

The Launch Description

def generate_test_description():

    return launch.LaunchDescription([
        launch.actions.ExecuteProcess(
            cmd=[path_to_process],
        ),

        # Start tests right away - no need to wait for anything in this example.
        # In a more complicated launch description, we might want this action happen
        # once some process starts or once some other event happens
        launch_testing.actions.ReadyToTest()
    ])

The generate_test_description function should return a launch.LaunchDescription object that launches the system to be tested.

The launch description needs to include a ReadyToTest action to signal to the test framework that it’s safe to start the active tests.

In the above example, there is no need to delay the start of the tests so the ReadyToTest action is a peer to the process under test and will signal to the framework that it’s safe to start around the same time the ExecuteProcess action is run.

Active Tests

Any classes that inherit from unittest.TestCase and not decorated with the post_shutdown_test descriptor will be run concurrently with the process under test. These tests are expected to interact with the running processes in some way.

Post-Shutdown Tests

Any classes that inherit from unittest.TestCase that are decorated with the post_shutdown_test descriptor will be run after the launched processes have been shut down. These tests have access to the exit codes and the stdout of all of the launched processes, as well as any data created as a side-effect of running the processes.

Exit Codes and Standard Out

The launch_testing framework automatically adds some member fields to each test case so that the tests can access process output and exit codes.

These objects provide dictionary like access to information about the running processes. They also contain methods that the active tests can use to wait for a process to exit or to wait for specific output.

Assertions

The launch_testing framework automatically records all stdout from the launched processes as well as the exit codes from any processes that are launched. This information is made available to the tests via the proc_info and proc_output object. These objects can be used by one of several assert methods to check the output or exit codes of the process:

launch_testing.asserts.assertInStdout(proc_output, msg, process, cmd_args=None, *, strict_proc_matching=True)

Asserts that a message is found in the stdout of a particular process.

  • msg:

    The text to look for in the process standard out

  • process:

    Either the process name as a string, or a launch.actions.ExecuteProcess object that was used to start the process. Pass None or an empty string to search all processes.

  • cmd_args:

    When looking up processes by process by name, cmd_args can be used to disambiguate multiple processes with the same name.

  • strict_proc_matching:

    When looking up a process by name, strict_proc_matching=True will make it an error to match multiple processes. This prevents an assert from accidentally passing if the output came from a different process than the one the user was expecting.

launch_testing.asserts.assertExitCodes(proc_info, allowable_exit_codes=[EXIT_OK], process, cmd_args=None, *, strict_proc_matching=True)

Asserts that the specified processes exited with a particular exit code.

  • allowable_exit_codes:

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package launch_testing

3.4.11 (2026-06-02)

  • Correct typos (backport #961) (#963)

    * Correct typos (#961) (cherry picked from commit b51d67a0fb3c572a8255855ac73364ca53ed3691) Co-authored-by: Auguste Lalande <<auguste.lalande@gmail.com>> Co-authored-by: Alejandro Hernandez Cordero <<ahcorde@gmail.com>>

  • Contributors: mergify[bot]

3.4.10 (2026-01-12)

3.4.9 (2025-11-07)

3.4.8 (2025-10-17)

3.4.7 (2025-10-06)

3.4.6 (2025-08-06)

3.4.5 (2025-06-23)

3.4.4 (2025-04-02)

  • Merge pull request #834 from ros2/mergify/bp/jazzy/pr-833 Fix function params indentation (backport #833)
  • Fix function params indentation (#833) (cherry picked from commit 151b024a7cfac06f0d56798cbe87ab180b9ea3ab)
  • Contributors: Alejandro Hernández Cordero, Christophe Bedard

3.4.3 (2024-12-18)

3.4.2 (2024-04-16)

  • Fix a warning in modern unittest. (#773) Newer versions of unittest no longer store an errors list; instead, they store a result, which then stores an error list. Update the code here to be able to deal with either version.
  • Contributors: Chris Lalancette

3.4.1 (2024-03-28)

  • Add consider_namespace_packages=False (#766)
  • Contributors: Tony Najjar

3.4.0 (2024-02-07)

3.3.0 (2024-01-24)

3.2.1 (2023-12-26)

3.2.0 (2023-10-04)

  • to open expected outpout file with an encoding parameter (#717)
  • Contributors: Chen Lihui

3.1.0 (2023-09-08)

3.0.1 (2023-09-07)

3.0.0 (2023-08-21)

2.2.1 (2023-07-11)

2.2.0 (2023-06-07)

2.1.0 (2023-04-27)

2.0.1 (2023-04-12)

2.0.0 (2023-04-11)

  • Improve type checking (#679)
  • Contributors: Hervé Audren

1.4.1 (2023-02-24)

  • Fixed typos (#692)
  • Contributors: Alejandro Hernández Cordero

1.4.0 (2023-02-14)

  • Allow ReadyToTest() usage in event handler (#665)
  • Inherit markers from generate_test_description (#670)
  • [rolling] Update maintainers - 2022-11-07 (#671)
  • Contributors: Audrow Nash, Nikolai Morin, Scott K Logan

File truncated at 100 lines see the full file

Dependant Packages

Name Deps
nav2_bringup
nav2_bringup
nav2_bringup
nav2_bringup
nav2_bringup
nav2_bringup
nav2_bringup
nav2_costmap_2d
nav2_costmap_2d
nav2_costmap_2d
nav2_costmap_2d
nav2_costmap_2d
nav2_costmap_2d
nav2_costmap_2d
nav2_costmap_2d
nav2_map_server
nav2_map_server
nav2_map_server
nav2_map_server
nav2_map_server
nav2_map_server
nav2_route
nav2_system_tests
nav2_system_tests
nav2_system_tests
nav2_system_tests
nav2_system_tests
nav2_system_tests
performance_test
nav2_amcl
nav2_amcl
nav2_amcl
nav2_amcl
nav2_amcl
nav2_amcl
nav2_amcl
probabilistic_occupancy_grid_map
default_ad_api
gpudirect-dds
nav2_core
nav2_core
nav2_core
nav2_core
nav2_core
nav2_core
nav2_core
fault_injection
stereo_image_proc
domain_bridge
domain_bridge
domain_bridge
autoware_slam
autoware_default_adapi
autoware_probabilistic_occupancy_grid_map
autoware_fault_injection
lidar_integration
launch_pytest
launch_testing_ament_cmake
test_launch_testing
rosbridge_server
rosbridge_server
pcl_ros
pcl_ros
carma_cooperative_perception
subsystem_controllers
system_controller
map_server
cloisim_ros_bringup
demo_nodes_cpp_co
mcr_bringup
epuck_ros2_driver
extended_map_server
gisnav
happypose_ros
rcl
rclc
rcutils
isaac_ros_manipulation_pick_and_place
isaac_ros_manipulation_flexiv_driver_utils
isaac_ros_gpu_partitioning
kachaka_nav2_bringup
kachaka_grpc_ros2_bridge
kachaka_interfaces
ldlidar_node
stanford_controller
talkerlistener
nav_drone_core
sam_bot_nav2_gz
okvis
realsense2_camera
uuv_thruster_manager
uuv_gazebo_ros_plugins
px4_ros_com
px4_ros_com
custom_robots
app
example_ament_python_launch_testing
ros2_control_demo_example_1
ros2_control_demo_example_10
ros2_control_demo_example_11
ros2_control_demo_example_12
ros2_control_demo_example_13
ros2_control_demo_example_14
ros2_control_demo_example_15
ros2_control_demo_example_16
ros2_control_demo_example_17
ros2_control_demo_example_2
ros2_control_demo_example_3
ros2_control_demo_example_4
ros2_control_demo_example_5
ros2_control_demo_example_6
ros2_control_demo_example_7
ros2_control_demo_example_8
ros2_control_demo_example_9
ros2_lib
ros2_laser_scan_matcher
drone_control
plansys2_bt_example
plansys2_cascade_example
plansys2_multidomain_example
plansys2_patrol_navigation_example
plansys2_simple_example
plansys2_simple_example_py
ros_bt_py
ros2ai
ros2bag_extensions
joy_teleop
joy_teleop
rosbot_utils
rosbot_xl_gazebo
rosidl_typeadapter_protobuf_test
ackermann_mux
social_nav2_bringup
rclcpp_tutorials
turtlebot3_unity
turtlebot3_unity_bringup
vehicle_gateway_integration_test
landmark_server
waypoint_manager
zed_topic_benchmark

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged launch_testing at Robotics Stack Exchange

Package Summary

Version 0.17.2
License Apache License 2.0
Build type AMENT_PYTHON
Use RECOMMENDED

Repository Summary

Description
Checkout URI https://github.com/ros2/launch.git
VCS Type git
VCS Version galactic
Last Updated 2022-12-02
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

A package to create tests which involve launch files and multiple processes.

Maintainers

  • William Woodall
  • Michel Hidalgo

Authors

  • Pete Baughman
  • Dirk Thomas
  • Esteve Fernandez

launch_testing

This tool is a framework for launch integration testing. For example:

  • The exit codes of all processes are available to the tests.
  • Tests can check that all processes shut down normally, or with specific exit codes.
  • Tests can fail when a process dies unexpectedly.
  • The stdout and stderr of all processes are available to the tests.
  • The command-line used to launch the processes are avilalbe to the tests.
  • Some tests run concurrently with the launch and can interact with the running processes.

Quick start example

Start with the launch_testing example good_proc_launch_test.py.

Run the example by doing:

launch_test test/launch_testing/examples/good_proc_launch_test.py

launch_test will launch the nodes found in the generate_test_description function, run the tests from the TestGoodProcess class, shut down the launched nodes, and then run the tests from the TestProcessOutput class.

The Launch Description

def generate_test_description():

    return launch.LaunchDescription([
        launch.actions.ExecuteProcess(
            cmd=[path_to_process],
        ),

        # Start tests right away - no need to wait for anything in this example.
        # In a more complicated launch description, we might want this action happen
        # once some process starts or once some other event happens
        launch_testing.actions.ReadyToTest()
    ])

The generate_test_description function should return a launch.LaunchDescription object that launches the system to be tested.

The launch description needs to include a ReadyToTest action to signal to the test framework that it’s safe to start the active tests.

In the above example, there is no need to delay the start of the tests so the ReadyToTest action is a peer to the process under test and will signal to the framework that it’s safe to start around the same time the ExecuteProcess action is run.

In older style tests, a function called ready_fn is declared as an argument to generate_test_description and must be plumbed into the launch description with an OpaqueFunction. This method has been fully replaced by the ReadyToTest action and is therefore deprecated.

def generate_test_description(ready_fn):

    return launch.LaunchDescription([
        launch.actions.ExecuteProcess(
            cmd=[path_to_process],
        ),

        # Start tests right away - no need to wait for anything in this example
        launch.actions.OpaqueFunction(function=lambda context: ready_fn()),
    ])

Active Tests

Any classes that inherit from unittest.TestCase and not decorated with the post_shutdown_test descriptor will be run concurrently with the proccess under test. These tests are expected to interact with the running processes in some way.

Post-Shutdown Tests

Any classes that inherit from unittest.TestCase that are decorated with the post_shutdown_test descriptor will be run after the launched processes have been shut down. These tests have access to the exit codes and the stdout of all of the launched processes, as well as any data created as a side-effect of running the processes.

Exit Codes and Standard Out

The launch_testing framework automatically adds some member fields to each test case so that the tests can access process output and exit codes.

These objects provide dictionary like access to information about the running processes. They also contain methods that the active tests can use to wait for a process to exit or to wait for specific output.

Assertions

The launch_testing framework automatically records all stdout from the launched processes as well as the exit codes from any processes that are launched. This information is made available to the tests via the proc_info and proc_output object. These objects can be used by one of several assert methods to check the output or exit codes of the process:

launch_testing.asserts.assertInStdout(proc_output, msg, process, cmd_args=None, *, strict_proc_matching=True)

Asserts that a message is found in the stdout of a particular process.

  • msg:

    The text to look for in the process standard out

  • process:

    Either the process name as a string, or a launch.actions.ExecuteProcess object that was used to start the process. Pass None or an empty string to search all processes.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package launch_testing

0.17.2 (2022-12-02)

  • Inherit markers from generate_test_description (#675)
  • Fix Typo (#643)
  • Add compatitibility with pytest 7 (#629)
  • Mention that ready_fn in generate_test_description is deprecated (#623)
  • Switch to using a comprehension for process_names. (#616)
  • Contributors: Bi0T1N, Chris Lalancette, Kenji Brameld, Scott K Logan, Shane Loretz

0.17.1 (2022-04-28)

  • Fix launch_testing README.md proc keyword to process. (#554) (#561) Co-authored-by: Michael McConnell <<Michael.McConnell-2@leidos.com>>
  • Contributors: Jacob Perron

0.17.0 (2021-04-06)

0.16.0 (2021-03-19)

  • Use unittest.mock instead of mock (#487)
  • Contributors: Michel Hidalgo

0.15.0 (2021-01-25)

0.14.0 (2020-12-08)

0.13.0 (2020-11-04)

  • Update package maintainers (#465)
  • Contributors: Michel Hidalgo

0.12.0 (2020-08-18)

0.11.1 (2020-08-14)

0.11.0 (2020-08-04)

  • Disable cleanup of test cases once they have been run (#406)
  • Fix max() with empty sequence (#440)
  • Use unittest.TestCase.id() for pytest failure reprs. (#436)
  • Use unittest.TestCase.id() to put together jUnit XML output. (#435)
  • Claim ownership (#433)
  • Contributors: Dirk Thomas, Michel Hidalgo, Scott K Logan, William Woodall

0.10.2 (2020-05-26)

  • Set junit_family to xunit2 in pytest.ini
  • Stop using implicit variables in example testing.
  • Switch to from_parent to remove deprecation warning.
  • Fix new flake8 errors. (#420)
  • Remove uses of deprecated ready_fn. (#419)
  • Contributors: Chris Lalancette, Michel Hidalgo

0.10.1 (2020-05-08)

  • fixed depcrecation warning of imp to importlib (issue #387) (#407)
  • wait_for_ouput() repr includes actual text (#408)
  • Contributors: Shane Loretz, Zahi Kakish

0.10.0 (2020-04-24)

  • Improve jUnit output for launch tests when run with py.test (#404)
  • avoid deprecation warning, use from_parent (#402)
  • Warn that old-style ready_fn and test attributes will be deprecated (#346)
  • more verbose test_flake8 error messages (same as ros2/launch_ros#135)
  • stop using constructors deprecated in pytest 5.4 (#391)
  • Add the ability to assert in stdout or stderr. (#378)
  • Add delay parameter to retry_on_failure decorator (#390)
  • Make RegisterEventHandler describe its sub-entities (#386)
  • Import test file without contaminating sys.modules (#360)

File truncated at 100 lines see the full file

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged launch_testing at Robotics Stack Exchange

Package Summary

Version 2.0.4
License Apache License 2.0
Build type AMENT_PYTHON
Use RECOMMENDED

Repository Summary

Description
Checkout URI https://github.com/ros2/launch.git
VCS Type git
VCS Version iron
Last Updated 2024-06-24
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

A package to create tests which involve launch files and multiple processes.

Maintainers

  • Aditya Pande
  • Brandon Ong
  • William Woodall

Authors

  • Dirk Thomas
  • Esteve Fernandez
  • Michel Hidalgo
  • Pete Baughman
  • William Woodall

launch_testing

This tool is a framework for launch integration testing. For example:

  • The exit codes of all processes are available to the tests.
  • Tests can check that all processes shut down normally, or with specific exit codes.
  • Tests can fail when a process dies unexpectedly.
  • The stdout and stderr of all processes are available to the tests.
  • The command-line used to launch the processes are available to the tests.
  • Some tests run concurrently with the launch and can interact with the running processes.

Quick start example

Start with the launch_testing example good_proc_launch_test.py.

Run the example by doing:

launch_test test/launch_testing/examples/good_proc_launch_test.py

launch_test will launch the nodes found in the generate_test_description function, run the tests from the TestGoodProcess class, shut down the launched nodes, and then run the tests from the TestProcessOutput class.

The Launch Description

def generate_test_description():

    return launch.LaunchDescription([
        launch.actions.ExecuteProcess(
            cmd=[path_to_process],
        ),

        # Start tests right away - no need to wait for anything in this example.
        # In a more complicated launch description, we might want this action happen
        # once some process starts or once some other event happens
        launch_testing.actions.ReadyToTest()
    ])

The generate_test_description function should return a launch.LaunchDescription object that launches the system to be tested.

The launch description needs to include a ReadyToTest action to signal to the test framework that it’s safe to start the active tests.

In the above example, there is no need to delay the start of the tests so the ReadyToTest action is a peer to the process under test and will signal to the framework that it’s safe to start around the same time the ExecuteProcess action is run.

Active Tests

Any classes that inherit from unittest.TestCase and not decorated with the post_shutdown_test descriptor will be run concurrently with the process under test. These tests are expected to interact with the running processes in some way.

Post-Shutdown Tests

Any classes that inherit from unittest.TestCase that are decorated with the post_shutdown_test descriptor will be run after the launched processes have been shut down. These tests have access to the exit codes and the stdout of all of the launched processes, as well as any data created as a side-effect of running the processes.

Exit Codes and Standard Out

The launch_testing framework automatically adds some member fields to each test case so that the tests can access process output and exit codes.

These objects provide dictionary like access to information about the running processes. They also contain methods that the active tests can use to wait for a process to exit or to wait for specific output.

Assertions

The launch_testing framework automatically records all stdout from the launched processes as well as the exit codes from any processes that are launched. This information is made available to the tests via the proc_info and proc_output object. These objects can be used by one of several assert methods to check the output or exit codes of the process:

launch_testing.asserts.assertInStdout(proc_output, msg, process, cmd_args=None, *, strict_proc_matching=True)

Asserts that a message is found in the stdout of a particular process.

  • msg:

    The text to look for in the process standard out

  • process:

    Either the process name as a string, or a launch.actions.ExecuteProcess object that was used to start the process. Pass None or an empty string to search all processes.

  • cmd_args:

    When looking up processes by process by name, cmd_args can be used to disambiguate multiple processes with the same name.

  • strict_proc_matching:

    When looking up a process by name, strict_proc_matching=True will make it an error to match multiple processes. This prevents an assert from accidentally passing if the output came from a different process than the one the user was expecting.

launch_testing.asserts.assertExitCodes(proc_info, allowable_exit_codes=[EXIT_OK], process, cmd_args=None, *, strict_proc_matching=True)

Asserts that the specified processes exited with a particular exit code.

  • allowable_exit_codes:

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package launch_testing

2.0.4 (2024-06-24)

  • Add consider_namespace_packages=False (#766) (#778)

    * Add consider_namespace_packages=False (cherry picked from commit 07f43328054c03067b470d1c9bd707cb1e52d691) Co-authored-by: Tony Najjar <<tony.najjar.1997@gmail.com>>

  • Contributors: mergify[bot]

2.0.3 (2024-04-19)

2.0.2 (2023-07-14)

2.0.1 (2023-04-12)

2.0.0 (2023-04-11)

  • Improve type checking (#679)
  • Contributors: Hervé Audren

1.4.1 (2023-02-24)

  • Fixed typos (#692)
  • Contributors: Alejandro Hernández Cordero

1.4.0 (2023-02-14)

  • Allow ReadyToTest() usage in event handler (#665)
  • Inherit markers from generate_test_description (#670)
  • [rolling] Update maintainers - 2022-11-07 (#671)
  • Contributors: Audrow Nash, Nikolai Morin, Scott K Logan

1.3.0 (2022-11-02)

1.2.0 (2022-09-13)

  • Fix Typo (#641)
  • ReadyToTest action timeout using decorator (#625)
  • Switch to using a comprehension for process_names. (#614)
  • Contributors: Chris Lalancette, Deepanshu Bansal, Kenji Brameld

1.1.0 (2022-04-29)

1.0.1 (2022-04-13)

1.0.0 (2022-04-12)

  • Removed the deprecated [ready_fn]{.title-ref} feature (#589)
  • Contributors: William Woodall

0.23.1 (2022-04-08)

0.23.0 (2022-03-30)

0.22.0 (2022-03-28)

0.21.1 (2022-03-01)

  • Added case for instances of ExecuteLocal in resolveProcess function (#587)
  • Add compatitibility with pytest 7 (#592)
  • Contributors: Matt Lanting, Shane Loretz

0.21.0 (2022-01-14)

  • Renamed three files from example_processes (#573)
  • Fix launch_testing README.md proc keyword to process. (#554) (#560)
  • Contributors: Jacob Perron, Khush Jain

0.20.0 (2021-11-29)

  • Declare frontend group dependency & use explicit dependencies in launch_testing (#520)
  • Update maintainers to Aditya Pande and Michel Hidalgo (#559)
  • Updated maintainers (#555)
  • First prototype of native pytest plugin for launch based tests (#528)
  • Adding Executable description class (#454)
  • Add a "hello world" style example (#532)
  • Contributors: Aditya Pande, Audrow Nash, Christophe Bedard, Ivan

File truncated at 100 lines see the full file

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged launch_testing at Robotics Stack Exchange

No version for distro melodic showing humble. Known supported distros are highlighted in the buttons above.

Package Summary

Version 1.0.15
License Apache License 2.0
Build type AMENT_PYTHON
Use RECOMMENDED

Repository Summary

Description
Checkout URI https://github.com/ros2/launch.git
VCS Type git
VCS Version humble
Last Updated 2026-10-13
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

A package to create tests which involve launch files and multiple processes.

Maintainers

  • Aditya Pande
  • Michel Hidalgo

Authors

  • Dirk Thomas
  • Esteve Fernandez
  • Pete Baughman
  • William Woodall

launch_testing

This tool is a framework for launch integration testing. For example:

  • The exit codes of all processes are available to the tests.
  • Tests can check that all processes shut down normally, or with specific exit codes.
  • Tests can fail when a process dies unexpectedly.
  • The stdout and stderr of all processes are available to the tests.
  • The command-line used to launch the processes are available to the tests.
  • Some tests run concurrently with the launch and can interact with the running processes.

Quick start example

Start with the launch_testing example good_proc_launch_test.py.

Run the example by doing:

launch_test test/launch_testing/examples/good_proc_launch_test.py

launch_test will launch the nodes found in the generate_test_description function, run the tests from the TestGoodProcess class, shut down the launched nodes, and then run the tests from the TestProcessOutput class.

The Launch Description

def generate_test_description():

    return launch.LaunchDescription([
        launch.actions.ExecuteProcess(
            cmd=[path_to_process],
        ),

        # Start tests right away - no need to wait for anything in this example.
        # In a more complicated launch description, we might want this action happen
        # once some process starts or once some other event happens
        launch_testing.actions.ReadyToTest()
    ])

The generate_test_description function should return a launch.LaunchDescription object that launches the system to be tested.

The launch description needs to include a ReadyToTest action to signal to the test framework that it’s safe to start the active tests.

In the above example, there is no need to delay the start of the tests so the ReadyToTest action is a peer to the process under test and will signal to the framework that it’s safe to start around the same time the ExecuteProcess action is run.

Active Tests

Any classes that inherit from unittest.TestCase and not decorated with the post_shutdown_test descriptor will be run concurrently with the process under test. These tests are expected to interact with the running processes in some way.

Post-Shutdown Tests

Any classes that inherit from unittest.TestCase that are decorated with the post_shutdown_test descriptor will be run after the launched processes have been shut down. These tests have access to the exit codes and the stdout of all of the launched processes, as well as any data created as a side-effect of running the processes.

Exit Codes and Standard Out

The launch_testing framework automatically adds some member fields to each test case so that the tests can access process output and exit codes.

These objects provide dictionary like access to information about the running processes. They also contain methods that the active tests can use to wait for a process to exit or to wait for specific output.

Assertions

The launch_testing framework automatically records all stdout from the launched processes as well as the exit codes from any processes that are launched. This information is made available to the tests via the proc_info and proc_output object. These objects can be used by one of several assert methods to check the output or exit codes of the process:

launch_testing.asserts.assertInStdout(proc_output, msg, process, cmd_args=None, *, strict_proc_matching=True)

Asserts that a message is found in the stdout of a particular process.

  • msg:

    The text to look for in the process standard out

  • process:

    Either the process name as a string, or a launch.actions.ExecuteProcess object that was used to start the process. Pass None or an empty string to search all processes.

  • cmd_args:

    When looking up processes by process by name, cmd_args can be used to disambiguate multiple processes with the same name.

  • strict_proc_matching:

    When looking up a process by name, strict_proc_matching=True will make it an error to match multiple processes. This prevents an assert from accidentally passing if the output came from a different process than the one the user was expecting.

launch_testing.asserts.assertExitCodes(proc_info, allowable_exit_codes=[EXIT_OK], process, cmd_args=None, *, strict_proc_matching=True)

Asserts that the specified processes exited with a particular exit code.

  • allowable_exit_codes:

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package launch_testing

1.0.15 (2026-09-06)

  • Correct typos (backport #961) (#964)
  • Contributors: mergify[bot]

1.0.14 (2026-01-12)

  • Fixed typos (backport #692) (#693)
  • Contributors: mergify[bot]

1.0.13 (2025-11-07)

1.0.12 (2025-10-17)

1.0.11 (2025-10-06)

1.0.10 (2025-07-16)

1.0.9 (2025-06-06)

1.0.8 (2025-03-25)

1.0.7 (2024-11-25)

1.0.6 (2024-05-17)

  • Add consider_namespace_packages=False (#766) (#777)
  • Contributors: mergify[bot]

1.0.5 (2024-02-16)

1.0.4 (2023-01-10)

  • Allow ReadyToTest() usage in event handler (#681)
  • Inherit markers from generate_test_description (#670) (#674)
  • Contributors: Nikolai Morin, mergify[bot]

1.0.3 (2022-10-18)

  • Fix Typo (#641) (#644)
  • Switch to using a comprehension for process_names. (#614) (#615)
  • Contributors: mergify[bot]

1.0.2 (2022-05-10)

1.0.1 (2022-04-13)

1.0.0 (2022-04-12)

  • Removed the deprecated [ready_fn]{.title-ref} feature (#589)
  • Contributors: William Woodall

0.23.1 (2022-04-08)

0.23.0 (2022-03-30)

0.22.0 (2022-03-28)

0.21.1 (2022-03-01)

  • Added case for instances of ExecuteLocal in resolveProcess function (#587)
  • Add compatitibility with pytest 7 (#592)
  • Contributors: Matt Lanting, Shane Loretz

0.21.0 (2022-01-14)

  • Renamed three files from example_processes (#573)
  • Fix launch_testing README.md proc keyword to process. (#554) (#560)
  • Contributors: Jacob Perron, Khush Jain

0.20.0 (2021-11-29)

  • Declare frontend group dependency & use explicit dependencies in launch_testing (#520)
  • Update maintainers to Aditya Pande and Michel Hidalgo (#559)
  • Updated maintainers (#555)
  • First prototype of native pytest plugin for launch based tests (#528)

File truncated at 100 lines see the full file

Dependant Packages

Name Deps
async_web_server_cpp
beluga_example
diagnostic_updater
flexbe_core
flexbe_onboard
flexbe_testing
fmi_adapter
gps_tools
gpsd_client
stereo_image_proc
joint_state_publisher
swri_transform_util
moveit_task_constructor_capabilities
moveit_task_constructor_visualization
mrpt_navigation
mrpt_trajectory_follower
novatel_oem7_driver
realsense2_camera
robot_calibration
slam_toolbox
joy_teleop
twist_mux
composition
demo_nodes_cpp
demo_nodes_cpp_native
image_tools
intra_process_demo
logging_demo
pendulum_control
quality_of_service_demo_cpp
dolly_tests
domain_bridge
dynamixel_hardware
launch_testing_examples
generate_parameter_library_example
generate_parameter_library_example_external
kobuki_velocity_smoother
launch_pytest
launch_testing_ament_cmake
test_launch_testing
launch_testing_ros
nav2_amcl
nav2_bringup
nav2_core
nav2_costmap_2d
nav2_map_server
nav2_route
nav2_system_tests
ament_nodl
rcl
rcl_logging_noop
rclc
rclcpp_components
rcutils
ros1_bridge
controller_manager
rqt_controller_manager
rqt_joint_trajectory_controller
plansys2_bringup
ros2action
ros2doctor
ros2interface
ros2lifecycle
ros2node
ros2param
ros2pkg
ros2service
ros2topic
ros2launch_security_examples
ros_gz_bridge
test_ros_gz_bridge
ros2test
ros_testing
ros2bag
test_cli_remapping
test_communication
test_rclcpp
test_security
topic_based_ros2_control
ros_core
webots_ros2_tests
autoware_default_adapi
mujoco_ros2_control_tests
ros2ai
adi_iio
automatika_ros_sugar
rosgraph_monitor_test
greenwave_monitor
mola_state_estimation_smoother
network_bridge
play_motion2_cli
soar_ros
ros2_medkit_integration_tests
ros2_medkit_graph_watchdog
jig_example
roadmap_explorer
kuka_gazebo
mapoi_server
franka_bringup
franka_fr3_moveit_config
franka_gripper
franka_spine_server
stcamera_components
stcamera_grabber
stcamera_launch

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged launch_testing at Robotics Stack Exchange

No version for distro noetic showing humble. Known supported distros are highlighted in the buttons above.

Package Summary

Version 1.0.15
License Apache License 2.0
Build type AMENT_PYTHON
Use RECOMMENDED

Repository Summary

Description
Checkout URI https://github.com/ros2/launch.git
VCS Type git
VCS Version humble
Last Updated 2026-10-13
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

A package to create tests which involve launch files and multiple processes.

Maintainers

  • Aditya Pande
  • Michel Hidalgo

Authors

  • Dirk Thomas
  • Esteve Fernandez
  • Pete Baughman
  • William Woodall

launch_testing

This tool is a framework for launch integration testing. For example:

  • The exit codes of all processes are available to the tests.
  • Tests can check that all processes shut down normally, or with specific exit codes.
  • Tests can fail when a process dies unexpectedly.
  • The stdout and stderr of all processes are available to the tests.
  • The command-line used to launch the processes are available to the tests.
  • Some tests run concurrently with the launch and can interact with the running processes.

Quick start example

Start with the launch_testing example good_proc_launch_test.py.

Run the example by doing:

launch_test test/launch_testing/examples/good_proc_launch_test.py

launch_test will launch the nodes found in the generate_test_description function, run the tests from the TestGoodProcess class, shut down the launched nodes, and then run the tests from the TestProcessOutput class.

The Launch Description

def generate_test_description():

    return launch.LaunchDescription([
        launch.actions.ExecuteProcess(
            cmd=[path_to_process],
        ),

        # Start tests right away - no need to wait for anything in this example.
        # In a more complicated launch description, we might want this action happen
        # once some process starts or once some other event happens
        launch_testing.actions.ReadyToTest()
    ])

The generate_test_description function should return a launch.LaunchDescription object that launches the system to be tested.

The launch description needs to include a ReadyToTest action to signal to the test framework that it’s safe to start the active tests.

In the above example, there is no need to delay the start of the tests so the ReadyToTest action is a peer to the process under test and will signal to the framework that it’s safe to start around the same time the ExecuteProcess action is run.

Active Tests

Any classes that inherit from unittest.TestCase and not decorated with the post_shutdown_test descriptor will be run concurrently with the process under test. These tests are expected to interact with the running processes in some way.

Post-Shutdown Tests

Any classes that inherit from unittest.TestCase that are decorated with the post_shutdown_test descriptor will be run after the launched processes have been shut down. These tests have access to the exit codes and the stdout of all of the launched processes, as well as any data created as a side-effect of running the processes.

Exit Codes and Standard Out

The launch_testing framework automatically adds some member fields to each test case so that the tests can access process output and exit codes.

These objects provide dictionary like access to information about the running processes. They also contain methods that the active tests can use to wait for a process to exit or to wait for specific output.

Assertions

The launch_testing framework automatically records all stdout from the launched processes as well as the exit codes from any processes that are launched. This information is made available to the tests via the proc_info and proc_output object. These objects can be used by one of several assert methods to check the output or exit codes of the process:

launch_testing.asserts.assertInStdout(proc_output, msg, process, cmd_args=None, *, strict_proc_matching=True)

Asserts that a message is found in the stdout of a particular process.

  • msg:

    The text to look for in the process standard out

  • process:

    Either the process name as a string, or a launch.actions.ExecuteProcess object that was used to start the process. Pass None or an empty string to search all processes.

  • cmd_args:

    When looking up processes by process by name, cmd_args can be used to disambiguate multiple processes with the same name.

  • strict_proc_matching:

    When looking up a process by name, strict_proc_matching=True will make it an error to match multiple processes. This prevents an assert from accidentally passing if the output came from a different process than the one the user was expecting.

launch_testing.asserts.assertExitCodes(proc_info, allowable_exit_codes=[EXIT_OK], process, cmd_args=None, *, strict_proc_matching=True)

Asserts that the specified processes exited with a particular exit code.

  • allowable_exit_codes:

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package launch_testing

1.0.15 (2026-09-06)

  • Correct typos (backport #961) (#964)
  • Contributors: mergify[bot]

1.0.14 (2026-01-12)

  • Fixed typos (backport #692) (#693)
  • Contributors: mergify[bot]

1.0.13 (2025-11-07)

1.0.12 (2025-10-17)

1.0.11 (2025-10-06)

1.0.10 (2025-07-16)

1.0.9 (2025-06-06)

1.0.8 (2025-03-25)

1.0.7 (2024-11-25)

1.0.6 (2024-05-17)

  • Add consider_namespace_packages=False (#766) (#777)
  • Contributors: mergify[bot]

1.0.5 (2024-02-16)

1.0.4 (2023-01-10)

  • Allow ReadyToTest() usage in event handler (#681)
  • Inherit markers from generate_test_description (#670) (#674)
  • Contributors: Nikolai Morin, mergify[bot]

1.0.3 (2022-10-18)

  • Fix Typo (#641) (#644)
  • Switch to using a comprehension for process_names. (#614) (#615)
  • Contributors: mergify[bot]

1.0.2 (2022-05-10)

1.0.1 (2022-04-13)

1.0.0 (2022-04-12)

  • Removed the deprecated [ready_fn]{.title-ref} feature (#589)
  • Contributors: William Woodall

0.23.1 (2022-04-08)

0.23.0 (2022-03-30)

0.22.0 (2022-03-28)

0.21.1 (2022-03-01)

  • Added case for instances of ExecuteLocal in resolveProcess function (#587)
  • Add compatitibility with pytest 7 (#592)
  • Contributors: Matt Lanting, Shane Loretz

0.21.0 (2022-01-14)

  • Renamed three files from example_processes (#573)
  • Fix launch_testing README.md proc keyword to process. (#554) (#560)
  • Contributors: Jacob Perron, Khush Jain

0.20.0 (2021-11-29)

  • Declare frontend group dependency & use explicit dependencies in launch_testing (#520)
  • Update maintainers to Aditya Pande and Michel Hidalgo (#559)
  • Updated maintainers (#555)
  • First prototype of native pytest plugin for launch based tests (#528)

File truncated at 100 lines see the full file

Dependant Packages

Name Deps
async_web_server_cpp
beluga_example
diagnostic_updater
flexbe_core
flexbe_onboard
flexbe_testing
fmi_adapter
gps_tools
gpsd_client
stereo_image_proc
joint_state_publisher
swri_transform_util
moveit_task_constructor_capabilities
moveit_task_constructor_visualization
mrpt_navigation
mrpt_trajectory_follower
novatel_oem7_driver
realsense2_camera
robot_calibration
slam_toolbox
joy_teleop
twist_mux
composition
demo_nodes_cpp
demo_nodes_cpp_native
image_tools
intra_process_demo
logging_demo
pendulum_control
quality_of_service_demo_cpp
dolly_tests
domain_bridge
dynamixel_hardware
launch_testing_examples
generate_parameter_library_example
generate_parameter_library_example_external
kobuki_velocity_smoother
launch_pytest
launch_testing_ament_cmake
test_launch_testing
launch_testing_ros
nav2_amcl
nav2_bringup
nav2_core
nav2_costmap_2d
nav2_map_server
nav2_route
nav2_system_tests
ament_nodl
rcl
rcl_logging_noop
rclc
rclcpp_components
rcutils
ros1_bridge
controller_manager
rqt_controller_manager
rqt_joint_trajectory_controller
plansys2_bringup
ros2action
ros2doctor
ros2interface
ros2lifecycle
ros2node
ros2param
ros2pkg
ros2service
ros2topic
ros2launch_security_examples
ros_gz_bridge
test_ros_gz_bridge
ros2test
ros_testing
ros2bag
test_cli_remapping
test_communication
test_rclcpp
test_security
topic_based_ros2_control
ros_core
webots_ros2_tests
autoware_default_adapi
mujoco_ros2_control_tests
ros2ai
adi_iio
automatika_ros_sugar
rosgraph_monitor_test
greenwave_monitor
mola_state_estimation_smoother
network_bridge
play_motion2_cli
soar_ros
ros2_medkit_integration_tests
ros2_medkit_graph_watchdog
jig_example
roadmap_explorer
kuka_gazebo
mapoi_server
franka_bringup
franka_fr3_moveit_config
franka_gripper
franka_spine_server
stcamera_components
stcamera_grabber
stcamera_launch

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged launch_testing at Robotics Stack Exchange