test: add verification for filtering mcp server by source label#1285
test: add verification for filtering mcp server by source label#1285dbasunag merged 2 commits intoopendatahub-io:mainfrom
Conversation
Signed-off-by: fege <fmosca@redhat.com>
|
The following are automatically added/executed:
Available user actions:
Supported labels{'/verified', '/wip', '/lgtm', '/hold', '/build-push-pr-image', '/cherry-pick'} |
📝 WalkthroughWalkthroughPull request introduces testing infrastructure for MCP server filtering by source labels, including an unlabeled source variant. Changes add a new test fixture that patches the MCP catalog ConfigMap with three server YAML configurations, a new test module validating source label filtering behavior, supporting constants, and updates to existing model search tests to validate null/unlabeled source accounting. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 1 | ❌ 1❌ Failed checks (1 warning)
✅ 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/config/conftest.py`:
- Around line 83-86: The fixture currently blindly extends
current_data["mcp_catalogs"] with MCP_CATALOG_SOURCE, MCP_CATALOG_SOURCE2,
MCP_CATALOG_SOURCE3 which can create duplicates; update the logic around
current_data["mcp_catalogs"] to first ensure it's a list, compute the existing
set (from current_data["mcp_catalogs"]), and only append/extend those
MCP_CATALOG_* values that are not already present (e.g., filter the list
[MCP_CATALOG_SOURCE, MCP_CATALOG_SOURCE2, MCP_CATALOG_SOURCE3] by membership in
the existing set before extending) so duplicates are avoided.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: a8858fba-33d8-498a-a271-76abc8f6544c
📒 Files selected for processing (4)
tests/model_registry/mcp_servers/config/conftest.pytests/model_registry/mcp_servers/config/test_source_label.pytests/model_registry/mcp_servers/constants.pytests/model_registry/model_catalog/search/test_model_search.py
|
Status of building tag latest: success. |
Pull Request
Summary
Related Issues
How it has been tested
Additional Requirements
Summary by CodeRabbit
Tests