Documentation ¶
Index ¶
- func AccountLevel(t *testing.T, steps ...Step)
- func BuildImportStateIdFunc(resourceId, attr string) func(*terraform.State) (string, error)
- func CreateUuid() string
- func GetEnvInt64OrSkipTest(t *testing.T, name string) int64
- func GetEnvOrSkipTest(t *testing.T, name string) string
- func GetRunAsAttribute(t *testing.T, ctx context.Context) string
- func IsAws(t *testing.T) bool
- func IsAzure(t *testing.T) bool
- func IsGcp(t *testing.T) bool
- func LoadAccountEnv(t *testing.T)
- func LoadDebugEnvIfRunsFromIDE(t *testing.T, key string)
- func LoadUcacctEnv(t *testing.T)
- func LoadUcwsEnv(t *testing.T)
- func LoadWorkspaceEnv(t *testing.T)
- func RandomEmail(prefix ...string) string
- func RandomHex(prefix string, randLen int) string
- func RandomName(prefix ...string) string
- func ResourceCheck(name string, ...) resource.TestCheckFunc
- func ResourceCheckWithState(name string, ...) resource.TestCheckFunc
- func Skipf(t *testing.T) func(format string, args ...any)
- 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 CreateUuid ¶ added in v1.65.0
func CreateUuid() string
func GetEnvInt64OrSkipTest ¶ added in v1.52.0
func GetEnvOrSkipTest ¶ added in v1.52.0
GetEnvOrSkipTest proceeds with test only with that env variable
func GetRunAsAttribute ¶ added in v1.65.0
func LoadAccountEnv ¶ added in v1.61.0
func LoadDebugEnvIfRunsFromIDE ¶ added in v1.65.0
loads debug environment from ~/.databricks/debug-env.json
func LoadUcacctEnv ¶ added in v1.61.0
func LoadUcwsEnv ¶ added in v1.61.0
func LoadWorkspaceEnv ¶ added in v1.61.0
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 ResourceCheck ¶
func ResourceCheck(name string, cb func(ctx context.Context, client *common.DatabricksClient, id string) error) resource.TestCheckFunc
resourceCheck calls back a function with client and resource id
func ResourceCheckWithState ¶ added in v1.65.0
func ResourceCheckWithState(name string, cb func(ctx context.Context, client *common.DatabricksClient, state *terraform.InstanceState) error) resource.TestCheckFunc
resourceCheckWithState calls back a function with client and resource instance state
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.