Documentation
¶
Overview ¶
Package aibridgedtest provides helpers for starting an in-process aibridged daemon in tests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StartTestAIBridgeDaemon ¶
func StartTestAIBridgeDaemon( ctx context.Context, t testing.TB, api *coderd.API, metrics *aibridged.Metrics, )
StartTestAIBridgeDaemon wires an in-process aibridged daemon onto the supplied API through cli.NewAIBridgeDaemon, the same constructor cli/server.go uses. Tests that create AI provider rows with BaseURL pointing at fake upstream HTTP servers (e.g. chattest.NewOpenAI) will have their requests proxied through the real aibridged stack as they would in production, under the API's own deployment configuration.
metrics is the registry the daemon reports provider reload events to. The caller owns the metrics instance and can assert on it after the daemon runs. Use aibridged.NewMetrics to create one, or nil for a throwaway.
func StartTestAIBridgeDaemonWithPubsub ¶ added in v2.37.0
func StartTestAIBridgeDaemonWithPubsub( ctx context.Context, t testing.TB, api *coderd.API, metrics *aibridged.Metrics, ps pubsub.Pubsub, )
StartTestAIBridgeDaemonWithPubsub is StartTestAIBridgeDaemon with an explicit pubsub for the provider-reload subscription. A pubsub that is disconnected from api.Pubsub cuts the daemon off from provider change events, leaving the initial synchronous load as its only route source.
Types ¶
This section is empty.