refactor(services): migrate to rosapi_service()/rosapi_type(), add tool tests (step4)#316
Merged
mokcontoro merged 11 commits intofeature/step2from Apr 6, 2026
Merged
refactor(services): migrate to rosapi_service()/rosapi_type(), add tool tests (step4)#316mokcontoro merged 11 commits intofeature/step2from
mokcontoro merged 11 commits intofeature/step2from
Conversation
run-tests.sh now accepts optional second arg: distro + module e.g. ./run-tests.sh humble topics Per-module wrappers: run-connection-tests.sh, run-detect_version-tests.sh, run-nodes-tests.sh, run-topics-tests.sh
- Add tests for subscribe_for_duration, publish_once, publish_for_durations - Add end-to-end test: publish cmd_vel, verify turtle moves via pose - Extract _get_type() helper to guard against missing type responses - Relax published_count assertion (rosbridge timing varies by distro) - All 8 topic tools now tested (20 tests)
This was referenced Apr 7, 2026
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.
Summary
Step 4 of 6 — targets
feature/step3(#281)/rosapi/strings inservices.py(6 service paths + 6 type strings) withrosapi_service()/rosapi_type()get_services,get_service_type,get_service_details,call_service) directlyChanges
ros_mcp/tools/services.py— import helpers, replace 12 hardcoded strings (+13 -12)tests/integration/test_services.py— 12 tests:get_services: returns services, includes rosapi services, includes turtlesim servicesget_service_type: known service type, empty error, whitespace errorget_service_details: spawn details, empty error, whitespace errorcall_service: clear (no args), spawn turtle (with args), nonexistent service (error)tests/integration/scripts/run-services-tests.sh— per-module test runnerTesting
12 tests pass on Jazzy (native), verified one-by-one against live rosbridge + turtlesim.
PR stack