Documentation ¶
Index ¶
- func AccountLevel(t *testing.T, steps ...Step)
- func BuildImportStateIdFunc(resourceId, attr string) func(*terraform.State) (string, error)
- func GetEnvInt64OrSkipTest(t *testing.T, name string) int64
- func GetEnvOrSkipTest(t *testing.T, name string) string
- func RandomEmail(prefix ...string) string
- func RandomHex(prefix string, randLen int) string
- func RandomName(prefix ...string) string
- func UnityAccountLevel(t *testing.T, steps ...Step)
- func UnityWorkspaceLevel(t *testing.T, steps ...Step)
- func WorkspaceLevel(t *testing.T, steps ...Step)
- type Step
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccountLevel ¶ added in v1.52.0
func BuildImportStateIdFunc ¶ added in v1.52.0
BuildImportStateIdFunc constructs a function that returns the id attribute of a target resouce from the terraform state. This is a helper function for conveniently constructing the ImportStateIdFunc field for a test step.
func GetEnvInt64OrSkipTest ¶ added in v1.52.0
func GetEnvOrSkipTest ¶ added in v1.52.0
GetEnvOrSkipTest proceeds with test only with that env variable
func RandomEmail ¶ added in v1.52.0
RandomEmail generates random email
func RandomName ¶ added in v1.52.0
RandomName gives random name with optional prefix. e.g. qa.RandomName("tf-")
func UnityAccountLevel ¶ added in v1.52.0
func UnityWorkspaceLevel ¶ added in v1.52.0
func WorkspaceLevel ¶ added in v1.52.0
Types ¶
type Step ¶
type Step struct { // Terraform HCL for resources to materialize in this test step. Template string // This function is called after the template is applied. Useful for making assertions // or doing cleanup. Check func(*terraform.State) error // Setup function called before the template is materialized. PreConfig func() Destroy bool ExpectNonEmptyPlan bool ExpectError *regexp.Regexp PlanOnly bool PreventDiskCleanup bool PreventPostDestroyRefresh bool // If true, will test the functionality of ImportState by importing the resource with ResourceName (must be set) and the ID of that resource. // ID can be supplied with either ImportStateId or ImportStateIdFunc. ImportState bool ImportStateId string ImportStateIdFunc func(*terraform.State) (string, error) ImportStateVerify bool ImportStateVerifyIdentifierAttribute string ResourceName string ProtoV6ProviderFactories map[string]func() (tfprotov6.ProviderServer, error) }
A step in a terraform acceptance test
Click to show internal directories.
Click to hide internal directories.