Documentation
¶
Index ¶
- func AssertConfigDefinitionEquals(expected *core.ConfigDefinition, actual *core.ConfigDefinition, ...)
- func AssertInvalidHost(respErr error, action errorsv1.PluginAction, invalidHostID string, ...)
- func AssertLinkChangesEquals(expected *provider.LinkChanges, actual *provider.LinkChanges, ...)
- func AssertSlicesEqual[Item any](expected []Item, actual []Item, testSuite *suite.Suite)
- func CreateEmptyConcreteParams() *core.ParamsImpl
- func CreateEmptyTestParams() core.BlueprintParams
- func CreateTestLinkContext() provider.LinkContext
- func CreateTestProviderContext(namespace string) provider.Context
- func CreateTestProviderContextWithTagging(namespace string, taggingConfig *provider.TaggingConfig) provider.Context
- func CreateTestTransformerContext(namespace string) transform.Context
- func NewMemoryStateContainer() state.Container
- func StartPluginServiceServer(hostID string, pluginManager pluginservicev1.Manager, ...) (pluginservicev1.ServiceClient, func())
- func TestTaggingConfig() *provider.TaggingConfig
- type FunctionCallArgsMock
- func (f *FunctionCallArgsMock) Export(ctx context.Context) ([]any, error)
- func (f *FunctionCallArgsMock) Get(ctx context.Context, position int) (any, error)
- func (f *FunctionCallArgsMock) GetMultipleVars(ctx context.Context, targets ...any) error
- func (f *FunctionCallArgsMock) GetVar(ctx context.Context, position int, target any) error
- type FunctionCallContextMock
- func (f *FunctionCallContextMock) CallStackSnapshot() []*function.Call
- func (f *FunctionCallContextMock) CurrentLocation() *source.Meta
- func (f *FunctionCallContextMock) NewCallArgs(args ...any) provider.FunctionCallArguments
- func (f *FunctionCallContextMock) Params() core.BlueprintParams
- func (f *FunctionCallContextMock) Registry() provider.FunctionRegistry
- type MemoryStateContainer
- func (c *MemoryStateContainer) Children() state.ChildrenContainer
- func (c *MemoryStateContainer) Exports() state.ExportsContainer
- func (c *MemoryStateContainer) Instances() state.InstancesContainer
- func (c *MemoryStateContainer) Links() state.LinksContainer
- func (c *MemoryStateContainer) Metadata() state.MetadataContainer
- func (c *MemoryStateContainer) Resources() state.ResourcesContainer
- type MockProvider
- func (m *MockProvider) ConfigDefinition(ctx context.Context) (*core.ConfigDefinition, error)
- func (m *MockProvider) CustomVariableType(ctx context.Context, customVariableType string) (provider.CustomVariableType, error)
- func (m *MockProvider) DataSource(ctx context.Context, dataSourceType string) (provider.DataSource, error)
- func (m *MockProvider) Function(ctx context.Context, functionName string) (provider.Function, error)
- func (m *MockProvider) Link(ctx context.Context, resourceTypeA string, resourceTypeB string) (provider.Link, error)
- func (m *MockProvider) ListCustomVariableTypes(ctx context.Context) ([]string, error)
- func (m *MockProvider) ListDataSourceTypes(ctx context.Context) ([]string, error)
- func (m *MockProvider) ListFunctions(ctx context.Context) ([]string, error)
- func (m *MockProvider) ListLinkTypes(ctx context.Context) ([]string, error)
- func (m *MockProvider) ListResourceTypes(ctx context.Context) ([]string, error)
- func (m *MockProvider) Namespace(ctx context.Context) (string, error)
- func (m *MockProvider) Resource(ctx context.Context, resourceType string) (provider.Resource, error)
- func (m *MockProvider) RetryPolicy(ctx context.Context) (*provider.RetryPolicy, error)
- type MockTransformer
- func (m *MockTransformer) AbstractResource(ctx context.Context, resourceType string) (transform.AbstractResource, error)
- func (m *MockTransformer) ConfigDefinition(ctx context.Context) (*core.ConfigDefinition, error)
- func (m *MockTransformer) GetTransformName(ctx context.Context) (string, error)
- func (m *MockTransformer) ListAbstractResourceTypes(ctx context.Context) ([]string, error)
- func (m *MockTransformer) Transform(ctx context.Context, inputs *transform.SpecTransformerTransformInput) (*transform.SpecTransformerTransformOutput, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertConfigDefinitionEquals ¶
func AssertConfigDefinitionEquals( expected *core.ConfigDefinition, actual *core.ConfigDefinition, testSuite *suite.Suite, )
AssertConfigDefinitionEquals asserts that two core config definitions are equal. This treats nil and empty slices in the config field definitions as equal.
func AssertInvalidHost ¶
func AssertInvalidHost( respErr error, action errorsv1.PluginAction, invalidHostID string, testSuite *suite.Suite, )
AssertInvalidHost asserts that the given error is an invalid host error from a plugin method call response.
func AssertLinkChangesEquals ¶
func AssertLinkChangesEquals( expected *provider.LinkChanges, actual *provider.LinkChanges, testSuite *suite.Suite, )
AssertLinkChangesEquals asserts that two provider link changes are equal. This treats nil and empty slices in the changes as equal.
func AssertSlicesEqual ¶
AssertSlicesEqual asserts that two slices are equal. Nil and empty slices are considered equal. The order of the elements in the slices must be the same.
func CreateEmptyConcreteParams ¶
func CreateEmptyConcreteParams() *core.ParamsImpl
CreateEmptyConcreteParams creates an empty set of concrete parameters for testing, primarily used for testing plugin functions.
func CreateEmptyTestParams ¶
func CreateEmptyTestParams() core.BlueprintParams
CreateEmptyTestParams creates an empty set of parameters for testing, primarily used for testing plugin functions.
func CreateTestLinkContext ¶
func CreateTestLinkContext() provider.LinkContext
CreateTestLinkContext creates a link context for testing.
func CreateTestProviderContext ¶
CreateTestProviderContext creates a provider context for testing with the given namespace.
func CreateTestProviderContextWithTagging ¶ added in v0.2.0
func CreateTestProviderContextWithTagging( namespace string, taggingConfig *provider.TaggingConfig, ) provider.Context
CreateTestProviderContextWithTagging creates a provider context for testing with the given namespace and tagging configuration.
func CreateTestTransformerContext ¶
CreateTestTransformerContext creates a transformer context for testing with the given namespace.
func NewMemoryStateContainer ¶
func StartPluginServiceServer ¶
func StartPluginServiceServer( hostID string, pluginManager pluginservicev1.Manager, functionRegistry provider.FunctionRegistry, resourceService provider.ResourceService, ) (pluginservicev1.ServiceClient, func())
func TestTaggingConfig ¶ added in v0.2.0
func TestTaggingConfig() *provider.TaggingConfig
TestTaggingConfig returns a standard tagging configuration for testing.
Types ¶
type FunctionCallArgsMock ¶
type FunctionCallArgsMock struct {
Args []any
CallCtx provider.FunctionCallContext
}
func (*FunctionCallArgsMock) Export ¶
func (f *FunctionCallArgsMock) Export(ctx context.Context) ([]any, error)
func (*FunctionCallArgsMock) GetMultipleVars ¶
func (f *FunctionCallArgsMock) GetMultipleVars(ctx context.Context, targets ...any) error
type FunctionCallContextMock ¶
type FunctionCallContextMock struct {
CallCtxParams *core.ParamsImpl
CallCtxRegistry provider.FunctionRegistry
CallStack function.Stack
CallCtxCurrentLocation *source.Meta
}
func (*FunctionCallContextMock) CallStackSnapshot ¶
func (f *FunctionCallContextMock) CallStackSnapshot() []*function.Call
func (*FunctionCallContextMock) CurrentLocation ¶
func (f *FunctionCallContextMock) CurrentLocation() *source.Meta
func (*FunctionCallContextMock) NewCallArgs ¶
func (f *FunctionCallContextMock) NewCallArgs(args ...any) provider.FunctionCallArguments
func (*FunctionCallContextMock) Params ¶
func (f *FunctionCallContextMock) Params() core.BlueprintParams
func (*FunctionCallContextMock) Registry ¶
func (f *FunctionCallContextMock) Registry() provider.FunctionRegistry
type MemoryStateContainer ¶
type MemoryStateContainer struct {
// contains filtered or unexported fields
}
func (*MemoryStateContainer) Children ¶
func (c *MemoryStateContainer) Children() state.ChildrenContainer
func (*MemoryStateContainer) Exports ¶
func (c *MemoryStateContainer) Exports() state.ExportsContainer
func (*MemoryStateContainer) Instances ¶
func (c *MemoryStateContainer) Instances() state.InstancesContainer
func (*MemoryStateContainer) Links ¶
func (c *MemoryStateContainer) Links() state.LinksContainer
func (*MemoryStateContainer) Metadata ¶
func (c *MemoryStateContainer) Metadata() state.MetadataContainer
func (*MemoryStateContainer) Resources ¶
func (c *MemoryStateContainer) Resources() state.ResourcesContainer
type MockProvider ¶
type MockProvider struct {
ProviderNamespace string
}
MockProvider is a mock implementation of the `provider.Provider` interface for plugins in launch testing.
func (*MockProvider) ConfigDefinition ¶
func (m *MockProvider) ConfigDefinition(ctx context.Context) (*core.ConfigDefinition, error)
func (*MockProvider) CustomVariableType ¶
func (m *MockProvider) CustomVariableType( ctx context.Context, customVariableType string, ) (provider.CustomVariableType, error)
func (*MockProvider) DataSource ¶
func (m *MockProvider) DataSource( ctx context.Context, dataSourceType string, ) (provider.DataSource, error)
func (*MockProvider) ListCustomVariableTypes ¶
func (m *MockProvider) ListCustomVariableTypes(ctx context.Context) ([]string, error)
func (*MockProvider) ListDataSourceTypes ¶
func (m *MockProvider) ListDataSourceTypes(ctx context.Context) ([]string, error)
func (*MockProvider) ListFunctions ¶
func (m *MockProvider) ListFunctions(ctx context.Context) ([]string, error)
func (*MockProvider) ListLinkTypes ¶
func (m *MockProvider) ListLinkTypes(ctx context.Context) ([]string, error)
func (*MockProvider) ListResourceTypes ¶
func (m *MockProvider) ListResourceTypes(ctx context.Context) ([]string, error)
func (*MockProvider) Namespace ¶
func (m *MockProvider) Namespace(ctx context.Context) (string, error)
func (*MockProvider) RetryPolicy ¶
func (m *MockProvider) RetryPolicy(ctx context.Context) (*provider.RetryPolicy, error)
type MockTransformer ¶
type MockTransformer struct {
TransformName string
}
MockTransformer is a mock implementation of the `transform.SpecTransformer` interface for plugins in launch testing.
func (*MockTransformer) AbstractResource ¶
func (m *MockTransformer) AbstractResource( ctx context.Context, resourceType string, ) (transform.AbstractResource, error)
func (*MockTransformer) ConfigDefinition ¶
func (m *MockTransformer) ConfigDefinition(ctx context.Context) (*core.ConfigDefinition, error)
func (*MockTransformer) GetTransformName ¶
func (m *MockTransformer) GetTransformName(ctx context.Context) (string, error)
func (*MockTransformer) ListAbstractResourceTypes ¶
func (m *MockTransformer) ListAbstractResourceTypes(ctx context.Context) ([]string, error)
func (*MockTransformer) Transform ¶
func (m *MockTransformer) Transform( ctx context.Context, inputs *transform.SpecTransformerTransformInput, ) (*transform.SpecTransformerTransformOutput, error)