Skip to content

test(mcp-integrations): add Kubernetes MCP actions integration coverage - #4549

Open
HusneShabbir wants to merge 4 commits into
redhat-developer:mainfrom
HusneShabbir:test/mcp-integrations-kubernetes-mcp-actions
Open

test(mcp-integrations): add Kubernetes MCP actions integration coverage#4549
HusneShabbir wants to merge 4 commits into
redhat-developer:mainfrom
HusneShabbir:test/mcp-integrations-kubernetes-mcp-actions

Conversation

@HusneShabbir

@HusneShabbir HusneShabbir commented Sep 2, 2026

Copy link
Copy Markdown
Member

Description

This PR was planned using the automation-coverage MCP against the mcp-integrations workspace (workspaces/mcp-integrations). That MCP analyzed the kubernetes-mcp-extras plugin inventory, compared gaps against Orchestrator and Scorecard MCP integration patterns, and recommended L2 startTestBackend / MCP protocol coverage for the actions introduced in #4426.

No published plugin src/ changed, so there is no changeset. HTTP/RBAC/service-error scenarios for the action handlers remain covered by the existing unit tests; this PR adds MCP wiring and protocol-level integration coverage.

The dedicated Kubernetes integration harness loads only kubernetes-mcp-extras and mcpPlugin (matching the Orchestrator pattern), not every MCP extras plugin in the workspace.

Resolves: https://redhat.atlassian.net/browse/RHIDP-15229

Tests added by layer

Cheapest layer that can catch the failure wins. The same assertion is not duplicated downstream.

L1 — Unit (existing, unchanged)

File What it covers
plugins/kubernetes-mcp-extras/src/actions/createGetKubernetesClustersAction.test.ts Cluster list mapping, on-behalf-of token usage, upstream API failures
plugins/kubernetes-mcp-extras/src/actions/createGetKubernetesResourcesForEntityAction.test.ts Entity ref defaults, resource passthrough, backend error messages

L2 — Integration (startTestBackend + MCP client)

File What it covers
plugins/kubernetes-mcp-extras/src/plugin.integration.test.ts New: registers get-kubernetes-clusters and get-kubernetes-resources-for-entity
packages/backend/src/kubernetes-mcp-tools.integration.test.ts New: tools/list read-only MCP annotations (presence + metadata); pluginSources filtering; input validation errors for missing/invalid name
packages/backend/src/mcp-tools.integration.test.ts Extended: includes Kubernetes tools in the combined overlay MCP suite

Not in this PR: overlay smoke/e2e, cluster-free e2e, cluster e2e, or full tools/call happy-path tests against mocked kubernetes-backend HTTP (actions use dynamic node-fetch imports that Jest cannot intercept reliably in this backend harness).

Test plan

  • yarn workspace @red-hat-developer-hub/backstage-plugin-kubernetes-mcp-extras test
  • yarn workspace backend test:integration in workspaces/mcp-integrations/packages/backend

Checklist

  • A changeset describing the change and affected packages. (more info)
  • Added or Updated documentation
  • Tests for new functionality and regression tests for bug fixes
  • Screenshots attached (for UI changes)

Add plugin and MCP protocol integration tests for kubernetes-mcp-extras,
aligned with Orchestrator and Scorecard MCP patterns from PR redhat-developer#4426.

Signed-off-by: HusneShabbir <husneshabbir447@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@rhdh-gh-app

rhdh-gh-app Bot commented Sep 2, 2026

Copy link
Copy Markdown

Changed Packages

Package Name Package Path Changeset Bump Current Version
backend workspaces/mcp-integrations/packages/backend none v0.0.0

Fixes tsc:full CI failure in kubernetes-mcp-extras plugin integration test.

Signed-off-by: HusneShabbir <husneshabbir447@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@codecov

codecov Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.26%. Comparing base (f64d720) to head (d5dff13).
⚠️ Report is 10 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4549   +/-   ##
=======================================
  Coverage   62.26%   62.26%           
=======================================
  Files        2606     2606           
  Lines      104644   104648    +4     
  Branches    29428    29428           
=======================================
+ Hits        65155    65160    +5     
+ Misses      38927    38926    -1     
  Partials      562      562           
Flag Coverage Δ *Carryforward flag
adoption-insights 84.30% <ø> (ø) Carriedforward from d7056f5
ai-integrations 76.15% <ø> (ø) Carriedforward from d7056f5
app-defaults 56.22% <ø> (ø) Carriedforward from d7056f5
augment 46.67% <ø> (ø) Carriedforward from d7056f5
boost 80.51% <ø> (ø) Carriedforward from d7056f5
bulk-import 73.12% <ø> (ø) Carriedforward from d7056f5
cost-management 13.55% <ø> (ø) Carriedforward from d7056f5
dcm 73.47% <ø> (ø) Carriedforward from d7056f5
e2e-adoption-insights 60.00% <ø> (ø) Carriedforward from d7056f5
e2e-extensions 62.32% <ø> (ø) Carriedforward from d7056f5
e2e-global-header 50.35% <ø> (ø) Carriedforward from d7056f5
e2e-homepage 61.11% <ø> (ø) Carriedforward from d7056f5
e2e-intelligent-assistant 47.04% <ø> (ø) Carriedforward from d7056f5
e2e-orchestrator 49.52% <ø> (ø) Carriedforward from d7056f5
e2e-orchestrator-plugin 49.51% <ø> (ø) Carriedforward from d7056f5
e2e-quickstart 55.21% <ø> (ø) Carriedforward from d7056f5
e2e-scorecard 50.21% <ø> (ø) Carriedforward from d7056f5
e2e-theme 16.36% <ø> (ø) Carriedforward from d7056f5
extensions 56.66% <ø> (ø) Carriedforward from d7056f5
global-floating-action-button 71.18% <ø> (ø) Carriedforward from d7056f5
global-header 68.09% <ø> (ø) Carriedforward from d7056f5
homepage 48.39% <ø> (ø) Carriedforward from d7056f5
install-dynamic-plugins 67.71% <ø> (ø) Carriedforward from d7056f5
intelligent-assistant 76.40% <ø> (ø) Carriedforward from d7056f5
konflux 91.98% <ø> (ø) Carriedforward from d7056f5
lightspeed 69.02% <ø> (ø) Carriedforward from d7056f5
mcp-integrations 84.46% <ø> (+0.31%) ⬆️
orchestrator 71.13% <ø> (ø) Carriedforward from d7056f5
quickstart 63.74% <ø> (ø) Carriedforward from d7056f5
sandbox 79.56% <ø> (ø) Carriedforward from d7056f5
scorecard 87.90% <ø> (ø) Carriedforward from d7056f5
theme 87.91% <ø> (ø) Carriedforward from d7056f5
translations 5.12% <ø> (ø) Carriedforward from d7056f5
x2a 77.10% <ø> (ø) Carriedforward from d7056f5

*This pull request uses carry forward flags. Click here to find out more.


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f64d720...d5dff13. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Load only kubernetes-mcp-extras and mcpPlugin in the integration test
backend, matching the Orchestrator pattern instead of all MCP extras plugins.

Co-authored-by: Cursor <cursoragent@cursor.com>
Drop redundant tools/list test and READ_ONLY_TOOL_NAMES alias; the
read-only metadata test already asserts both tools are exposed.

Co-authored-by: Cursor <cursoragent@cursor.com>
@sonarqubecloud

sonarqubecloud Bot commented Sep 3, 2026

Copy link
Copy Markdown

@HusneShabbir
HusneShabbir enabled auto-merge (squash) September 3, 2026 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants