Skip to content

Add integration tests for MCPRemoteProxy resource references#3608

Open
ChrisJBurns wants to merge 6 commits intomainfrom
mcp-remote-proxy-int-tests
Open

Add integration tests for MCPRemoteProxy resource references#3608
ChrisJBurns wants to merge 6 commits intomainfrom
mcp-remote-proxy-int-tests

Conversation

@ChrisJBurns
Copy link
Collaborator

@ChrisJBurns ChrisJBurns commented Feb 4, 2026

Summary

  • Add integration tests for MCPRemoteProxy controller's integration with other resources (ExternalAuthConfigRef, ToolConfigRef, GroupRef)
  • Add helper methods to reduce test duplication (WaitForPhase)
  • Add builder methods for setting resource references (WithExternalAuthConfigRef, WithToolConfigRef, WithGroupRef)

Test Coverage Added

ExternalAuthConfigRef Integration (3 tests)

  • Fails validation when referenced MCPExternalAuthConfig does not exist
  • Successfully reconciles when referenced MCPExternalAuthConfig exists
  • Triggers reconciliation when MCPExternalAuthConfig is updated (hash tracking)

ToolConfigRef Integration (3 tests)

  • Fails validation when referenced MCPToolConfig does not exist
  • Successfully reconciles when referenced MCPToolConfig exists
  • Propagates tool config changes to the RunConfig ConfigMap (hash tracking)

GroupRef Integration (5 tests)

  • Sets GroupRefValidated condition to False when MCPGroup does not exist
  • Sets GroupRefValidated condition to True when MCPGroup exists and is Ready
  • Sets GroupRefValidated condition to False when MCPGroup is not Ready
  • Does not have GroupRefValidated condition when no GroupRef is specified
  • Updates GroupRefValidated condition when MCPGroup becomes Ready

Test plan

  • Tests compile successfully
  • Code passes go vet and gofmt
  • Tests pass in CI with envtest

Related Issues

Closes #3362 (Integration with Other Resources section)

See also #3607 for a follow-up to add structured status conditions for ToolConfigRef and ExternalAuthConfigRef validation.

🤖 Generated with Claude Code

Signed-off-by: Chris Burns <29541485+ChrisJBurns@users.noreply.github.com>
@github-actions github-actions bot added the size/L Large PR: 600-999 lines changed label Feb 4, 2026
- Add WaitForPhase helper to reduce test duplication
- Add WaitForStatusMessage helper for status message assertions
- Update ExternalAuthConfigRef and ToolConfigRef tests to use helpers
- Improve "not found" assertions to verify both config name and
  "not found" substring for stronger validation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@ChrisJBurns ChrisJBurns force-pushed the mcp-remote-proxy-int-tests branch from 1f6e931 to fa890fc Compare February 4, 2026 21:45
@github-actions github-actions bot added size/L Large PR: 600-999 lines changed and removed size/L Large PR: 600-999 lines changed labels Feb 4, 2026
@codecov
Copy link

codecov bot commented Feb 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.72%. Comparing base (a360fa4) to head (c547624).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3608      +/-   ##
==========================================
- Coverage   65.77%   65.72%   -0.06%     
==========================================
  Files         411      411              
  Lines       40727    40727              
==========================================
- Hits        26790    26767      -23     
- Misses      11853    11877      +24     
+ Partials     2084     2083       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

The MCPGroup controller requires a field index for MCPServer.Spec.GroupRef
to list servers belonging to a group. This was missing from the
mcp-remote-proxy test suite, causing failures when tests created MCPGroups.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions github-actions bot added size/L Large PR: 600-999 lines changed and removed size/L Large PR: 600-999 lines changed labels Feb 5, 2026
@github-actions github-actions bot added size/L Large PR: 600-999 lines changed and removed size/L Large PR: 600-999 lines changed labels Feb 5, 2026
- ToolConfigRef "not found" test: Adjusted assertion to check only Phase=Failed
  since the controller doesn't set status.Message for ToolConfig validation
  failures (only logs the error). This is tracked in issue #3607.

- GroupRef "not Ready" test: Removed test that tried to manually set MCPGroup
  status to Pending, which doesn't work because the MCPGroup controller
  immediately reconciles empty groups to Ready state.

- GroupRef transition test: Changed from testing "not ready -> ready" to
  testing "not found -> found and ready", which avoids the race condition
  with the MCPGroup controller.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions github-actions bot added size/M Medium PR: 300-599 lines changed and removed size/L Large PR: 600-999 lines changed labels Feb 5, 2026
@github-actions github-actions bot added size/M Medium PR: 300-599 lines changed and removed size/M Medium PR: 300-599 lines changed labels Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Medium PR: 300-599 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Integration tests: MCPRemoteProxy Controller

1 participant