Skip to content

refactor(services): migrate to rosapi_service()/rosapi_type(), add tool tests (step4)#322

Open
stex2005 wants to merge 4 commits intofeature/step3from
feature/step4
Open

refactor(services): migrate to rosapi_service()/rosapi_type(), add tool tests (step4)#322
stex2005 wants to merge 4 commits intofeature/step3from
feature/step4

Conversation

@stex2005
Copy link
Copy Markdown
Collaborator

@stex2005 stex2005 commented Apr 7, 2026

Summary

Step 4 of 7 — targets feature/step3 (#281)

  • Replace 12 hardcoded /rosapi/ strings in services.py (6 service paths + 6 type strings) with rosapi_service()/rosapi_type()
  • Integration tests call actual MCP tools (get_services, get_service_type, get_service_details, call_service) directly
  • Tests cover happy paths and negative paths (empty/whitespace input, nonexistent service)

Changes

  • ros_mcp/tools/services.py — import helpers, replace 12 hardcoded strings (+13 -12)
  • tests/integration/test_services.py — 12 tests
  • tests/integration/scripts/run-services-tests.sh — per-module test runner

Testing

12 tests pass on all 4 distros (melodic, noetic, humble, jazzy), zero skips.

PR stack

Step PR Status
Step 0: detection + Docker infra #276 merged
Step 1: connection + robot config #278 merged
Step 2: nodes #280 open
Step 3: topics #281 open
Step 4: services this PR open
Step 5: actions #321 open
Step 6: parameters (not created)
Step 7: resources (not created)

Replaces #316 which was merged to the wrong base branch.

Copy link
Copy Markdown
Contributor

@r-johnv r-johnv left a comment

Choose a reason for hiding this comment

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

Same comment as the previous two reviews. rosapi_service and rosapi_type need to have a default in the event that version is not detected.

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.

2 participants