Skip to content

Commit

Permalink
docs: Remove errant sdk/v2 specifics (#175)
Browse files Browse the repository at this point in the history
Reference: https://discuss.hashicorp.com/t/terraform-framework-migration-testing/55744/2

Since this documentation was introduced, the terraform-plugin-testing Go module and its associated https://developer.hashicorp/terraform/plugin/testing documentation were released. The prior documentation made it sound like sdk/v2-based acceptance testing was required while either testing setup can be used.
  • Loading branch information
bflad authored Jul 7, 2023
1 parent fc494c1 commit 17e128a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func main() {

## Testing Implementation

You can test individual providers using the same [acceptance tests](/terraform/plugin/sdkv2/testing/acceptance-tests) as before. Set the [`ProtoV5ProviderFactories` field of `TestCase`](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource#TestCase.ProtoV5ProviderFactories) to use the acceptance testing framework available in [terraform-provider-sdk/v2/helper/resource](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource).
You can test individual providers using the same [acceptance tests](/terraform/plugin/testing/acceptance-tests) as before. Set the `ProtoV5ProviderFactories` field of `TestCase` with an instance of the mux server, instead of declaring the provider with other `TestCase` fields such as `ProviderFactories`.

The following example uses the acceptance testing framework to create a test for two providers.

Expand Down Expand Up @@ -136,4 +136,4 @@ resource.Test(t, resource.TestCase{
})
```

Refer to the [acceptance tests](/terraform/plugin/sdkv2/testing/acceptance-tests) documentation for more details.
Refer to the [acceptance tests](/terraform/plugin/testing/acceptance-tests) documentation for more details.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func main() {

## Testing Implementation

You can test individual providers using the same [acceptance tests](/terraform/plugin/sdkv2/testing/acceptance-tests) as before. Set the [`ProtoV6ProviderFactories` field of `TestCase`](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource#TestCase.ProtoV6ProviderFactories) to use the acceptance testing framework available in [terraform-provider-sdk/v2/helper/resource](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource).
You can test individual providers using the same [acceptance tests](/terraform/plugin/testing/acceptance-tests) as before. Set the `ProtoV6ProviderFactories` field of `TestCase` with an instance of the mux server, instead of declaring the provider with other `TestCase` fields such as `ProviderFactories`.

The following example uses the acceptance testing framework to create a test for two providers.

Expand Down Expand Up @@ -125,4 +125,4 @@ resource.Test(t, resource.TestCase{
})
```

Refer to the [acceptance tests](/terraform/plugin/sdkv2/testing/acceptance-tests) documentation for more details.
Refer to the [acceptance tests](/terraform/plugin/testing/acceptance-tests) documentation for more details.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Refer to the [`tf6muxserver`](/terraform/plugin/mux/combining-protocol-version-6

## Testing Implementation

You can test the original provider using the same [acceptance tests](/terraform/plugin/sdkv2/testing/acceptance-tests) as before. Set the [`ProtoV6ProviderFactories`](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource#TestCase.ProtoV6ProviderFactories) field of `TestCase` to use the acceptance testing framework available in [terraform-provider-sdk/v2/helper/resource](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource).
You can test the original provider using the same [acceptance tests](/terraform/plugin/testing/acceptance-tests) as before. Set the `ProtoV6ProviderFactories` field of `TestCase` with an instance of the upgraded server, instead of declaring the provider with other `TestCase` fields such as `ProviderFactories`.

The following example creates a test for a combined provider.

Expand All @@ -89,4 +89,4 @@ resource.Test(t, resource.TestCase{
})
```

Refer to the [acceptance tests](/terraform/plugin/sdkv2/testing/acceptance-tests) documentation for more details.
Refer to the [acceptance tests](/terraform/plugin/testing/acceptance-tests) documentation for more details.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Refer to the [`tf5muxserver`](/terraform/plugin/mux/combining-protocol-version-5

## Testing Implementation

You can test the original provider using the same [acceptance tests](/terraform/plugin/sdkv2/testing/acceptance-tests) as before. Set the [`ProtoV5ProviderFactories`](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource#TestCase.ProtoV5ProviderFactories) field of `TestCase` to use the acceptance testing framework available in [terraform-provider-sdk/v2/helper/resource](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource).
You can test the original provider using the same [acceptance tests](/terraform/plugin/testing/acceptance-tests) as before. Set the `ProtoV5ProviderFactories` field of `TestCase` with an instance of the upgraded server, instead of declaring the provider with other `TestCase` fields such as `ProviderFactories`.

The following example creates a test case for a downgraded provider.

Expand Down

0 comments on commit 17e128a

Please sign in to comment.