fix: use the mcp user CM for the its tests#1295
Conversation
Signed-off-by: fege <fmosca@redhat.com>
|
The following are automatically added/executed:
Available user actions:
Supported labels{'/hold', '/verified', '/build-push-pr-image', '/cherry-pick', '/wip', '/lgtm'} |
📝 WalkthroughWalkthroughRefactoring updates test infrastructure to use a new MCP-specific ConfigMap constant ( Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 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.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
tests/model_registry/mcp_servers/constants.py (1)
191-191:⚠️ Potential issue | 🟠 MajorInconsistent path for
MCP_SERVERS_YAML3_CATALOG_PATH.This path still uses
/data/user-sources/while lines 6, 89, and 139 were updated to/data/user-mcp-sources/. Themcp_source_label_configmap_patchfixture (intests/model_registry/mcp_servers/config/conftest.pylines 87-93) writesmcp-servers-3.yamlto the ConfigMap, but the catalog source at line 213 references the old mount path. This will cause source 3 to fail YAML resolution.Proposed fix
-MCP_SERVERS_YAML3_CATALOG_PATH: str = "/data/user-sources/mcp-servers-3.yaml" +MCP_SERVERS_YAML3_CATALOG_PATH: str = "/data/user-mcp-sources/mcp-servers-3.yaml"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tests/model_registry/mcp_servers/constants.py` at line 191, The constant MCP_SERVERS_YAML3_CATALOG_PATH currently points to "/data/user-sources/mcp-servers-3.yaml" which is inconsistent with the other constants and the mcp_source_label_configmap_patch fixture; update MCP_SERVERS_YAML3_CATALOG_PATH to use "/data/user-mcp-sources/mcp-servers-3.yaml" so the catalog source (the YAML referenced for source 3) matches the ConfigMap mount and resolves correctly.
🧹 Nitpick comments (1)
tests/model_registry/mcp_servers/config/conftest.py (1)
76-78: Docstring inconsistency: still references "model-catalog-sources".The fixture actually patches the
mcp-catalog-sourcesConfigMap viaget_mcp_catalog_sources(), which usesDEFAULT_MCP_CATALOG_CM. Update docstring for consistency with line 38.Proposed fix
""" - Class-scoped fixture that patches the model-catalog-sources ConfigMap + Class-scoped fixture that patches the mcp-catalog-sources ConfigMap with three MCP catalog sources: two labeled and one unlabeled. Used for sourceLabel filtering tests (TC-API-036 to TC-API-039). """🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tests/model_registry/mcp_servers/config/conftest.py` around lines 76 - 78, Update the fixture docstring to correctly reference "mcp-catalog-sources" instead of "model-catalog-sources" to match the behavior of get_mcp_catalog_sources() which patches DEFAULT_MCP_CATALOG_CM; locate the class-scoped fixture in conftest.py (the one that calls get_mcp_catalog_sources()) and change its descriptive text to mention mcp-catalog-sources and that it patches three MCP catalog sources (two labeled and one unlabeled) used for sourceLabel filtering tests.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@tests/model_registry/mcp_servers/constants.py`:
- Line 191: The constant MCP_SERVERS_YAML3_CATALOG_PATH currently points to
"/data/user-sources/mcp-servers-3.yaml" which is inconsistent with the other
constants and the mcp_source_label_configmap_patch fixture; update
MCP_SERVERS_YAML3_CATALOG_PATH to use
"/data/user-mcp-sources/mcp-servers-3.yaml" so the catalog source (the YAML
referenced for source 3) matches the ConfigMap mount and resolves correctly.
---
Nitpick comments:
In `@tests/model_registry/mcp_servers/config/conftest.py`:
- Around line 76-78: Update the fixture docstring to correctly reference
"mcp-catalog-sources" instead of "model-catalog-sources" to match the behavior
of get_mcp_catalog_sources() which patches DEFAULT_MCP_CATALOG_CM; locate the
class-scoped fixture in conftest.py (the one that calls
get_mcp_catalog_sources()) and change its descriptive text to mention
mcp-catalog-sources and that it patches three MCP catalog sources (two labeled
and one unlabeled) used for sourceLabel filtering tests.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: 97a3999f-4a0c-4190-8992-9f6577e8c6b6
📒 Files selected for processing (5)
tests/model_registry/conftest.pytests/model_registry/constants.pytests/model_registry/mcp_servers/config/conftest.pytests/model_registry/mcp_servers/config/utils.pytests/model_registry/mcp_servers/constants.py
|
Status of building tag latest: success. |
Pull Request
Summary
Related Issues
How it has been tested
Additional Requirements
Summary by CodeRabbit