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

stacklok / toolhive / 27968137730

22 Jun 2026 04:32PM UTC coverage: 67.153% (+0.03%) from 67.125%
27968137730

push

github

web-flow
Migrate MCPServer test fixtures to v1beta1test builder (#5566)

* Prototype v1beta1test fixture builders

Companion-package approach for CRD test fixtures: builders live next to
the types they construct (api/v1beta1/v1beta1test), httptest-style, with
functional options for the high-frequency fields only.

Includes NewMCPServer + options, a unit test, and one migrated call site
(mcpserver_groupref_test.go) to show real before/after readability. For
comparison against placing the same builders in internal/testutil before
we commit to one layout for the fixture-builder PR.

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

* Add central internal/testutil builder variant for comparison

Carry both placements in the prototype: the companion v1beta1test package
and a central internal/testutil version of the same NewMCPServer builder.
Migrate one exact-defaults call site (mcpserver_platform_test.go) using the
central variant — a behavior-identical migration, contrasting the
groupref site where the builder's defaults differ from the literal.

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

* Adopt companion v1beta1test for CRD fixtures

Drop the central internal/testutil builder variant (decision: CRD fixture
builders live next to their types; internal/testutil keeps cross-cutting
helpers only). Expand v1beta1test.NewMCPServer with the high-frequency
options (refs, proxy mode, args) plus a Mutate escape hatch, and re-point
the platform-test demo to the companion package.

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

* Migrate MCPServer test fixtures to v1beta1test builder

Replace inline mcpv1beta1.MCPServer{...} literals across operator unit
tests with v1beta1test.NewMCPServer(name, ns, opts...). Removes the
repeated ObjectMeta+Spec boilerplate; tests now read by intent.

Migrated 244 call sites; ~160 literals deliberately left inline (empty
Get/decode targets, large complex specs, and fixtur... (continued)

67 of 74 new or added lines in 1 file covered. (90.54%)

9 existing lines in 4 files now uncovered.

69725 of 103830 relevant lines covered (67.15%)

65.46 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