Skip to content

Commit

Permalink
Revert "Refactor : move testutils from pkg to exoscale to avoid i…
Browse files Browse the repository at this point in the history
…mport cycles"

This reverts commit 30d9747.
  • Loading branch information
tgrondier committed Jan 7, 2025
1 parent a000ce9 commit 0c4bf90
Show file tree
Hide file tree
Showing 39 changed files with 39 additions and 39 deletions.
2 changes: 1 addition & 1 deletion pkg/list/filterable_list_datasource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/resources/anti_affinity_group/datasource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion pkg/resources/anti_affinity_group/resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion pkg/resources/block_storage/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/resources/database/datasource_uri_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion pkg/resources/database/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/resources/database/resource_grafana_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion pkg/resources/database/resource_kafka_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion pkg/resources/database/resource_mysql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion pkg/resources/database/resource_opensearch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion pkg/resources/database/resource_pg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion pkg/resources/database/resource_redis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions pkg/resources/iam/datasource_api_key_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand All @@ -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)
}
Expand All @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/resources/iam/datasource_org_policy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
4 changes: 2 additions & 2 deletions pkg/resources/iam/datasource_role_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/resources/iam/resource_api_key_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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)
}
Expand Down Expand Up @@ -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)
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/resources/iam/resource_org_policy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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)
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/resources/iam/resource_role_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/resources/instance/datasource_list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion pkg/resources/instance/datasource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion pkg/resources/instance/destroy_protection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 = `
Expand Down
2 changes: 1 addition & 1 deletion pkg/resources/instance/resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/resources/instance_pool/datasource_list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion pkg/resources/instance_pool/datasource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/resources/instance_pool/resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
12 changes: 6 additions & 6 deletions pkg/resources/nlb_service/datasource_list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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)
}
Expand All @@ -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)
}
Expand All @@ -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)
}
Expand All @@ -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)
}
Expand All @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/resources/sos_bucket_policy/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 0c4bf90

Please sign in to comment.