aibridgedtest

package
v2.38.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL