ROS 2 (Robot Operating System 2) is a robotics middleware framework widely used in research, industrial, and autonomous systems. ROS 2 workspaces contain a mix of C++ and Python packages, each with their own test framework. This page explains which Tesults integration to use for each scenario.
C++ ROS 2 packages use GoogleTest as their default test framework. Use gtest-tesults for deep integration with enhanced reporting — descriptions, steps, custom fields, and file uploads.
Add gtest-tesults to your CMakeLists.txt. Set TESULTS_TARGET and run colcon test or ctest as usual. See the gtest-tesults documentation for full setup instructions.
Python ROS 2 packages can use pytest as their test runner. Use pytest-tesults for deep integration. When running via colcon, pass --python-testing pytest to enable the pytest runner — colcon defaults to unittest otherwise.
Install pytest-tesults and add a pytest.ini with your target token to the package root. Then run:
TESULTS_TARGET=token colcon test --python-testing pytest
See the pytest-tesults documentation for full setup instructions.
Rust ROS 2 packages use rclrs as the Rust client library. Rust packages use the built-in #[test] framework, nextest, or rstest for unit testing. Use tesults-test for deep integration with enhanced reporting.
Add tesults-test to [dev-dependencies] in Cargo.toml and replace #[test] with #[tesults_test::test]. Set TESULTS_TARGET and run cargo test or cargo nextest run as usual. See the tesults-test documentation for full setup instructions.
launch_testing is used for system-level tests that spin up ROS 2 nodes and verify their behaviour. It uses pytest internally, so pytest-tesults covers launch_testing automatically — no separate setup needed.
If pytest-tesults is installed and configured, launch_testing results are reported to Tesults alongside your regular pytest tests with no additional steps. See the pytest-tesults documentation.
If you want results uploaded for all packages in a workspace without per-package setup, use colcon-tesults. It hooks into the colcon event system and reads JUnit XML output after colcon test completes — no changes to your test code or package configuration required.
colcon-tesults provides basic pass/fail results from JUnit XML. It does not support descriptions, steps, custom fields, or file uploads. For richer reporting use gtest-tesults (C++) or pytest-tesults (Python) instead. See the colcon-tesults documentation.
| Scenario | Integration | Reporting |
|---|---|---|
| C++ packages (GoogleTest) | gtest-tesults | Deep — descriptions, steps, files |
| Python packages (pytest) | pytest-tesults | Deep — descriptions, steps, files |
| Rust packages (#[test], nextest, rstest) | tesults-test | Deep — descriptions, steps, files |
| System tests (launch_testing) | pytest-tesults | Deep — covered automatically |
| Any package, zero config | colcon-tesults | Basic — pass/fail only |