From 14fce3366da5cf3bca04511535a2898026c3210c Mon Sep 17 00:00:00 2001 From: Pavel Boldyrev <627562+bpg@users.noreply.github.com> Date: Mon, 26 Feb 2024 23:13:02 -0500 Subject: [PATCH] chore: switch to `terraform-plugin-testing` for acceptance tests (#1067) Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com> --- fwprovider/tests/datasource_version_test.go | 2 +- fwprovider/tests/resource_container_test.go | 4 ++-- fwprovider/tests/resource_download_file_test.go | 2 +- fwprovider/tests/resource_file_test.go | 2 +- fwprovider/tests/resource_linux_bridge_test.go | 2 +- fwprovider/tests/resource_linux_vlan_test.go | 2 +- fwprovider/tests/resource_options_test.go | 2 +- fwprovider/tests/resource_user_test.go | 2 +- fwprovider/tests/resource_vm_test.go | 2 +- fwprovider/tests/test_support.go | 4 ++-- go.mod | 1 + go.sum | 2 ++ 12 files changed, 15 insertions(+), 12 deletions(-) diff --git a/fwprovider/tests/datasource_version_test.go b/fwprovider/tests/datasource_version_test.go index 5e5d7096..fc1723b1 100644 --- a/fwprovider/tests/datasource_version_test.go +++ b/fwprovider/tests/datasource_version_test.go @@ -12,7 +12,7 @@ import ( "strings" "testing" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" ) func TestAccDatasourceVersion(t *testing.T) { diff --git a/fwprovider/tests/resource_container_test.go b/fwprovider/tests/resource_container_test.go index f1d81230..ebcf43d6 100644 --- a/fwprovider/tests/resource_container_test.go +++ b/fwprovider/tests/resource_container_test.go @@ -11,8 +11,8 @@ import ( "fmt" "testing" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/stretchr/testify/require" ) diff --git a/fwprovider/tests/resource_download_file_test.go b/fwprovider/tests/resource_download_file_test.go index 2ddf47f8..938d1e32 100644 --- a/fwprovider/tests/resource_download_file_test.go +++ b/fwprovider/tests/resource_download_file_test.go @@ -11,7 +11,7 @@ import ( "fmt" "testing" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/stretchr/testify/require" "github.com/bpg/terraform-provider-proxmox/proxmox/nodes/storage" diff --git a/fwprovider/tests/resource_file_test.go b/fwprovider/tests/resource_file_test.go index a89be393..5f1fb491 100644 --- a/fwprovider/tests/resource_file_test.go +++ b/fwprovider/tests/resource_file_test.go @@ -18,7 +18,7 @@ import ( "github.com/brianvoe/gofakeit/v7" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/stretchr/testify/require" "github.com/bpg/terraform-provider-proxmox/proxmox/api" diff --git a/fwprovider/tests/resource_linux_bridge_test.go b/fwprovider/tests/resource_linux_bridge_test.go index b70d3b35..ff82ed15 100644 --- a/fwprovider/tests/resource_linux_bridge_test.go +++ b/fwprovider/tests/resource_linux_bridge_test.go @@ -13,7 +13,7 @@ import ( "github.com/brianvoe/gofakeit/v7" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" ) const ( diff --git a/fwprovider/tests/resource_linux_vlan_test.go b/fwprovider/tests/resource_linux_vlan_test.go index 3341c6ae..e2dd381b 100644 --- a/fwprovider/tests/resource_linux_vlan_test.go +++ b/fwprovider/tests/resource_linux_vlan_test.go @@ -13,7 +13,7 @@ import ( "testing" "github.com/brianvoe/gofakeit/v7" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" ) const ( diff --git a/fwprovider/tests/resource_options_test.go b/fwprovider/tests/resource_options_test.go index 36c5f889..570135d6 100644 --- a/fwprovider/tests/resource_options_test.go +++ b/fwprovider/tests/resource_options_test.go @@ -10,7 +10,7 @@ import ( "context" "testing" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" ) const accTestClusterOptionsName = "proxmox_virtual_environment_cluster_options.test_options" diff --git a/fwprovider/tests/resource_user_test.go b/fwprovider/tests/resource_user_test.go index c538e946..2bd5d6a0 100644 --- a/fwprovider/tests/resource_user_test.go +++ b/fwprovider/tests/resource_user_test.go @@ -10,7 +10,7 @@ import ( "context" "testing" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" ) func TestAccResourceUser(t *testing.T) { diff --git a/fwprovider/tests/resource_vm_test.go b/fwprovider/tests/resource_vm_test.go index caf7c68a..f645c86d 100644 --- a/fwprovider/tests/resource_vm_test.go +++ b/fwprovider/tests/resource_vm_test.go @@ -10,7 +10,7 @@ import ( "context" "testing" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" ) func TestAccResourceVM(t *testing.T) { diff --git a/fwprovider/tests/test_support.go b/fwprovider/tests/test_support.go index 3c75f01b..7648ca55 100644 --- a/fwprovider/tests/test_support.go +++ b/fwprovider/tests/test_support.go @@ -18,9 +18,9 @@ import ( "github.com/hashicorp/terraform-plugin-go/tfprotov6" "github.com/hashicorp/terraform-plugin-mux/tf5to6server" "github.com/hashicorp/terraform-plugin-mux/tf6muxserver" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" "github.com/stretchr/testify/require" "github.com/bpg/terraform-provider-proxmox/fwprovider" diff --git a/go.mod b/go.mod index 94056769..f5db4abe 100644 --- a/go.mod +++ b/go.mod @@ -17,6 +17,7 @@ require ( github.com/hashicorp/terraform-plugin-log v0.9.0 github.com/hashicorp/terraform-plugin-mux v0.14.0 github.com/hashicorp/terraform-plugin-sdk/v2 v2.32.0 + github.com/hashicorp/terraform-plugin-testing v1.6.0 github.com/pkg/sftp v1.13.6 github.com/skeema/knownhosts v1.2.1 github.com/stretchr/testify v1.8.4 diff --git a/go.sum b/go.sum index 1d31519e..04e1f546 100644 --- a/go.sum +++ b/go.sum @@ -97,6 +97,8 @@ github.com/hashicorp/terraform-plugin-mux v0.14.0 h1:+UeiTaYy8zPAk1pktNRp3288pIi github.com/hashicorp/terraform-plugin-mux v0.14.0/go.mod h1:UzkNhewtpuqSnBvo1ZXSagAxu+hQ+Ir3F5Mpm86dWn0= github.com/hashicorp/terraform-plugin-sdk/v2 v2.32.0 h1:7xdO9aOXVmhvMxNAq8UloyyqW0EEzyAY37llSTHJgjo= github.com/hashicorp/terraform-plugin-sdk/v2 v2.32.0/go.mod h1:LxQzs7AQl/5JE1IGFd6LX8E4A0InRJ/7s245gOmsejA= +github.com/hashicorp/terraform-plugin-testing v1.6.0 h1:Wsnfh+7XSVRfwcr2jZYHsnLOnZl7UeaOBvsx6dl/608= +github.com/hashicorp/terraform-plugin-testing v1.6.0/go.mod h1:cJGG0/8j9XhHaJZRC+0sXFI4uzqQZ9Az4vh6C4GJpFE= github.com/hashicorp/terraform-registry-address v0.2.3 h1:2TAiKJ1A3MAkZlH1YI/aTVcLZRu7JseiXNRHbOAyoTI= github.com/hashicorp/terraform-registry-address v0.2.3/go.mod h1:lFHA76T8jfQteVfT7caREqguFrW3c4MFSPhZB7HHgUM= github.com/hashicorp/terraform-svchost v0.1.1 h1:EZZimZ1GxdqFRinZ1tpJwVxxt49xc/S52uzrw4x0jKQ=