brokerpaktestframework

package
v1.1.2 Latest Latest
Warning

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

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

Documentation

Overview

Package brokerpaktestframework implements a test framework that can be used by brokerpaks for testing

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindService

func FindService(catalog *apiresponses.CatalogResponse, s string) domain.Service

func FindServicePlan

func FindServicePlan(catalog *apiresponses.CatalogResponse, serviceName, servicePlan string) domain.ServicePlan

func FindServicePlanGUIDs

func FindServicePlanGUIDs(catalog *apiresponses.CatalogResponse, serviceName, planName string) (string, string, error)

func PathToBrokerPack

func PathToBrokerPack(skips ...int) string

Types

type Option added in v0.11.0

type Option func() string

func WithVersion added in v0.11.0

func WithVersion(version string) Option

type TFStateValue

type TFStateValue struct {
	Name  string
	Type  string
	Value any
}

type TerraformInvocation

type TerraformInvocation struct {
	Type string
	// contains filtered or unexported fields
}

func (TerraformInvocation) TFVars

func (i TerraformInvocation) TFVars() (map[string]any, error)

type TerraformMock

type TerraformMock struct {
	Binary string

	Version string
	// contains filtered or unexported fields
}

func NewTerraformMock

func NewTerraformMock(opts ...Option) (TerraformMock, error)

func (TerraformMock) ApplyInvocations

func (p TerraformMock) ApplyInvocations() ([]TerraformInvocation, error)

func (TerraformMock) FirstTerraformInvocationVars

func (p TerraformMock) FirstTerraformInvocationVars() (map[string]any, error)

func (TerraformMock) Invocations

func (p TerraformMock) Invocations() ([]TerraformInvocation, error)

func (TerraformMock) Reset

func (p TerraformMock) Reset() error

func (TerraformMock) ReturnTFState

func (p TerraformMock) ReturnTFState(values []TFStateValue) error

ReturnTFState set the Terraform State in a JSON file. Deprecated: due to the introduction of a new name that provides a more accurate meaning. We use parallel change to not break backwards compatibility. To set the Terraform State use the TerraformMock.SetTFState method.

func (TerraformMock) SetTFState added in v0.11.0

func (p TerraformMock) SetTFState(values []TFStateValue) error

SetTFState set the Terraform State in a JSON file.

type TestInstance

type TestInstance struct {
	// contains filtered or unexported fields
}

func BuildTestInstance

func BuildTestInstance(brokerPackDir string, provider TerraformMock, logger io.Writer, brokerpakExtraFoldersToCopy ...string) (*TestInstance, error)

func (*TestInstance) Bind

func (instance *TestInstance) Bind(serviceName, planName, instanceID string, params map[string]any) (map[string]any, error)

func (*TestInstance) Catalog

func (instance *TestInstance) Catalog() (*apiresponses.CatalogResponse, error)

func (*TestInstance) Cleanup

func (instance *TestInstance) Cleanup() error

func (*TestInstance) Provision

func (instance *TestInstance) Provision(serviceName string, planName string, params map[string]any) (string, error)

func (*TestInstance) Start

func (instance *TestInstance) Start(logger io.Writer, config []string) error

func (*TestInstance) Update

func (instance *TestInstance) Update(instanceGUID string, serviceName string, planName string, params map[string]any) error

Directories

Path Synopsis
mock-binary

Jump to

Keyboard shortcuts

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