• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stacklok / toolhive / 28030733319

23 Jun 2026 01:43PM UTC coverage: 67.285% (+0.02%) from 67.261%
28030733319

push

github

web-flow
Add reconciler test helpers to cut fake-client boilerplate (#5584)

* Add fake-client reconciler test helpers

Controller tests hand-rolled an 8-10 line fake-client + reconciler
assembly block at every call site. Add newTestVirtualMCPServerReconciler
and newTestMCPRemoteProxyReconciler, which build the fake client
internally and return both the reconciler and the client, collapsing each
block to one line. Migrate the matching call sites.

Only blocks whose fake client registers exactly the reconciler's own type
as a status subresource are migrated; blocks with extra status
subresources, custom interceptors, or indexes keep their inline builders.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Cover config controllers with reconciler test helpers

Rename mcpserver_test_helpers_test.go to reconciler_test_helpers_test.go
to reflect that it serves every controller test, not just MCPServer, and
factor the shared fake-client build into newTestFakeClient.

Add factories for the config-tier reconcilers (MCPExternalAuthConfig,
MCPOIDCConfig, MCPAuthzConfig), which carry Client/Scheme/Recorder rather
than the workload tier's PlatformDetector. Recorder is left nil so callers
that assert on events set it explicitly. Migrate the matching call sites.

As before, only blocks registering exactly the reconciler's own type as a
status subresource are migrated; absent, multi-type, or interceptor-based
builders keep their inline construction.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

70142 of 104246 relevant lines covered (67.29%)

65.61 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

80.42
/pkg/transport/proxy/httpsse/http_proxy.go


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc