terraform/builtin/providers/test
Martin Atkins bdcac8792d plugin: Use correct schema when marshaling imported resource objects
Previously we were using the type name requested in the import to select
the schema, but a provider is free to return additional objects of other
types as part of an import result, and so it's important that we perform
schema selection separately for each returned object.

If we don't do this, we get confusing downstream errors where the
resulting object decodes to the wrong type and breaks various invariants
expected by Terraform Core.

The testResourceImportOther test in the test provider didn't catch this
previously because it happened to have an identical schema to the other
resource type being imported. Now the schema is changed and also there's
a computed attribute we can set as part of the refresh phase to make sure
we're completing the Read call properly during import. Refresh was working
correctly, but we didn't have any tests for it as part of the import flow.
2019-02-01 15:22:54 -08:00
..
data_source.go failing tests when using resources with count 2018-12-17 12:15:43 -05:00
data_source_label.go provider/test: allow assigning a label to each instance 2017-05-11 10:52:51 -07:00
data_source_label_test.go provider/test: allow assigning a label to each instance 2017-05-11 10:52:51 -07:00
data_source_test.go core: Specialized errors for incorrect indexes in resource reference 2018-12-20 13:55:42 -08:00
provider.go helper/plugin: Honor resource type overrides in import 2019-01-30 09:05:08 -08:00
provider_test.go core: Fix issues with ignore_changes 2016-03-21 14:20:36 -05:00
resource.go helper/schema: Opt-in panic on invalid ResourceData.Set 2017-11-08 10:05:11 +00:00
resource_data_dep_test.go udpate test configs to work with hcl2 2018-10-16 19:14:54 -07:00
resource_defaults.go add tests for nested default values 2019-01-17 18:51:18 -05:00
resource_defaults_test.go add more tests 2019-01-23 20:03:10 -05:00
resource_deprecated.go add tests for deprecated/removed attrs 2019-01-12 10:41:04 -05:00
resource_deprecated_test.go add tests for deprecated/removed attrs 2019-01-12 10:41:04 -05:00
resource_diff_suppress.go computed value wasn't being set 2018-11-27 08:54:15 -05:00
resource_diff_suppress_test.go verify DiffSuppresFunc behavior 2018-11-16 11:17:23 -05:00
resource_force_new.go add provider tests for force-new with a map 2018-10-31 13:42:28 -04:00
resource_force_new_test.go add provider tests for force-new with a map 2018-10-31 13:42:28 -04:00
resource_gh12183.go helper/schema: Opt-in panic on invalid ResourceData.Set 2017-11-08 10:05:11 +00:00
resource_gh12183_test.go udpate test configs to work with hcl2 2018-10-16 19:14:54 -07:00
resource_import_other.go plugin: Use correct schema when marshaling imported resource objects 2019-02-01 15:22:54 -08:00
resource_import_other_test.go plugin: Use correct schema when marshaling imported resource objects 2019-02-01 15:22:54 -08:00
resource_list.go add failing test for lost elements in list blocks 2019-01-22 18:10:12 -05:00
resource_list_test.go fix RequiresNew in diff 2019-01-30 14:55:04 -05:00
resource_map.go test for missing map entries 2019-01-23 17:04:17 -05:00
resource_map_test.go test for missing map entries 2019-01-23 17:04:17 -05:00
resource_nested.go add more tests for a computed nested list and set 2019-01-15 11:55:02 -05:00
resource_nested_set.go provider tests for empty values 2019-01-08 16:26:22 -05:00
resource_nested_set_test.go simplify test check 2019-01-30 14:55:04 -05:00
resource_nested_test.go add more tests for a computed nested list and set 2019-01-15 11:55:02 -05:00
resource_state_func.go StateFunc tests 2018-12-03 18:03:45 -05:00
resource_state_func_test.go StateFunc tests 2018-12-03 18:03:45 -05:00
resource_test.go don't count empty containers in diff.Apply 2019-01-23 19:34:11 -05:00
resource_timeout.go add timeout tests to the test provider 2018-10-30 13:14:08 -04:00
resource_timeout_test.go add timeout tests to the test provider 2018-10-30 13:14:08 -04:00
resource_with_custom_diff.go provider/test: Added complex-ish list testing 2017-11-01 14:25:32 -07:00
resource_with_custom_diff_test.go provider/test: Added complex-ish list testing 2017-11-01 14:25:32 -07:00
splat_flatten_test.go udpate test configs to work with hcl2 2018-10-16 19:14:54 -07:00