Skip to content

test(mcp-integrations): add MCP plugin and backend integration tests#3232

Open
HusneShabbir wants to merge 1 commit into
redhat-developer:mainfrom
HusneShabbir:test/mcp-integrations-integration-tests
Open

test(mcp-integrations): add MCP plugin and backend integration tests#3232
HusneShabbir wants to merge 1 commit into
redhat-developer:mainfrom
HusneShabbir:test/mcp-integrations-integration-tests

Conversation

@HusneShabbir
Copy link
Copy Markdown
Contributor

@HusneShabbir HusneShabbir commented May 24, 2026

Summary

Integration tests for MCP overlay plugins: plugin wiring (action registration) and backend MCP HTTP (tools/list, tools/call, auth).

Test file structure

workspaces/mcp-integrations/
├── plugins/
│   ├── software-catalog-mcp-extras/src/
│   │   └── plugin.integration.test.ts          # 1 test
│   ├── techdocs-mcp-extras/src/
│   │   └── plugin.integration.test.ts          # 1 test
│   └── scaffolder-mcp-extras/src/
│       └── plugin.integration.test.ts          # 1 test
└── packages/backend/src/
    └── mcp-tools.integration.test.ts           # 9 tests

Total: 4 files · 12 integration tests (runs in CI via yarn test:all)


Plugin tests — “does the plugin register the right actions?”

Each file starts startTestBackend, captures actionsRegistry.register(), and asserts action names + count.

File Actions
software-catalog-mcp-extras/.../plugin.integration.test.ts query-catalog-entities (1)
techdocs-mcp-extras/.../plugin.integration.test.ts fetch-techdocs, analyze-techdocs-coverage, retrieve-techdocs-content (3)
scaffolder-mcp-extras/.../plugin.integration.test.ts fetch-template-metadata, list-scaffolder-tasks, get-scaffolder-task-logs, list-scaffolder-actions, validate-scaffolder, execute-template (6)

Backend test — “does the MCP server work over HTTP?”

packages/backend/src/mcp-tools.integration.test.ts — real MCP client against /api/mcp-actions/v1.

Group Scenario
tools/list All 10 tools exposed with correct names
Description + inputSchema on every tool
Read-only / destructive MCP hint annotations
pluginSources filter → catalog-only returns 1 tool
tools/call query-catalog-entities{ entities: [] }
analyze-techdocs-coverage → zero coverage stats
fetch-template-metadata{ templates: [] }
auth No Bearer token → rejected
Valid Bearer token → tools/list succeeds

Supporting changes

  • Read-only action attributes on 5 actions (for MCP metadata tests)
  • Backend test deps + CI=true … --forceExit test script

CI

workspaces/mcp-integrationsTest changed packages → 15 suites, 132 tests pass (includes these 12 + existing unit tests).

@rhdh-gh-app
Copy link
Copy Markdown

rhdh-gh-app Bot commented May 24, 2026

Missing Changesets

The following package(s) are changed by this PR but do not have a changeset:

  • @red-hat-developer-hub/backstage-plugin-scaffolder-mcp-extras
  • @red-hat-developer-hub/backstage-plugin-software-catalog-mcp-extras
  • @red-hat-developer-hub/backstage-plugin-techdocs-mcp-extras

See CONTRIBUTING.md for more information about how to add changesets.

Changed Packages

Package Name Package Path Changeset Bump Current Version
backend workspaces/mcp-integrations/packages/backend none v0.0.0
@red-hat-developer-hub/backstage-plugin-scaffolder-mcp-extras workspaces/mcp-integrations/plugins/scaffolder-mcp-extras none v0.4.2
@red-hat-developer-hub/backstage-plugin-software-catalog-mcp-extras workspaces/mcp-integrations/plugins/software-catalog-mcp-extras none v0.2.3
@red-hat-developer-hub/backstage-plugin-techdocs-mcp-extras workspaces/mcp-integrations/plugins/techdocs-mcp-extras none v0.2.4

@HusneShabbir HusneShabbir requested a review from jrichter1 May 24, 2026 08:39
@codecov
Copy link
Copy Markdown

codecov Bot commented May 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.00%. Comparing base (815580b) to head (827b7fe).
⚠️ Report is 22 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3232      +/-   ##
==========================================
+ Coverage   60.97%   61.00%   +0.03%     
==========================================
  Files        2098     2098              
  Lines       65140    65150      +10     
  Branches    17029    17029              
==========================================
+ Hits        39721    39747      +26     
+ Misses      25180    25164      -16     
  Partials      239      239              
Flag Coverage Δ *Carryforward flag
adoption-insights 83.58% <ø> (ø) Carriedforward from 815580b
ai-integrations 70.03% <ø> (ø) Carriedforward from 815580b
app-defaults 69.60% <ø> (ø) Carriedforward from 815580b
augment 69.36% <ø> (ø) Carriedforward from 815580b
bulk-import 72.86% <ø> (ø) Carriedforward from 815580b
cost-management 16.49% <ø> (ø) Carriedforward from 815580b
dcm 32.85% <ø> (ø) Carriedforward from 815580b
extensions 61.79% <ø> (ø) Carriedforward from 815580b
global-floating-action-button 74.30% <ø> (ø) Carriedforward from 815580b
global-header 61.68% <ø> (ø) Carriedforward from 815580b
homepage 50.95% <ø> (ø) Carriedforward from 815580b
konflux 91.01% <ø> (ø) Carriedforward from 815580b
lightspeed 68.33% <ø> (ø) Carriedforward from 815580b
mcp-integrations 85.46% <ø> (+3.86%) ⬆️
orchestrator 36.36% <ø> (ø) Carriedforward from 815580b
quickstart 62.88% <ø> (ø) Carriedforward from 815580b
sandbox 79.42% <ø> (ø) Carriedforward from 815580b
scorecard 83.72% <ø> (ø) Carriedforward from 815580b
theme 64.54% <ø> (ø) Carriedforward from 815580b
translations 8.49% <ø> (ø) Carriedforward from 815580b
x2a 78.28% <ø> (ø) Carriedforward from 815580b

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


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 815580b...827b7fe. 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.

@HusneShabbir HusneShabbir force-pushed the test/mcp-integrations-integration-tests branch 2 times, most recently from 4921c97 to f1a9e17 Compare May 24, 2026 10:46
Add integration tests for action registration and MCP tools/list/call coverage,
including auth and pluginSources filtering. Mark read-only actions with MCP
attributes and configure backend test runner to exit cleanly after integration runs.

Co-authored-by: Cursor <cursoragent@cursor.com>
@HusneShabbir HusneShabbir force-pushed the test/mcp-integrations-integration-tests branch from f1a9e17 to 827b7fe Compare May 24, 2026 10:52
@sonarqubecloud
Copy link
Copy Markdown

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.

1 participant