Skip to content

test(provisioner/terraform): clean up testdata structure #17074

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 24, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
resources subfolder
  • Loading branch information
mafredri committed Mar 24, 2025
commit 09b6fe85d36321c0efce3c4aeb1312b52102304d
14 changes: 7 additions & 7 deletions provisioner/terraform/resources_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ func TestConvertResources(t *testing.T) {
expected := expected
t.Run(folderName, func(t *testing.T) {
t.Parallel()
dir := filepath.Join(filepath.Dir(filename), "testdata", folderName)
dir := filepath.Join(filepath.Dir(filename), "testdata", "resources", folderName)
t.Run("Plan", func(t *testing.T) {
t.Parallel()
ctx, logger := ctxAndLogger(t)
Expand Down Expand Up @@ -1021,7 +1021,7 @@ func TestAppSlugValidation(t *testing.T) {
_, filename, _, _ := runtime.Caller(0)

// Load the multiple-apps state file and edit it.
dir := filepath.Join(filepath.Dir(filename), "testdata", "multiple-apps")
dir := filepath.Join(filepath.Dir(filename), "testdata", "resources", "multiple-apps")
tfPlanRaw, err := os.ReadFile(filepath.Join(dir, "multiple-apps.tfplan.json"))
require.NoError(t, err)
var tfPlan tfjson.Plan
Expand Down Expand Up @@ -1070,7 +1070,7 @@ func TestAppSlugDuplicate(t *testing.T) {
// nolint:dogsled
_, filename, _, _ := runtime.Caller(0)

dir := filepath.Join(filepath.Dir(filename), "testdata", "multiple-apps")
dir := filepath.Join(filepath.Dir(filename), "testdata", "resources", "multiple-apps")
tfPlanRaw, err := os.ReadFile(filepath.Join(dir, "multiple-apps.tfplan.json"))
require.NoError(t, err)
var tfPlan tfjson.Plan
Expand Down Expand Up @@ -1098,7 +1098,7 @@ func TestAgentNameInvalid(t *testing.T) {
// nolint:dogsled
_, filename, _, _ := runtime.Caller(0)

dir := filepath.Join(filepath.Dir(filename), "testdata", "multiple-agents")
dir := filepath.Join(filepath.Dir(filename), "testdata", "resources", "multiple-agents")
tfPlanRaw, err := os.ReadFile(filepath.Join(dir, "multiple-agents.tfplan.json"))
require.NoError(t, err)
var tfPlan tfjson.Plan
Expand Down Expand Up @@ -1147,7 +1147,7 @@ func TestAgentNameDuplicate(t *testing.T) {
// nolint:dogsled
_, filename, _, _ := runtime.Caller(0)

dir := filepath.Join(filepath.Dir(filename), "testdata", "multiple-agents")
dir := filepath.Join(filepath.Dir(filename), "testdata", "resources", "multiple-agents")
tfPlanRaw, err := os.ReadFile(filepath.Join(dir, "multiple-agents.tfplan.json"))
require.NoError(t, err)
var tfPlan tfjson.Plan
Expand Down Expand Up @@ -1178,7 +1178,7 @@ func TestMetadataResourceDuplicate(t *testing.T) {
ctx, logger := ctxAndLogger(t)

// Load the multiple-apps state file and edit it.
dir := filepath.Join("testdata", "resource-metadata-duplicate")
dir := filepath.Join("testdata", "resources", "resource-metadata-duplicate")
tfPlanRaw, err := os.ReadFile(filepath.Join(dir, "resource-metadata-duplicate.tfplan.json"))
require.NoError(t, err)
var tfPlan tfjson.Plan
Expand All @@ -1201,7 +1201,7 @@ func TestParameterValidation(t *testing.T) {
_, filename, _, _ := runtime.Caller(0)

// Load the rich-parameters state file and edit it.
dir := filepath.Join(filepath.Dir(filename), "testdata", "rich-parameters")
dir := filepath.Join(filepath.Dir(filename), "testdata", "resources", "rich-parameters")
tfPlanRaw, err := os.ReadFile(filepath.Join(dir, "rich-parameters.tfplan.json"))
require.NoError(t, err)
var tfPlan tfjson.Plan
Expand Down