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

stacklok / toolhive / 24307141501

12 Apr 2026 12:49PM UTC coverage: 65.531% (-0.05%) from 65.576%
24307141501

push

github

web-flow
Fix NewHandler using config.NewDefaultProvider instead of config.NewProvider (#4754)

* Add tests for NewHandler using config.NewProvider

NewHandler previously called config.NewDefaultProvider() directly for
both the config and registry provider, bypassing any registered
enterprise ProviderFactory. The fix (already applied) changes both
call sites to config.NewProvider().

Add unit tests that verify the two-step provider-initialization
sequence (config.NewProvider + registry.GetDefaultProviderWithConfig)
honours a registered ProviderFactory. NewHandler cannot be tested
end-to-end because workloads.NewManager requires a live container
runtime, so the tests exercise the initialization path in isolation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Remove server-package tests that test external packages

The tests in new_handler_test.go called only config.NewProvider() and
registry.GetDefaultProviderWithConfig() — no server package code — in
violation of testing.md's rule that tests must only test the package
under test.

Equivalent coverage already exists in the correct locations:
- pkg/config/factory_test.go covers NewProvider factory invocation
- pkg/registry/factory_test.go:TestGetDefaultProvider_RespectsRegisteredFactory
  covers the end-to-end factory → registry path with real registry content

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>

3 of 3 new or added lines in 1 file covered. (100.0%)

48 existing lines in 7 files now uncovered.

56509 of 86233 relevant lines covered (65.53%)

62.85 hits per line

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

79.38
/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