acctest

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MPL-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ExternalProviders map[string]resource.ExternalProvider

ExternalProviders is a map of additional providers that may be used during testing.

View Source
var ProtoV6ProviderFactories map[string]func() (tfprotov6.ProviderServer, error) = protoV6ProviderFactoriesInit(context.Background(), "davinci")
View Source
var Provider *schema.Provider

Provider is the "main" provider instance

This Provider can be used in testing code for API calls without requiring the use of saving and referencing specific ProviderFactories instances.

PreCheck(t) must be called before using this provider instance.

View Source
var ProviderFactories map[string]func() (*schema.Provider, error)

ProviderFactories is a static map containing only the main provider instance

Use other ProviderFactories functions, such as FactoriesAlternate, for tests requiring special provider configurations.

View Source
var TestCheckFunc func(*terraform.State) error

TestCheckFunc is used by CheckDestroy to determine for proper resource destruction

Functions

func CheckForResourceDestroy added in v0.3.0

func CheckForResourceDestroy(r *http.Response, err error) (bool, error)

func CheckForResourceDestroyCustomHTTPCode added in v0.3.0

func CheckForResourceDestroyCustomHTTPCode(r *http.Response, err error, customHttpCode int) (bool, error)

func CheckParentEnvironmentDestroy added in v0.3.0

func CheckParentEnvironmentDestroy(ctx context.Context, apiClient *management.APIClient, environmentID string) (bool, error)

func ComposeCompare added in v0.1.3

func ComposeCompare(fs ...error) error

func DeepCloneFlow added in v0.3.0

func DeepCloneFlow(src, dst *dv.Flow) error

func ErrorCheck

func ErrorCheck(t *testing.T) resource.ErrorCheckFunc

func GetAttributeFromState added in v0.1.3

func GetAttributeFromState(s *terraform.State, resourceFullName, attributeName string) (string, error)

Can pull top-level attributes from state and return as string

func MainTfHcl

func MainTfHcl(resourceName string) (hcl string)

func MainTfHclUpdate

func MainTfHclUpdate() string

func PingOneTestClient added in v0.3.0

func PingOneTestClient(ctx context.Context) (*pingone.Client, error)

func PingoneEnvironmentServicesSsoHcl added in v0.3.0

func PingoneEnvironmentServicesSsoHcl(resourceName string, p1Services []string, withBootstrapConfig bool) (hcl string)

PingoneEnvrionmentSsoHcl returns hcl for a pingone environment and assigns roles used for SSO by davinci The following environment vars must be set: - PINGONE_ENVIRONMENT_ID - PINGONE_LICENSE_ID - PINGONE_SSO_USERNAME - PINGONE_SSO_PASSWORD

The `resourceName` input can be a random charset and will be used for the name of each resource and datasource in the returned hcl. p1services is a list of services besides SSO and DaVinci to enable on the environment

func PingoneEnvironmentSsoHcl added in v0.3.0

func PingoneEnvironmentSsoHcl(resourceName string, withBootstrapConfig bool) (hcl string)

PingoneEnvironmentSsoHcl returns hcl for a pingone environment and assigns roles used for SSO by davinci The following environment vars must be set: - PINGONE_ENVIRONMENT_ID - PINGONE_LICENSE_ID - PINGONE_SSO_USERNAME - PINGONE_SSO_PASSWORD

The `resourceName` input can be a random charset and will be used for the name of each resource and datasource in the returned hcl.

func PreCheckClient added in v0.3.0

func PreCheckClient(t *testing.T)

func PreCheckDaVinciClient added in v0.3.0

func PreCheckDaVinciClient(t *testing.T)

check required variabes are met for tests

func PreCheckNewEnvironment added in v0.3.0

func PreCheckNewEnvironment(t *testing.T)

func PreCheckPingOneClient added in v0.3.0

func PreCheckPingOneClient(t *testing.T)

func RandStringFieldGen

func RandStringFieldGen() string

func RandStringWithPrefix

func RandStringWithPrefix(prefix string) string

func ReadFlowJsonFile added in v0.3.0

func ReadFlowJsonFile(path string) (string, error)

takes path to json file, adjusts flow name attribute to include unique resource name, and returns json string

func ResourceNameGen

func ResourceNameGen() string

func TestAccResourceConnectionHcl added in v0.1.13

func TestAccResourceConnectionHcl(resourceName string, p1Services []string, connections []TestConnection) (hcl string)

func TestClient added in v0.1.6

func TestClient() (*dv.APIClient, error)

func TfHclPingOneDavinci

func TfHclPingOneDavinci() string

Types

type CompareFunc added in v0.1.3

type CompareFunc func(interface{}) error

type SchemaAttributeBoolean added in v0.1.3

type SchemaAttributeBoolean struct {
	AttributeName string
	ExpectedValue bool
	ActualValue   bool
}

func (*SchemaAttributeBoolean) Compare added in v0.1.3

func (s *SchemaAttributeBoolean) Compare() error

type SchemaAttributeFloat64 added in v0.1.3

type SchemaAttributeFloat64 struct {
	AttributeName string
	ExpectedValue float64
	ActualValue   float64
}

func (*SchemaAttributeFloat64) Compare added in v0.1.3

func (s *SchemaAttributeFloat64) Compare() error

type SchemaAttributeMap added in v0.1.3

type SchemaAttributeMap struct {
	AttributeName string
	ExpectedValue map[string]interface{}
	ActualValue   map[string]interface{}
}

func (*SchemaAttributeMap) Compare added in v0.1.3

func (s *SchemaAttributeMap) Compare() error

type SchemaAttributeString added in v0.1.3

type SchemaAttributeString struct {
	AttributeName string
	ExpectedValue string
	ActualValue   string
}

func (*SchemaAttributeString) Compare added in v0.1.3

func (s *SchemaAttributeString) Compare() error

type TestApplication added in v0.2.0

type TestApplication struct {
	ApplicationResourceName string
	Name                    string
	ID                      string
	EnvironmentID           string
}

func (TestApplication) GetResourceFullName added in v0.2.0

func (ta TestApplication) GetResourceFullName() (resourceName string)

func (*TestApplication) SetEnvironmentID added in v0.2.0

func (ta *TestApplication) SetEnvironmentID(environmentID string)

func (*TestApplication) SetID added in v0.2.0

func (ta *TestApplication) SetID(id string)

func (*TestApplication) SetName added in v0.2.0

func (ta *TestApplication) SetName(name string)

type TestApplicationFlowPolicy added in v0.2.0

type TestApplicationFlowPolicy struct {
	FlowPolicyResourceName string
	Name                   string
	EnvironmentID          string
	ApplicationID          string
	ID                     string
}

func (TestApplicationFlowPolicy) GetResourceFullName added in v0.2.0

func (tafp TestApplicationFlowPolicy) GetResourceFullName() (resourceName string)

func (*TestApplicationFlowPolicy) SetApplicationID added in v0.2.0

func (tafp *TestApplicationFlowPolicy) SetApplicationID(applicationID string)

func (*TestApplicationFlowPolicy) SetEnvironmentID added in v0.2.0

func (tafp *TestApplicationFlowPolicy) SetEnvironmentID(environmentID string)

func (*TestApplicationFlowPolicy) SetID added in v0.2.0

func (tafp *TestApplicationFlowPolicy) SetID(id string)

func (*TestApplicationFlowPolicy) SetName added in v0.2.0

func (tafp *TestApplicationFlowPolicy) SetName(name string)

type TestConnection added in v0.1.13

type TestConnection struct {
	ResourcePrefix string
	Name           string
	ConnectorId    string
	Properties     []TestConnectionProperty
}

func (TestConnection) GetResourceName added in v0.1.13

func (tc TestConnection) GetResourceName() (resourceName string)

Returns resource name for connection that should be used in hcl format: `<ResourceName>_<Name>`

func (TestConnection) MakeConnectionHcl added in v0.1.13

func (tcp TestConnection) MakeConnectionHcl() (hcl string)

type TestConnectionProperty added in v0.1.13

type TestConnectionProperty struct {
	Name  string
	Value string
	Type  string
}

Directories

Path Synopsis
service

Jump to

Keyboard shortcuts

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