testutils

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const TestAccPrefix = "terraformacc"

TestAccPrefix is the prefix set for all resources created via acceptance testing, so that we can easily identify and clean them up in case of flakiness/failures.

Variables

View Source
var TestAccProtoV6ProviderFactories = map[string]func() (tfprotov6.ProviderServer, error){
	"prefect": providerserver.NewProtocol6WithError(TestAccProvider),
}

TestAccProtoV6ProviderFactories are used to instantiate a provider during acceptance testing. The factory function will be invoked for every Terraform CLI command executed to create a provider server to which the CLI can reattach.

View Source
var TestAccProvider provider.Provider = prefectProvider.New()

TestAccProvider defines the actual Provider, which is used during acceptance testing. This is the same Provider that is used by the CLI, and is used by custom test functions, primarily to access the underlying HTTP client.

Functions

func AccTestPreCheck

func AccTestPreCheck(t *testing.T)

AccTestPreCheck is a utility hook, which every test suite will call in order to verify if the necessary provider configurations are passed through the environment variables. https://developer.hashicorp.com/terraform/plugin/testing/acceptance-tests/testcase#precheck

func NewTestClient

func NewTestClient() (api.PrefectClient, error)

NewTestClient returns a new Prefect API client instance to be used in acceptance tests. The plugin-framework does not currently expose a way to extract the provider-configured client - so instead, we duplicate some of the client initiatlization logic that also happens in Provider.Configure(). https://github.com/hashicorp/terraform-plugin-testing/issues/11

Types

This section is empty.

Jump to

Keyboard shortcuts

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