test: add coverage for mcp tools#1314
Conversation
Signed-off-by: fege <fmosca@redhat.com>
|
The following are automatically added/executed:
Available user actions:
Supported labels{'/build-push-pr-image', '/hold', '/verified', '/wip', '/cherry-pick', '/lgtm'} |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughTest suite for MCP server data integrity extended: validates Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 1 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@tests/model_registry/mcp_servers/test_data_integrity.py`:
- Around line 51-55: The test currently only checks each server's tool count and
can falsely pass when response.get("items") is empty; add an assertion before
the loop that response.get("items") is a non-empty iterable (e.g., assert
response.get("items"), or assert len(response.get("items", [])) > 0) to ensure
at least one server was returned, then proceed to iterate over
response.get("items", []) and validate each server's "tools" length against
tool_limit (symbols: response, items, tool_limit).
- Around line 64-69: Replace the use of execute_get_command and the
ResourceNotFoundError assertion with a direct call to execute_get_call to assert
the HTTP status code; specifically, call execute_get_call with
url=f"{mcp_catalog_rest_urls[0]}mcp_servers",
headers=model_registry_rest_headers,
params={"includeTools":"true","toolLimit":"101"} and assert the returned
response.status_code equals 400 (or the expected validation status) so the test
checks the API contract rather than the wrapper raising ResourceNotFoundError.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: 472abebe-90d6-4e19-8654-0810c10c1099
📒 Files selected for processing (1)
tests/model_registry/mcp_servers/test_data_integrity.py
Signed-off-by: fege <fmosca@redhat.com>
|
Status of building tag latest: success. |
Pull Request
Summary
Related Issues
Please review and indicate how it has been tested
Additional Requirements
Summary by CodeRabbit