From 0c4bf90a026d130ebcd77693e262385343fc05c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9a=20Grondier?= Date: Tue, 7 Jan 2025 14:57:42 +0100 Subject: [PATCH] Revert "Refactor : move testutils from `pkg` to `exoscale` to avoid import cycles" This reverts commit 30d9747086306ce251f40e0247c29cae455639e5. --- pkg/list/filterable_list_datasource_test.go | 2 +- pkg/resources/anti_affinity_group/datasource_test.go | 2 +- pkg/resources/anti_affinity_group/resource_test.go | 2 +- pkg/resources/block_storage/main_test.go | 2 +- pkg/resources/database/datasource_uri_test.go | 2 +- pkg/resources/database/main_test.go | 2 +- pkg/resources/database/resource_grafana_test.go | 2 +- pkg/resources/database/resource_kafka_test.go | 2 +- pkg/resources/database/resource_mysql_test.go | 2 +- pkg/resources/database/resource_opensearch_test.go | 2 +- pkg/resources/database/resource_pg_test.go | 2 +- pkg/resources/database/resource_redis_test.go | 2 +- pkg/resources/iam/datasource_api_key_test.go | 6 +++--- pkg/resources/iam/datasource_org_policy_test.go | 2 +- pkg/resources/iam/datasource_role_test.go | 4 ++-- pkg/resources/iam/resource_api_key_test.go | 6 +++--- pkg/resources/iam/resource_org_policy_test.go | 4 ++-- pkg/resources/iam/resource_role_test.go | 4 ++-- pkg/resources/instance/datasource_list_test.go | 2 +- pkg/resources/instance/datasource_test.go | 2 +- pkg/resources/instance/destroy_protection_test.go | 2 +- pkg/resources/instance/resource_test.go | 2 +- pkg/resources/instance_pool/datasource_list_test.go | 2 +- pkg/resources/instance_pool/datasource_test.go | 2 +- pkg/resources/instance_pool/resource_test.go | 2 +- pkg/resources/nlb_service/datasource_list_test.go | 12 ++++++------ pkg/resources/sos_bucket_policy/main_test.go | 2 +- {exoscale => pkg}/testutils/api_validators.go | 0 {exoscale => pkg}/testutils/template_models.go | 0 .../testdata/datasource_nlb_service_list.tmpl | 0 .../testdata/datasource_template.tmpl | 0 .../testdata/resource_iam_api_key.tmpl | 0 .../testdata/resource_iam_org_policy.tmpl | 0 .../testdata/resource_iam_role.tmpl | 0 .../testdata/resource_instance_pool.tmpl | 0 .../testdata/resource_nlb.tmpl | 0 .../testdata/resource_nlb_service.tmpl | 0 {exoscale => pkg}/testutils/testutils.go | 0 {exoscale => pkg}/testutils/validation.go | 0 39 files changed, 39 insertions(+), 39 deletions(-) rename {exoscale => pkg}/testutils/api_validators.go (100%) rename {exoscale => pkg}/testutils/template_models.go (100%) rename pkg/{resources/nlb_service => testutils}/testdata/datasource_nlb_service_list.tmpl (100%) rename pkg/{resources/nlb_service => testutils}/testdata/datasource_template.tmpl (100%) rename pkg/{resources/iam => testutils}/testdata/resource_iam_api_key.tmpl (100%) rename pkg/{resources/iam => testutils}/testdata/resource_iam_org_policy.tmpl (100%) rename pkg/{resources/iam => testutils}/testdata/resource_iam_role.tmpl (100%) rename pkg/{resources/nlb_service => testutils}/testdata/resource_instance_pool.tmpl (100%) rename pkg/{resources/nlb_service => testutils}/testdata/resource_nlb.tmpl (100%) rename pkg/{resources/nlb_service => testutils}/testdata/resource_nlb_service.tmpl (100%) rename {exoscale => pkg}/testutils/testutils.go (100%) rename {exoscale => pkg}/testutils/validation.go (100%) diff --git a/pkg/list/filterable_list_datasource_test.go b/pkg/list/filterable_list_datasource_test.go index 88d5fbeb3..a47153161 100644 --- a/pkg/list/filterable_list_datasource_test.go +++ b/pkg/list/filterable_list_datasource_test.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-testing/helper/resource" - "github.com/exoscale/terraform-provider-exoscale/exoscale/testutils" + "github.com/exoscale/terraform-provider-exoscale/pkg/testutils" ) func TestFilterableListDataSource(t *testing.T) { diff --git a/pkg/resources/anti_affinity_group/datasource_test.go b/pkg/resources/anti_affinity_group/datasource_test.go index 3b92b66cb..6eda5e108 100644 --- a/pkg/resources/anti_affinity_group/datasource_test.go +++ b/pkg/resources/anti_affinity_group/datasource_test.go @@ -11,8 +11,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/terraform" - "github.com/exoscale/terraform-provider-exoscale/exoscale/testutils" aagroup "github.com/exoscale/terraform-provider-exoscale/pkg/resources/anti_affinity_group" + "github.com/exoscale/terraform-provider-exoscale/pkg/testutils" ) var dsGroupName = acctest.RandomWithPrefix(testutils.Prefix) diff --git a/pkg/resources/anti_affinity_group/resource_test.go b/pkg/resources/anti_affinity_group/resource_test.go index cac8fc0e4..effe55c40 100644 --- a/pkg/resources/anti_affinity_group/resource_test.go +++ b/pkg/resources/anti_affinity_group/resource_test.go @@ -11,8 +11,8 @@ import ( egoscale "github.com/exoscale/egoscale/v2" - "github.com/exoscale/terraform-provider-exoscale/exoscale/testutils" aagroup "github.com/exoscale/terraform-provider-exoscale/pkg/resources/anti_affinity_group" + "github.com/exoscale/terraform-provider-exoscale/pkg/testutils" ) var ( diff --git a/pkg/resources/block_storage/main_test.go b/pkg/resources/block_storage/main_test.go index fb2b1a59e..e44fcee7f 100644 --- a/pkg/resources/block_storage/main_test.go +++ b/pkg/resources/block_storage/main_test.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/terraform" - "github.com/exoscale/terraform-provider-exoscale/exoscale/testutils" + "github.com/exoscale/terraform-provider-exoscale/pkg/testutils" ) func TestBlockStorage(t *testing.T) { diff --git a/pkg/resources/database/datasource_uri_test.go b/pkg/resources/database/datasource_uri_test.go index 1e727360a..fe9798f3f 100644 --- a/pkg/resources/database/datasource_uri_test.go +++ b/pkg/resources/database/datasource_uri_test.go @@ -6,7 +6,7 @@ import ( "testing" "text/template" - "github.com/exoscale/terraform-provider-exoscale/exoscale/testutils" + "github.com/exoscale/terraform-provider-exoscale/pkg/testutils" "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" diff --git a/pkg/resources/database/main_test.go b/pkg/resources/database/main_test.go index f1c55f980..e2db06577 100644 --- a/pkg/resources/database/main_test.go +++ b/pkg/resources/database/main_test.go @@ -12,7 +12,7 @@ import ( "github.com/exoscale/egoscale/v2/api" "github.com/exoscale/egoscale/v2/oapi" - "github.com/exoscale/terraform-provider-exoscale/exoscale/testutils" + "github.com/exoscale/terraform-provider-exoscale/pkg/testutils" ) func TestDatabase(t *testing.T) { diff --git a/pkg/resources/database/resource_grafana_test.go b/pkg/resources/database/resource_grafana_test.go index 6d38dd60a..21b0d8f94 100644 --- a/pkg/resources/database/resource_grafana_test.go +++ b/pkg/resources/database/resource_grafana_test.go @@ -20,7 +20,7 @@ import ( exoapi "github.com/exoscale/egoscale/v2/api" "github.com/exoscale/egoscale/v2/oapi" - "github.com/exoscale/terraform-provider-exoscale/exoscale/testutils" + "github.com/exoscale/terraform-provider-exoscale/pkg/testutils" ) type TemplateModelGrafana struct { diff --git a/pkg/resources/database/resource_kafka_test.go b/pkg/resources/database/resource_kafka_test.go index 275825316..1252d3f1f 100644 --- a/pkg/resources/database/resource_kafka_test.go +++ b/pkg/resources/database/resource_kafka_test.go @@ -20,7 +20,7 @@ import ( exoapi "github.com/exoscale/egoscale/v2/api" "github.com/exoscale/egoscale/v2/oapi" - "github.com/exoscale/terraform-provider-exoscale/exoscale/testutils" + "github.com/exoscale/terraform-provider-exoscale/pkg/testutils" ) type TemplateModelKafka struct { diff --git a/pkg/resources/database/resource_mysql_test.go b/pkg/resources/database/resource_mysql_test.go index 5572d3fb6..8a2891064 100644 --- a/pkg/resources/database/resource_mysql_test.go +++ b/pkg/resources/database/resource_mysql_test.go @@ -20,7 +20,7 @@ import ( exoapi "github.com/exoscale/egoscale/v2/api" "github.com/exoscale/egoscale/v2/oapi" - "github.com/exoscale/terraform-provider-exoscale/exoscale/testutils" + "github.com/exoscale/terraform-provider-exoscale/pkg/testutils" ) type TemplateModelMysql struct { diff --git a/pkg/resources/database/resource_opensearch_test.go b/pkg/resources/database/resource_opensearch_test.go index 48f451e66..789473bb4 100644 --- a/pkg/resources/database/resource_opensearch_test.go +++ b/pkg/resources/database/resource_opensearch_test.go @@ -20,7 +20,7 @@ import ( exoapi "github.com/exoscale/egoscale/v2/api" "github.com/exoscale/egoscale/v2/oapi" - "github.com/exoscale/terraform-provider-exoscale/exoscale/testutils" + "github.com/exoscale/terraform-provider-exoscale/pkg/testutils" ) type TemplateModelOpensearch struct { diff --git a/pkg/resources/database/resource_pg_test.go b/pkg/resources/database/resource_pg_test.go index 79c6915a8..304085f06 100644 --- a/pkg/resources/database/resource_pg_test.go +++ b/pkg/resources/database/resource_pg_test.go @@ -19,7 +19,7 @@ import ( exoapi "github.com/exoscale/egoscale/v2/api" "github.com/exoscale/egoscale/v2/oapi" - "github.com/exoscale/terraform-provider-exoscale/exoscale/testutils" + "github.com/exoscale/terraform-provider-exoscale/pkg/testutils" ) type TemplateModelPg struct { diff --git a/pkg/resources/database/resource_redis_test.go b/pkg/resources/database/resource_redis_test.go index 4e5a56126..8d6219708 100644 --- a/pkg/resources/database/resource_redis_test.go +++ b/pkg/resources/database/resource_redis_test.go @@ -20,7 +20,7 @@ import ( exoapi "github.com/exoscale/egoscale/v2/api" "github.com/exoscale/egoscale/v2/oapi" - "github.com/exoscale/terraform-provider-exoscale/exoscale/testutils" + "github.com/exoscale/terraform-provider-exoscale/pkg/testutils" ) type TemplateModelRedis struct { diff --git a/pkg/resources/iam/datasource_api_key_test.go b/pkg/resources/iam/datasource_api_key_test.go index a6bd1dbb4..41d866ea3 100644 --- a/pkg/resources/iam/datasource_api_key_test.go +++ b/pkg/resources/iam/datasource_api_key_test.go @@ -5,7 +5,7 @@ import ( "html/template" "testing" - "github.com/exoscale/terraform-provider-exoscale/exoscale/testutils" + "github.com/exoscale/terraform-provider-exoscale/pkg/testutils" "github.com/hashicorp/terraform-plugin-testing/helper/resource" ) @@ -14,7 +14,7 @@ func testDataSourceAPIKey(t *testing.T) { fullResourceName := "data.exoscale_iam_api_key.test" // Role - tpl1, err := template.ParseFiles("./testdata/resource_iam_role.tmpl") + tpl1, err := template.ParseFiles("../../testutils/testdata/resource_iam_role.tmpl") if err != nil { t.Fatal(err) } @@ -33,7 +33,7 @@ func testDataSourceAPIKey(t *testing.T) { configCreate := buf.String() + "\n" // API Key - tpl2, err := template.ParseFiles("./testdata/resource_iam_api_key.tmpl") + tpl2, err := template.ParseFiles("../../testutils/testdata/resource_iam_api_key.tmpl") if err != nil { t.Fatal(err) } diff --git a/pkg/resources/iam/datasource_org_policy_test.go b/pkg/resources/iam/datasource_org_policy_test.go index 9d24c76e2..94c0d8d67 100644 --- a/pkg/resources/iam/datasource_org_policy_test.go +++ b/pkg/resources/iam/datasource_org_policy_test.go @@ -3,7 +3,7 @@ package iam_test import ( "testing" - "github.com/exoscale/terraform-provider-exoscale/exoscale/testutils" + "github.com/exoscale/terraform-provider-exoscale/pkg/testutils" "github.com/hashicorp/terraform-plugin-testing/helper/resource" ) diff --git a/pkg/resources/iam/datasource_role_test.go b/pkg/resources/iam/datasource_role_test.go index 01a7a4d11..bb2f9d33b 100644 --- a/pkg/resources/iam/datasource_role_test.go +++ b/pkg/resources/iam/datasource_role_test.go @@ -5,14 +5,14 @@ import ( "html/template" "testing" - "github.com/exoscale/terraform-provider-exoscale/exoscale/testutils" + "github.com/exoscale/terraform-provider-exoscale/pkg/testutils" "github.com/hashicorp/terraform-plugin-testing/helper/resource" ) func testDataSourceRole(t *testing.T) { // Role - tpl, err := template.ParseFiles("./testdata/resource_iam_role.tmpl") + tpl, err := template.ParseFiles("../../testutils/testdata/resource_iam_role.tmpl") if err != nil { t.Fatal(err) } diff --git a/pkg/resources/iam/resource_api_key_test.go b/pkg/resources/iam/resource_api_key_test.go index 22ca6297f..c55543a00 100644 --- a/pkg/resources/iam/resource_api_key_test.go +++ b/pkg/resources/iam/resource_api_key_test.go @@ -5,7 +5,7 @@ import ( "testing" "text/template" - "github.com/exoscale/terraform-provider-exoscale/exoscale/testutils" + "github.com/exoscale/terraform-provider-exoscale/pkg/testutils" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/terraform" @@ -15,7 +15,7 @@ func testResourceAPIKey(t *testing.T) { fullResourceName := "exoscale_iam_api_key.test" // Role - tpl1, err := template.ParseFiles("./testdata/resource_iam_role.tmpl") + tpl1, err := template.ParseFiles("../../testutils/testdata/resource_iam_role.tmpl") if err != nil { t.Fatal(err) } @@ -51,7 +51,7 @@ func testResourceAPIKey(t *testing.T) { configCreate := buf.String() + "\n" // API Key - tpl2, err := template.ParseFiles("./testdata/resource_iam_api_key.tmpl") + tpl2, err := template.ParseFiles("../../testutils/testdata/resource_iam_api_key.tmpl") if err != nil { t.Fatal(err) } diff --git a/pkg/resources/iam/resource_org_policy_test.go b/pkg/resources/iam/resource_org_policy_test.go index dc0bfe3a8..63b8cbb86 100644 --- a/pkg/resources/iam/resource_org_policy_test.go +++ b/pkg/resources/iam/resource_org_policy_test.go @@ -5,7 +5,7 @@ import ( "testing" "text/template" - "github.com/exoscale/terraform-provider-exoscale/exoscale/testutils" + "github.com/exoscale/terraform-provider-exoscale/pkg/testutils" "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" @@ -15,7 +15,7 @@ func testResourceOrgPolicy(t *testing.T) { fullResourceName := "exoscale_iam_org_policy.test" expression := acctest.RandomWithPrefix(testutils.Prefix) - tpl, err := template.ParseFiles("./testdata/resource_iam_org_policy.tmpl") + tpl, err := template.ParseFiles("../../testutils/testdata/resource_iam_org_policy.tmpl") if err != nil { t.Fatal(err) } diff --git a/pkg/resources/iam/resource_role_test.go b/pkg/resources/iam/resource_role_test.go index e8d556102..5b5e855b4 100644 --- a/pkg/resources/iam/resource_role_test.go +++ b/pkg/resources/iam/resource_role_test.go @@ -5,7 +5,7 @@ import ( "testing" "text/template" - "github.com/exoscale/terraform-provider-exoscale/exoscale/testutils" + "github.com/exoscale/terraform-provider-exoscale/pkg/testutils" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/terraform" @@ -14,7 +14,7 @@ import ( func testResourceRole(t *testing.T) { fullResourceName := "exoscale_iam_role.test" - tpl, err := template.ParseFiles("./testdata/resource_iam_role.tmpl") + tpl, err := template.ParseFiles("../../testutils/testdata/resource_iam_role.tmpl") if err != nil { t.Fatal(err) } diff --git a/pkg/resources/instance/datasource_list_test.go b/pkg/resources/instance/datasource_list_test.go index ef1264827..8c78ed9c2 100644 --- a/pkg/resources/instance/datasource_list_test.go +++ b/pkg/resources/instance/datasource_list_test.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/terraform" - "github.com/exoscale/terraform-provider-exoscale/exoscale/testutils" + "github.com/exoscale/terraform-provider-exoscale/pkg/testutils" ) var ( diff --git a/pkg/resources/instance/datasource_test.go b/pkg/resources/instance/datasource_test.go index c8bb88b43..75c566c26 100644 --- a/pkg/resources/instance/datasource_test.go +++ b/pkg/resources/instance/datasource_test.go @@ -11,8 +11,8 @@ import ( "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/terraform" - "github.com/exoscale/terraform-provider-exoscale/exoscale/testutils" "github.com/exoscale/terraform-provider-exoscale/pkg/resources/instance" + "github.com/exoscale/terraform-provider-exoscale/pkg/testutils" ) var ( diff --git a/pkg/resources/instance/destroy_protection_test.go b/pkg/resources/instance/destroy_protection_test.go index dead70387..19d6e9b68 100644 --- a/pkg/resources/instance/destroy_protection_test.go +++ b/pkg/resources/instance/destroy_protection_test.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/terraform" - "github.com/exoscale/terraform-provider-exoscale/exoscale/testutils" + "github.com/exoscale/terraform-provider-exoscale/pkg/testutils" ) var computeInstanceResource = ` diff --git a/pkg/resources/instance/resource_test.go b/pkg/resources/instance/resource_test.go index 00c73311f..c64e6bf3b 100644 --- a/pkg/resources/instance/resource_test.go +++ b/pkg/resources/instance/resource_test.go @@ -12,8 +12,8 @@ import ( v3 "github.com/exoscale/egoscale/v3" - "github.com/exoscale/terraform-provider-exoscale/exoscale/testutils" "github.com/exoscale/terraform-provider-exoscale/pkg/resources/instance" + "github.com/exoscale/terraform-provider-exoscale/pkg/testutils" "github.com/exoscale/terraform-provider-exoscale/pkg/utils" ) diff --git a/pkg/resources/instance_pool/datasource_list_test.go b/pkg/resources/instance_pool/datasource_list_test.go index 95018ff91..4a11323af 100644 --- a/pkg/resources/instance_pool/datasource_list_test.go +++ b/pkg/resources/instance_pool/datasource_list_test.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/terraform" - "github.com/exoscale/terraform-provider-exoscale/exoscale/testutils" + "github.com/exoscale/terraform-provider-exoscale/pkg/testutils" ) var ( diff --git a/pkg/resources/instance_pool/datasource_test.go b/pkg/resources/instance_pool/datasource_test.go index 954b81d4f..ed5793dc5 100644 --- a/pkg/resources/instance_pool/datasource_test.go +++ b/pkg/resources/instance_pool/datasource_test.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/terraform" - "github.com/exoscale/terraform-provider-exoscale/exoscale/testutils" + "github.com/exoscale/terraform-provider-exoscale/pkg/testutils" "github.com/exoscale/terraform-provider-exoscale/pkg/utils" ) diff --git a/pkg/resources/instance_pool/resource_test.go b/pkg/resources/instance_pool/resource_test.go index aa4a3fc46..184ddb99c 100644 --- a/pkg/resources/instance_pool/resource_test.go +++ b/pkg/resources/instance_pool/resource_test.go @@ -12,8 +12,8 @@ import ( v3 "github.com/exoscale/egoscale/v3" - "github.com/exoscale/terraform-provider-exoscale/exoscale/testutils" "github.com/exoscale/terraform-provider-exoscale/pkg/resources/instance_pool" + "github.com/exoscale/terraform-provider-exoscale/pkg/testutils" "github.com/exoscale/terraform-provider-exoscale/pkg/utils" ) diff --git a/pkg/resources/nlb_service/datasource_list_test.go b/pkg/resources/nlb_service/datasource_list_test.go index 8506fe7be..70083da67 100644 --- a/pkg/resources/nlb_service/datasource_list_test.go +++ b/pkg/resources/nlb_service/datasource_list_test.go @@ -6,7 +6,7 @@ import ( "testing" "text/template" - "github.com/exoscale/terraform-provider-exoscale/exoscale/testutils" + "github.com/exoscale/terraform-provider-exoscale/pkg/testutils" "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" @@ -16,7 +16,7 @@ func testListDataSource(t *testing.T) { buf := &bytes.Buffer{} // template testdata - tpl, err := template.ParseFiles("./testdata/datasource_template.tmpl") + tpl, err := template.ParseFiles("../../testutils/testdata/datasource_template.tmpl") if err != nil { t.Fatal(err) } @@ -33,7 +33,7 @@ func testListDataSource(t *testing.T) { buf.WriteString("\n") // ipool testdata - tpl, err = template.ParseFiles("./testdata/resource_instance_pool.tmpl") + tpl, err = template.ParseFiles("../../testutils/testdata/resource_instance_pool.tmpl") if err != nil { t.Fatal(err) } @@ -54,7 +54,7 @@ func testListDataSource(t *testing.T) { buf.WriteString("\n") // nlb testdata - tpl, err = template.ParseFiles("./testdata/resource_nlb.tmpl") + tpl, err = template.ParseFiles("../../testutils/testdata/resource_nlb.tmpl") if err != nil { t.Fatal(err) } @@ -71,7 +71,7 @@ func testListDataSource(t *testing.T) { buf.WriteString("\n") // nlb_service testdata - tpl, err = template.ParseFiles("./testdata/resource_nlb_service.tmpl") + tpl, err = template.ParseFiles("../../testutils/testdata/resource_nlb_service.tmpl") if err != nil { t.Fatal(err) } @@ -97,7 +97,7 @@ func testListDataSource(t *testing.T) { // datasource by name buf = &bytes.Buffer{} - tpl, err = template.ParseFiles("./testdata/datasource_nlb_service_list.tmpl") + tpl, err = template.ParseFiles("../../testutils/testdata/datasource_nlb_service_list.tmpl") if err != nil { t.Fatal(err) } diff --git a/pkg/resources/sos_bucket_policy/main_test.go b/pkg/resources/sos_bucket_policy/main_test.go index 743aa92f7..1062d2d59 100644 --- a/pkg/resources/sos_bucket_policy/main_test.go +++ b/pkg/resources/sos_bucket_policy/main_test.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-plugin-testing/terraform" - "github.com/exoscale/terraform-provider-exoscale/exoscale/testutils" + "github.com/exoscale/terraform-provider-exoscale/pkg/testutils" ) func TestSOSBucketPolicy(t *testing.T) { diff --git a/exoscale/testutils/api_validators.go b/pkg/testutils/api_validators.go similarity index 100% rename from exoscale/testutils/api_validators.go rename to pkg/testutils/api_validators.go diff --git a/exoscale/testutils/template_models.go b/pkg/testutils/template_models.go similarity index 100% rename from exoscale/testutils/template_models.go rename to pkg/testutils/template_models.go diff --git a/pkg/resources/nlb_service/testdata/datasource_nlb_service_list.tmpl b/pkg/testutils/testdata/datasource_nlb_service_list.tmpl similarity index 100% rename from pkg/resources/nlb_service/testdata/datasource_nlb_service_list.tmpl rename to pkg/testutils/testdata/datasource_nlb_service_list.tmpl diff --git a/pkg/resources/nlb_service/testdata/datasource_template.tmpl b/pkg/testutils/testdata/datasource_template.tmpl similarity index 100% rename from pkg/resources/nlb_service/testdata/datasource_template.tmpl rename to pkg/testutils/testdata/datasource_template.tmpl diff --git a/pkg/resources/iam/testdata/resource_iam_api_key.tmpl b/pkg/testutils/testdata/resource_iam_api_key.tmpl similarity index 100% rename from pkg/resources/iam/testdata/resource_iam_api_key.tmpl rename to pkg/testutils/testdata/resource_iam_api_key.tmpl diff --git a/pkg/resources/iam/testdata/resource_iam_org_policy.tmpl b/pkg/testutils/testdata/resource_iam_org_policy.tmpl similarity index 100% rename from pkg/resources/iam/testdata/resource_iam_org_policy.tmpl rename to pkg/testutils/testdata/resource_iam_org_policy.tmpl diff --git a/pkg/resources/iam/testdata/resource_iam_role.tmpl b/pkg/testutils/testdata/resource_iam_role.tmpl similarity index 100% rename from pkg/resources/iam/testdata/resource_iam_role.tmpl rename to pkg/testutils/testdata/resource_iam_role.tmpl diff --git a/pkg/resources/nlb_service/testdata/resource_instance_pool.tmpl b/pkg/testutils/testdata/resource_instance_pool.tmpl similarity index 100% rename from pkg/resources/nlb_service/testdata/resource_instance_pool.tmpl rename to pkg/testutils/testdata/resource_instance_pool.tmpl diff --git a/pkg/resources/nlb_service/testdata/resource_nlb.tmpl b/pkg/testutils/testdata/resource_nlb.tmpl similarity index 100% rename from pkg/resources/nlb_service/testdata/resource_nlb.tmpl rename to pkg/testutils/testdata/resource_nlb.tmpl diff --git a/pkg/resources/nlb_service/testdata/resource_nlb_service.tmpl b/pkg/testutils/testdata/resource_nlb_service.tmpl similarity index 100% rename from pkg/resources/nlb_service/testdata/resource_nlb_service.tmpl rename to pkg/testutils/testdata/resource_nlb_service.tmpl diff --git a/exoscale/testutils/testutils.go b/pkg/testutils/testutils.go similarity index 100% rename from exoscale/testutils/testutils.go rename to pkg/testutils/testutils.go diff --git a/exoscale/testutils/validation.go b/pkg/testutils/validation.go similarity index 100% rename from exoscale/testutils/validation.go rename to pkg/testutils/validation.go