Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ProtoV5ProviderFactories = map[string]func() (tfprotov5.ProviderServer, error){ "hcp": func() (tfprotov5.ProviderServer, error) { providers := []func() tfprotov5.ProviderServer{ providerserver.NewProtocol5(provider.NewFrameworkProvider(version.ProviderVersion)()), } return tf5muxserver.NewMuxServer(context.Background(), providers...) }, }
ProtoV5ProviderFactories 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 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.