ros2-testing

Provide unit, integration, and E2E testing patterns for ROS2 nodes.

Updated May 3, 2026
One-click install
npx skills add https://github.com/elliewlh2094/codex-robotics-skills --skill ros2-testing-elliewlh2094
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ros2-testing
Source: https://github.com/elliewlh2094/codex-robotics-skills/tree/main/.agents/skills/ros2-testing
Command: npx skills add https://github.com/elliewlh2094/codex-robotics-skills --skill ros2-testing-elliewlh2094

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill simplifies testing of ROS2 packages by providing patterns and tools for unit, integration, and end-to-end testing workflows, reducing flaky tests and speeding up development cycles.

Core Features & Use Cases

  • Unit Testing: Facilitates writing and running Python and C++ tests for ROS2 nodes and logic with minimal setup.
  • Integration Testing: Provides fixtures and helpers for spinning nodes, waiting for messages, and verifying system components in process.
  • End-to-End Testing: Supports launch testing to verify full system behavior with launch files, ensuring robustness before deployment.

Quick Start

Use the ros2-testing skill to write ROS2 tests that automatically initialize nodes, spin, and verify message flow.

Frequently Asked Questions about ros2-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write ROS2 integration tests that wait for messages without flakiness?

ROS2 integration testing can eliminate flakiness by using safe waiting mechanisms and fixtures to spin nodes and verify message flow in process. This provides consistent test results across environments by ensuring messages are reliably received before assertions run.

Can I use pytest and gtest together for ROS2 unit testing?

pytest and gtest are supported together for ROS2 unit testing, allowing you to write and run both Python and C++ tests for nodes and logic. This multi-language support requires minimal setup to validate core components.

What is ROS2 launch testing and when do I need it?

ROS2 launch testing is an end-to-end verification process that checks full system behavior using launch files. You need it to ensure robustness before deployment by validating how multiple nodes interact within the complete system architecture.

How do I set up ROS2 test fixtures for nodes running in process?

ROS2 test fixtures are set up using provided helpers that automatically initialize nodes and spin them within the test process. This configuration isolates components and verifies message flow without the overhead of external system launches.

Does ROS2 testing support both Python and C++ nodes?

ROS2 testing supports both Python and C++ nodes through dedicated pytest and gtest patterns. This multi-language support ensures you can test logic written in either language while maintaining consistent test results across your robotics software environments.