소스 정보
- 저장소
- harunkurtdev/ros2-claude-code-template
- 최근 소스 활동
- 2026년 2월 8일 22:47
- 감지된 SKILL.md 언어
- 영어
- 스타
- 213
- 포크
- 32
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/harunkurtdev/ros2-claude-code-template --skill ros2-testing명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SKILL.md 표시 중
SOC 직업 분류 기준
| name | ROS2 Testing |
| description | ROS2 test strategies and patterns with Clean Architecture (Python & C++) |
This skill provides test strategies for ROS2 applications adhering to Clean Architecture principles, covering Unit, Integration, and E2E tests in both Python and C++.
/\
/ \ E2E Tests (Launch Tests / System Tests)
/----\
/ \ Integration Tests (Node / Component Tests)
/--------\
/ \ Unit Tests (Domain / Application Logic)
/--------------\
tests/
├── unit/
│ ├── domain/
│ └── application/
├── integration/
│ └── ros2/
└── e2e/
└── launch_tests/
See the previous version for Python Unit Test examples. They remain valid as domain logic is pure Python.
# tests/integration/ros2/nodes/test_sensor_node.py
import pytest
import rclpy
from rclpy.node import Node
from std_msgs.msg import Float64
@pytest.fixture(scope='module')
def ros_context():
rclpy.init()
yield
rclpy.shutdown()
@pytest.fixture
def test_node(ros_context):
node = Node('test_helper')
yield node
node.destroy_node()
def test_sensor_integration(test_node):
# Verify node behavior by subscribing/publishing
pass
// tests/unit/domain/use_cases/test_robot_controller.cpp
#include <gtest/gtest.h>
#include <gmock/gmock.h>
#include "domain/use_cases/robot_controller.hpp"
#include "domain/entities/robot_state.hpp"
using namespace domain;
using ::testing::Return;
class MockRobotRepository : public repositories::IRobotRepository {
public:
MOCK_METHOD(entities::RobotState, get_state, (), (override));
MOCK_METHOD(void, set_mode, (entities::RobotMode), (override));
};
TEST(RobotControllerTest, StartFromIdle) {
auto mock_repo = std::make_shared<MockRobotRepository>();
use_cases::RobotControllerUseCase use_case(mock_repo);
EXPECT_CALL(*mock_repo, get_state())
.WillOnce(Return(entities::RobotState{entities::RobotMode::IDLE}));
EXPECT_CALL(*mock_repo, set_mode(entities::RobotMode::ACTIVE));
auto result = use_case.start();
EXPECT_TRUE(result.success);
}
// tests/integration/ros2/test_sensor_node.cpp
#include <gtest/gtest.h>
#include <rclcpp/rclcpp.hpp>
#include "infrastructure/ros2/nodes/sensor_node.hpp"
class SensorNodeTest : public ::testing::Test {
protected:
void SetUp() override {
rclcpp::init(0, nullptr);
node_ = std::make_shared<infrastructure::ros2::nodes::SensorNode>();
}
void TearDown() override {
rclcpp::shutdown();
}
std::shared_ptr<infrastructure::ros2::nodes::SensorNode> node_;
};
TEST_F(SensorNodeTest, Initialization) {
EXPECT_STREQ(node_->get_name(), "sensor_node");
}
You can run GTest executables from launch files to perform system-level tests.
# tests/e2e/launch_tests/system_test.launch.py
from launch import LaunchDescription
from launch_ros.actions import Node
from launch_testing.actions import ReadyToTest
def generate_launch_description():
# Launch system under test
app_node = Node(package='my_robot', executable='main_node')
# Launch GTest runner
test_runner = Node(
package='my_robot',
executable='system_integration_test',
output='screen'
)
return LaunchDescription([
app_node,
test_runner,
ReadyToTest()
])
unittest.mock for Python and gmock for C++.pytest.fixture and GTest SetUp/TearDown to manage ROS2 context (rclpy.init/shutdown).rclcpp::spin_some or wait_for_future to handle async operations.