Skip to content

Add unit tests for operation handlers#290

Merged
bburda merged 2 commits intoselfpatch:mainfrom
eclipse0922:fix/operation-handler-tests-181
Mar 19, 2026
Merged

Add unit tests for operation handlers#290
bburda merged 2 commits intoselfpatch:mainfrom
eclipse0922:fix/operation-handler-tests-181

Conversation

@eclipse0922
Copy link
Contributor

@eclipse0922 eclipse0922 commented Mar 19, 2026

Pull Request

Summary

Add unit tests for OperationHandlers and 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

  • Bug fix
  • New feature or tests
  • Breaking change
  • Documentation only

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=ON
  • colcon test --packages-select ros2_medkit_gateway --build-base /tmp/colcon/build --install-base /tmp/colcon/install --event-handlers console_direct+ --return-code-on-test-failure
  • colcon test-result --test-result-base /tmp/colcon/build --verbose

Result: ros2_medkit_gateway 57/57 passed, including test_operation_handlers 12/12.

Note: a workspace-wide colcon build attempt in the same image hit an unrelated GCC 13 internal compiler error while building ros2_medkit_linux_introspection.


Checklist

  • Breaking changes are clearly described (and announced in docs / changelog if needed) - no breaking changes in this PR
  • Tests were added or updated if needed
  • Docs were updated if behavior or public API changed - not needed for this test-only change

@bburda bburda requested review from bburda and Copilot and removed request for Copilot March 19, 2026 09:07
@bburda bburda requested a review from Copilot March 19, 2026 09:17
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.cpp covering operation listing, operation metadata lookup, execution lifecycle (create/list/get/update/cancel), and validation/not-found cases.
  • Updated ros2_medkit_gateway CMake to build/link/register the new test_operation_handlers target 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.

@eclipse0922 eclipse0922 force-pushed the fix/operation-handler-tests-181 branch from f632835 to 8ca2091 Compare March 19, 2026 12:13
Copy link
Collaborator

@bburda bburda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@bburda bburda merged commit 6f462e5 into selfpatch:main Mar 19, 2026
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add unit tests for OperationHandlers

3 participants