Documentation ¶
Overview ¶
Adapters for converting morally equivalent typed representations of TF values for integrating with all the libraries cross-testing is using.
Compares the effect of transitioning between two randomly sampled resource configurations.
Define pretty-printers to make test output easier to interpret.
Driver code for running tests against an in-process bridged provider under Pulumi CLI.
Rapid generators for schema and value spaces.
Helper code to drive Terraform CLI to run tests against an in-process provider.
Helper code to emit Terraform HCL code to drive the Terraform CLI.
Index ¶
- func Configure(t T, provider map[string]*schema.Schema, tfConfig cty.Value, ...)
- func ConvertResourceValue(t require.TestingT, properties resource.PropertyMap) map[string]any
- func Create(t T, resourceSchema map[string]*schema.Schema, tfConfig cty.Value, ...)
- func FailNotEqual(t T, name string, tfVal, pulVal any)
- func MakeConfigure(provider map[string]*schema.Schema, tfConfig cty.Value, ...) func(*testing.T)
- func MakeCreate(resource map[string]*schema.Schema, tfConfig cty.Value, ...) func(t *testing.T)
- type ConfigureOption
- type CreateOption
- type T
- type TfResDriver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Configure ¶
func Configure( t T, provider map[string]*schema.Schema, tfConfig cty.Value, options ...ConfigureOption, )
Configure validates that a Terraform provider witnesses the same input when: - invoked directly with HCL on tfConfig - bridged and invoked via Pulumi YAML on puConfig
Create only applies to resources defined with github.com/hashicorp/terraform-plugin-sdk/v2. For cross-tests on Plugin Framework based resources, see github.com/pulumi/pulumi-terraform-bridge/pkg/pf/tests/internal/cross-tests.
func ConvertResourceValue ¶
func Create ¶
func Create( t T, resourceSchema map[string]*schema.Schema, tfConfig cty.Value, options ...CreateOption, )
Create validates that a Terraform provider witnesses the same input when: - invoked directly with HCL on tfConfig - bridged and invoked via Pulumi YAML on puConfig
Create only applies to resources defined with github.com/hashicorp/terraform-plugin-sdk/v2. For cross-tests on Plugin Framework based resources, see github.com/pulumi/pulumi-terraform-bridge/pkg/pf/tests/internal/cross-tests.
Create *does not* verify the outputs of the resource, only that the provider witnessed the same inputs.
func FailNotEqual ¶
func MakeConfigure ¶
func MakeCreate ¶
func MakeCreate( resource map[string]*schema.Schema, tfConfig cty.Value, options ...CreateOption, ) func(t *testing.T)
MakeCreate is a helper function for calling Create in testing.T.Run subcases.
Types ¶
type ConfigureOption ¶
type ConfigureOption func(*configureOpts)
An option that can be used to customize Configure.
func ConfigureProviderInfo ¶
func ConfigureProviderInfo(info map[string]*info.Schema) ConfigureOption
CreateResourceInfo specifies an info.Resource to apply to the resource under test.
func ConfigurePulumiConfig ¶
func ConfigurePulumiConfig(config resource.PropertyMap) ConfigureOption
ConfigurePulumiConfig specifies an explicit pulumi value for the configure call.
type CreateOption ¶
type CreateOption func(*createOpts)
An option that can be used to customize Create.
func CreatePulumiConfig ¶
func CreatePulumiConfig(config resource.PropertyMap) CreateOption
CreatePulumiConfig specifies an explicit config value in Pulumi's value space.
func CreateResourceInfo ¶
func CreateResourceInfo(info info.Resource) CreateOption
CreateResourceInfo specifies an info.Resource to apply to the resource under test.
func CreateStateUpgrader ¶
func CreateStateUpgrader(schemaVersion int, upgraders []schema.StateUpgrader) CreateOption
CreateStateUpgrader specifies a schema version and list of state upgrader for Create.
func CreateTimeout ¶
func CreateTimeout(timeouts *schema.ResourceTimeout) CreateOption
CreateTimeout specifies a timeout option for Create.
type T ¶
type T = crosstestsimpl.T
type TfResDriver ¶
type TfResDriver struct {
// contains filtered or unexported fields
}
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package crosstestsimpl (cross-tests implementation) contains code meant to be shared across cross-test implementations (SDKv2, PF) but not used by people writing tests themselves.
|
Package crosstestsimpl (cross-tests implementation) contains code meant to be shared across cross-test implementations (SDKv2, PF) but not used by people writing tests themselves. |
hclwrite
hclwrite is a shared interface for writing HCL files for cross-tests.
|
hclwrite is a shared interface for writing HCL files for cross-tests. |