Add unit tests for operation handlers#290
Merged
bburda merged 2 commits intoselfpatch:mainfrom Mar 19, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new GTest suite for OperationHandlers in ros2_medkit_gateway, exercising service/action execution paths and key error responses related to issue #181, and wires the new test target into the gateway’s CMake test configuration.
Changes:
- Added
test_operation_handlers.cppcovering operation listing, operation metadata lookup, execution lifecycle (create/list/get/update/cancel), and validation/not-found cases. - Updated
ros2_medkit_gatewayCMake to build/link/register the newtest_operation_handlerstarget and add required dependencies.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 9 comments.
| File | Description |
|---|---|
src/ros2_medkit_gateway/test/test_operation_handlers.cpp |
New unit tests for OperationHandlers (service + action paths, validation failures, and not-found handling). |
src/ros2_medkit_gateway/CMakeLists.txt |
Registers the new gtest target, adds dependencies, and assigns a ROS_DOMAIN_ID for isolation. |
f632835 to
8ca2091
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Summary
Add unit tests for
OperationHandlersand register the new gateway test target/dependencies. The new coverage exercises service and action execution paths, validation failures, and not-found responses for issue #181.Issue
Link the related issue (required):
Type
Testing
Tested in Docker using
ros:jazzy-ros-base.colcon build --packages-up-to ros2_medkit_gateway --build-base /tmp/colcon/build --install-base /tmp/colcon/install --event-handlers console_direct+ --cmake-args -DBUILD_TESTING=ONcolcon test --packages-select ros2_medkit_gateway --build-base /tmp/colcon/build --install-base /tmp/colcon/install --event-handlers console_direct+ --return-code-on-test-failurecolcon test-result --test-result-base /tmp/colcon/build --verboseResult:
ros2_medkit_gateway57/57 passed, includingtest_operation_handlers12/12.Note: a workspace-wide
colcon buildattempt in the same image hit an unrelated GCC 13 internal compiler error while buildingros2_medkit_linux_introspection.Checklist