terraform/builtin/providers/test
Paddy 5127f1ef8b
command: Unmanaged providers
This adds supports for "unmanaged" providers, or providers with process
lifecycles not controlled by Terraform. These providers are assumed to
be started before Terraform is launched, and are assumed to shut
themselves down after Terraform has finished running.

To do this, we must update the go-plugin dependency to v1.3.0, which
added support for the "test mode" plugin serving that powers all this.

As a side-effect of not needing to manage the process lifecycle anymore,
Terraform also no longer needs to worry about the provider's binary, as
it won't be used for anything anymore. Because of this, we can disable
the init behavior that concerns itself with downloading that provider's
binary, checking its version, and otherwise managing the binary.

This is all managed on a per-provider basis, so managed providers that
Terraform downloads, starts, and stops can be used in the same commands
as unmanaged providers. The TF_REATTACH_PROVIDERS environment variable
is added, and is a JSON encoding of the provider's address to the
information we need to connect to it.

This change enables two benefits: first, delve and other debuggers can
now be attached to provider server processes, and Terraform can connect.
This allows for attaching debuggers to provider processes, which before
was difficult to impossible. Second, it allows the SDK test framework to
host the provider in the same process as the test driver, while running
a production Terraform binary against the provider. This allows for Go's
built-in race detector and test coverage tooling to work as expected in
provider tests.

Unmanaged providers are expected to work in the exact same way as
managed providers, with one caveat: Terraform kills provider processes
and restarts them once per graph walk, meaning multiple times during
most Terraform CLI commands. As unmanaged providers can't be killed by
Terraform, and have no visibility into graph walks, unmanaged providers
are likely to have differences in how their global mutable state behaves
when compared to managed providers. Namely, unmanaged providers are
likely to retain global state when managed providers would have reset
it. Developers relying on global state should be aware of this.
2020-05-26 17:48:57 -07: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 test to make sure a data source is planned 2019-05-03 16:25:37 -04:00
diff_apply_test.go prevent panics when encountering nil diffs 2019-09-04 16:51:42 -04:00
provider.go command: Unmanaged providers 2020-05-26 17:48:57 -07:00
provider_test.go core: Fix issues with ignore_changes 2016-03-21 14:20:36 -05:00
resource.go add tests to preserve existing Set nil behavior 2019-06-28 12:09:50 -04:00
resource_computed_set.go stop removing empty flatmap containers 2019-03-11 15:14:29 -04:00
resource_computed_set_test.go remove the partially-known ~ set sigil in diffs 2019-03-04 17:36:30 -05:00
resource_config_mode.go failing test for cty conversion bug 2019-05-16 16:40:17 -04:00
resource_config_mode_test.go failing test for cty conversion bug 2019-05-16 16:40:17 -04:00
resource_data_dep_test.go udpate test configs to work with hcl2 2018-10-16 19:14:54 -07:00
resource_dataproc_cluster_test.go add test for complex schema diff apply 2019-03-12 12:04:35 -04:00
resource_defaults.go add tests for nested default values 2019-01-17 18:51:18 -05:00
resource_defaults_test.go prevent an empty string from being lost 2019-06-19 17:42:00 -04: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_list.go test for panic when readin empty map 2019-06-25 14:24:31 -04:00
resource_list_set.go add a trouble test schema from the aws provider 2019-02-13 19:09:46 -05:00
resource_list_set_test.go add a trouble test schema from the aws provider 2019-02-13 19:09:46 -05:00
resource_list_test.go test for panic when readin empty map 2019-06-25 14:24:31 -04:00
resource_map.go move hcl2shim package to configs 2019-08-06 19:58:58 -04:00
resource_map_test.go filter unknowns from simple lists and maps in sdk 2019-05-28 09:58:07 -04:00
resource_nested.go add more tests for a computed nested list and set 2019-01-15 11:55:02 -05:00
resource_nested_id.go only force top-level id's back to unknown 2019-02-05 16:16:08 -05:00
resource_nested_id_test.go only force top-level id's back to unknown 2019-02-05 16:16:08 -05:00
resource_nested_set.go provider tests for empty values 2019-01-08 16:26:22 -05:00
resource_nested_set_test.go don't lose track of private data in the ACC tests 2019-09-18 13:59:12 -04:00
resource_nested_test.go add more tests for a computed nested list and set 2019-01-15 11:55:02 -05:00
resource_provider_meta.go Add support for provider metadata to modules. (#22583) 2020-03-05 16:53:24 -08:00
resource_provider_meta_test.go Add support for provider metadata to modules. (#22583) 2020-03-05 16:53:24 -08:00
resource_required_min.go test for Required win MinItems > 1 2019-07-26 14:36:19 -07:00
resource_required_min_test.go test for Required win MinItems > 1 2019-07-26 14:36:19 -07:00
resource_signal.go command: Unmanaged providers 2020-05-26 17:48:57 -07:00
resource_state_func.go add test fetching computed set value by address 2019-04-10 09:42:54 -04:00
resource_state_func_test.go add test fetching computed set value by address 2019-04-10 09:42:54 -04:00
resource_test.go Update when ignore_changes are evaluated, to impact customizediff 2019-09-09 09:35:10 -04:00
resource_timeout.go don't lose track of private data in the ACC tests 2019-09-18 13:59:12 -04:00
resource_timeout_test.go add more timeout provider tests 2019-06-19 22:48:15 -04:00
resource_undeletable.go core: Keep old value on error even for delete 2019-04-17 07:40:15 -07: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