Documentation
¶
Index ¶
- func BuildTestClient() (*clients.Client, error)
- func CheckDestroyedFunc(client *clients.Client, testResource TestResource, ...) func(state *terraform.State) error
- func PreCheck(t *testing.T)
- func RandTimeInt() int
- func RequiresImportError(_ string) *regexp.Regexp
- type TestData
- func (td TestData) DataSourceTest(t *testing.T, steps []resource.TestStep)
- func (td TestData) ImportStep(ignore ...string) resource.TestStep
- func (td TestData) ImportStepFor(resourceName string, ignore ...string) resource.TestStep
- func (td TestData) ImportStepWithImportStateIdFunc(importStateIdFunc resource.ImportStateIdFunc, ignore ...string) resource.TestStep
- func (td *TestData) RandomInt() int
- func (td *TestData) RandomStringOfLength(len int) string
- func (td TestData) RequiresImportErrorStep(configBuilder func(data TestData) string) resource.TestStep
- func (td TestData) ResourceTest(t *testing.T, testResource TestResource, steps []resource.TestStep)
- func (td TestData) UpgradeTest(t *testing.T, testResource TestResource, steps []resource.TestStep)
- func (td TestData) UpgradeTestApplyStep(applyStep resource.TestStep) resource.TestStep
- func (td TestData) UpgradeTestDeployStep(step resource.TestStep, upgradeFrom string) resource.TestStep
- func (td TestData) UpgradeTestPlanStep(planStep resource.TestStep) resource.TestStep
- type TestResource
- type TestResourceVerifyingRemoved
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildTestClient ¶
func CheckDestroyedFunc ¶
func CheckDestroyedFunc(client *clients.Client, testResource TestResource, resourceType, resourceName string) func(state *terraform.State) error
CheckDestroyedFunc returns a TestCheckFunc which validates the resource no longer exists
func RandTimeInt ¶
func RandTimeInt() int
func RequiresImportError ¶
Types ¶
type TestData ¶
type TestData struct { // LocationPrimary is the Primary Azure Region which should be used for testing LocationPrimary string // LocationSecondary is the Secondary Azure Region which should be used for testing LocationSecondary string // LocationTernary is the Ternary Azure Region which should be used for testing LocationTernary string // RandomInteger is a random integer which is unique to this test case RandomInteger int // RandomString is a random 5 character string is unique to this test case RandomString string // ResourceName is the fully qualified resource name, comprising of the // resource type and then the resource label // e.g. `azurerm_resource_group.test` ResourceName string // ResourceType is the Terraform Resource Type - `azurerm_resource_group` ResourceType string // contains filtered or unexported fields }
func BuildTestData ¶
BuildTestData generates some test data for the given resource
func (TestData) DataSourceTest ¶
lintignore:AT001
func (TestData) ImportStep ¶
ImportStep returns a Test Step which Imports the Resource, optionally ignoring any fields which may not be imported (for example, as they're not returned from the API)
func (TestData) ImportStepFor ¶
ImportStepFor returns a Test Step which Imports a given resource by name, optionally ignoring any fields which may not be imported (for example, as they're not returned from the API)
func (TestData) ImportStepWithImportStateIdFunc ¶ added in v1.13.1
func (td TestData) ImportStepWithImportStateIdFunc(importStateIdFunc resource.ImportStateIdFunc, ignore ...string) resource.TestStep
ImportStep returns a Test Step which Imports the Resource, optionally ignoring any fields which may not be imported (for example, as they're not returned from the API)
func (*TestData) RandomInt ¶
RandomIntOfLength is a random 8 to 18 digit integer which is unique to this test case
func (*TestData) RandomStringOfLength ¶
func (TestData) RequiresImportErrorStep ¶
func (td TestData) RequiresImportErrorStep(configBuilder func(data TestData) string) resource.TestStep
RequiresImportErrorStep returns a Test Step which expects a Requires Import error to be returned when running this step
func (TestData) ResourceTest ¶
func (TestData) UpgradeTest ¶ added in v1.13.1
func (TestData) UpgradeTestApplyStep ¶ added in v1.14.0
UpgradeTestApplyStep returns a test step used to run terraform apply with the development version
type TestResource ¶
type TestResourceVerifyingRemoved ¶
type TestResourceVerifyingRemoved interface { TestResource Destroy(ctx context.Context, client *clients.Client, state *terraform.InstanceState) (*bool, error) }