Documentation ¶
Index ¶
- Variables
- func CheckDataSourceStateMatchesResourceStateWithIgnores(dataSourceName, resourceName string, ignoreFields map[string]struct{}) resource.TestCheckFunc
- func DefaultProjectLocation(t *testing.T) location.Location
- func HCPClients(t *testing.T) *clients.Client
- func PreCheck(t *testing.T)
- func RandString(length int) string
Constants ¶
This section is empty.
Variables ¶
var ProtoV6ProviderFactories = map[string]func() (tfprotov6.ProviderServer, error){ "hcp": func() (tfprotov6.ProviderServer, error) { providers := []func() tfprotov6.ProviderServer{ providerserver.NewProtocol6(provider.NewFrameworkProvider(version.ProviderVersion)()), } return tf6muxserver.NewMuxServer(context.Background(), providers...) }, }
ProtoV6ProviderFactories provides a Provider Factory to be used within acceptance tests.
Functions ¶
func CheckDataSourceStateMatchesResourceStateWithIgnores ¶
func CheckDataSourceStateMatchesResourceStateWithIgnores(dataSourceName, resourceName string, ignoreFields map[string]struct{}) resource.TestCheckFunc
CheckDataSourceStateMatchesResourceStateWithIgnores returns a resource.TestCheckFunc that compares the state of a data source to that of a resource. For example, an acceptance test can use the following config:
resource "hcp_project" "project" { name = %q description = %q } data "hcp_project" "project" { project = hcp_project.project.resource_id }
Then the following check can be defined:
CheckDataSourceStateMatchesResourceStateWithIgnores( "data.hcp_project.project", "hcp_project.project", map[string]struct{}{"project": {}}), )
func DefaultProjectLocation ¶ added in v0.81.1
func HCPClients ¶
HCPClients returns the clients from the test provider.
func PreCheck ¶
PreCheck verifies that the required provider testing configuration is set.
This PreCheck function should be present in every acceptance test. It ensures credentials and other test environment settings are configured.
func RandString ¶
RandString generates a random string with the given length.
Types ¶
This section is empty.