testutil

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package testutil provides test helpers for plugin integration tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockProviderPlugin

type MockProviderPlugin struct {
	GetProvidersFunc          func(ctx context.Context) ([]string, error)
	GetProviderDescriptorFunc func(ctx context.Context, providerName string) (*provider.Descriptor, error)
	ConfigureProviderFunc     func(ctx context.Context, providerName string, cfg plugin.ProviderConfig) error
	ExecuteProviderFunc       func(ctx context.Context, providerName string, input map[string]any) (*provider.Output, error)
	ExecuteProviderStreamFunc func(ctx context.Context, providerName string, input map[string]any, cb func(plugin.StreamChunk)) error
	DescribeWhatIfFunc        func(ctx context.Context, providerName string, input map[string]any) (string, error)
	ExtractDependenciesFunc   func(ctx context.Context, providerName string, inputs map[string]any) ([]string, error)
	StopProviderFunc          func(ctx context.Context, providerName string) error
}

MockProviderPlugin is a configurable mock that implements plugin.ProviderPlugin.

func (*MockProviderPlugin) ConfigureProvider

func (m *MockProviderPlugin) ConfigureProvider(ctx context.Context, providerName string, cfg plugin.ProviderConfig) error

func (*MockProviderPlugin) DescribeWhatIf

func (m *MockProviderPlugin) DescribeWhatIf(ctx context.Context, providerName string, input map[string]any) (string, error)

func (*MockProviderPlugin) ExecuteProvider

func (m *MockProviderPlugin) ExecuteProvider(ctx context.Context, providerName string, input map[string]any) (*provider.Output, error)

func (*MockProviderPlugin) ExecuteProviderStream

func (m *MockProviderPlugin) ExecuteProviderStream(ctx context.Context, providerName string, input map[string]any, cb func(plugin.StreamChunk)) error

func (*MockProviderPlugin) ExtractDependencies

func (m *MockProviderPlugin) ExtractDependencies(ctx context.Context, providerName string, inputs map[string]any) ([]string, error)

func (*MockProviderPlugin) GetProviderDescriptor

func (m *MockProviderPlugin) GetProviderDescriptor(ctx context.Context, providerName string) (*provider.Descriptor, error)

func (*MockProviderPlugin) GetProviders

func (m *MockProviderPlugin) GetProviders(ctx context.Context) ([]string, error)

func (*MockProviderPlugin) StopProvider

func (m *MockProviderPlugin) StopProvider(ctx context.Context, providerName string) error

Jump to

Keyboard shortcuts

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