acctest

package
v2.38.2 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: MPL-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BodyMatcherIgnore = []string{
	"organization",
	"organization_id",
	"project_id",
	"project",
}

BodyMatcherIgnore contains the list of json body keys that should be ignored when matching requests with cassettes

View Source
var QueryMatcherIgnore = []string{
	"organization_id",
}

QueryMatcherIgnore contains the list of query value that should be ignored when matching requests with cassettes

View Source
var SensitiveFields = map[string]interface{}{
	"secret_key": "00000000-0000-0000-0000-000000000000",
}

SensitiveFields is a map with keys listing fields that should be anonymized value will be set in place of its old value

View Source
var UpdateCassettes = flag.Bool("cassettes", os.Getenv("TF_UPDATE_CASSETTES") == "true", "Record Cassettes")

UpdateCassettes will update all cassettes of a given test

Functions

func CheckResourceIDChanged

func CheckResourceIDChanged(resourceName string, resourceID *string) resource.TestCheckFunc

CheckResourceIDChanged checks that the ID of the resource has indeed changed, in case of ForceNew for example. It will fail if resourceID is empty so be sure to use acctest.CheckResourceIDPersisted first in a test suite.

func CheckResourceIDPersisted

func CheckResourceIDPersisted(resourceName string, resourceID *string) resource.TestCheckFunc

CheckResourceIDPersisted checks that the ID of the resource is the same throughout tests of migration or mutation It can be used to check that no ForceNew has been done

func CheckResourceRawIDMatches

func CheckResourceRawIDMatches(res1, attr1, res2, attr2 string) resource.TestCheckFunc

CheckResourceRawIDMatches asserts the equality of IDs from two specified attributes of two Scaleway resources.

func PreCheck

func PreCheck(_ *testing.T)

Types

type TestTools

type TestTools struct {
	T                 *testing.T
	Meta              *meta.Meta
	ProviderFactories map[string]func() (*schema.Provider, error)
	Cleanup           func()
}

func NewTestTools

func NewTestTools(t *testing.T) *TestTools

Jump to

Keyboard shortcuts

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