testhost

package
v0.44.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2025 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

testhost provides an implementation of a test server for UCP.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TestHost

type TestHost struct {
	*testhost.TestHost
	// contains filtered or unexported fields
}

TestHost provides a test host for the UCP server.

func Start

func Start(t *testing.T, opts ...TestHostOption) *TestHost

Start creates and starts a new TestServer.

func StartWithOptions

func StartWithOptions(t *testing.T, options *ucp.Options) *TestHost

func (*TestHost) Options

func (th *TestHost) Options() *ucp.Options

Internals provides access to the internal options of the server. This allows tests to access the data stores and manipulate the server state.

func (*TestHost) UCP

UCP provides access to the generated clients for the UCP API.

type TestHostOption

type TestHostOption interface {
	// Apply applies the configuration to the UCP options.
	Apply(options *ucp.Options)
}

TestHostOption can be used to configure the UCP options before the server is started.

type TestHostOptionFunc

type TestHostOptionFunc func(options *ucp.Options)

TestHostOptionFunc is a function that implements the TestHostOption interface.

func NoModules

func NoModules() TestHostOptionFunc

NoModules is a TestHostOption that disables all UCP modules.

func (TestHostOptionFunc) Apply

func (f TestHostOptionFunc) Apply(options *ucp.Options)

Apply applies the function to the UCP options.

type TestServerMocks

type TestServerMocks struct {
	// DatabaseClient is the mock database client.
	DatabaseClient *database.MockClient

	// DatabaseProvider is the mock database provider.
	DatabaseProvider *databaseprovider.DatabaseProvider

	// QueueClient is the mock queue client.
	QueueClient *queue.MockClient

	// QueueProvider is the mock queue provider.
	QueueProvider *queueprovider.QueueProvider

	// SecretClient is the mock secret client.
	SecretClient *secret.MockClient

	// SecretProvider is the mock secret provider.
	SecretProvider *secretprovider.SecretProvider

	// StatusManager is the mock status manager.
	StatusManager *statusmanager.MockStatusManager
}

TestServerMocks provides access to mock instances created by the TestServer.

func NewMocks

func NewMocks(t *testing.T) *TestServerMocks

NewMocks creates a new set of mocks for the test server.

func (*TestServerMocks) Apply

func (m *TestServerMocks) Apply(options *ucp.Options)

Apply updates the UCP options to use the mocks.

Jump to

Keyboard shortcuts

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