Documentation ¶
Index ¶
- func Configure(t T, schema pschema.Schema, tfConfig map[string]cty.Value, ...)
- func Diff(t T, res pb.Resource, tfConfig1, tfConfig2 map[string]cty.Value, ...) crosstestsimpl.DiffResult
- func MakeConfigure(schema pschema.Schema, tfConfig map[string]cty.Value, ...) func(t *testing.T)
- type ConfigureOption
- type DiffOption
- type T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Configure ¶
func Configure(t T, schema pschema.Schema, tfConfig map[string]cty.Value, options ...ConfigureOption)
Configure will assert that a provider who's configuration is described by schema will observe the same inputs when configured in via HCL with the inputs tfInputs and when bridged and configured with Pulumi and puInputs.
The idea is that the "Configured Provider" should not be able to tell if it was configured via HCL or Pulumi YAML:
+--------------------+ +---------------------+ | Terraform Provider |--------------------->| Configure(tfInputs) | +--------------------+ +---------------------+ | \ | \ | \ | +---------------------+ | tfbridge.ShimProvider | Configured Provider | | +---------------------+ | / | / V / +--------------------+ +---------------------+ | Pulumi Provider |--------------------->| Configure(puInputs) | +--------------------+ +---------------------+
Configure should be safe to run in parallel.
func Diff ¶ added in v3.95.0
func Diff(t T, res pb.Resource, tfConfig1, tfConfig2 map[string]cty.Value, options ...DiffOption) crosstestsimpl.DiffResult
Diff will assert that given two resource configurations, the diffs are the same when computed by Terraform and Pulumi.
Diff should be safe to run in parallel.
func MakeConfigure ¶
func MakeConfigure(schema pschema.Schema, tfConfig map[string]cty.Value, options ...ConfigureOption) func(t *testing.T)
MakeConfigure returns a testing subtest of Configure.
func TestMyProperty(t *testing.T) { t.Run("my-subtest", crosstests.MakeConfigure(schema, tfConfig, puConfig)) }
For details on the test itself, see Configure.
Types ¶
type ConfigureOption ¶ added in v3.95.0
type ConfigureOption func(*configureOpts)
func ConfigureProviderInfo ¶ added in v3.95.0
func ConfigureProviderInfo(info map[string]*info.Schema) ConfigureOption
CreateResourceInfo specifies a map of info.Schema to apply to the provider under test.
func ConfigurePulumiConfig ¶ added in v3.95.0
func ConfigurePulumiConfig(config resource.PropertyMap) ConfigureOption
ConfigurePulumiConfig specifies an explicit pulumi value for the configure call.
type DiffOption ¶ added in v3.95.0
type DiffOption func(*diffOpts)
func DiffProviderInfo ¶ added in v3.95.0
func DiffProviderInfo(info map[string]*info.Schema) DiffOption
DiffProviderInfo specifies a map of info.Schema to apply to the provider under test.
type T ¶ added in v3.95.0
type T = crosstestsimpl.T