Merge pull request #21931 from hashicorp/fixtures-dir-name
Standardise directory name for test data
This commit is contained in:
commit
fbbb4dd59d
|
@ -27,5 +27,5 @@ website/node_modules
|
||||||
website/vendor
|
website/vendor
|
||||||
|
|
||||||
# Test exclusions
|
# Test exclusions
|
||||||
!command/test-fixtures/**/*.tfstate
|
!command/testdata/**/*.tfstate
|
||||||
!command/test-fixtures/**/.terraform/
|
!command/testdata/**/.terraform/
|
||||||
|
|
|
@ -32,7 +32,7 @@ func TestLocal_applyBasic(t *testing.T) {
|
||||||
"ami": cty.StringVal("bar"),
|
"ami": cty.StringVal("bar"),
|
||||||
})}
|
})}
|
||||||
|
|
||||||
op, configCleanup := testOperationApply(t, "./test-fixtures/apply")
|
op, configCleanup := testOperationApply(t, "./testdata/apply")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
run, err := b.Operation(context.Background(), op)
|
run, err := b.Operation(context.Background(), op)
|
||||||
|
@ -71,7 +71,7 @@ func TestLocal_applyEmptyDir(t *testing.T) {
|
||||||
p := TestLocalProvider(t, b, "test", &terraform.ProviderSchema{})
|
p := TestLocalProvider(t, b, "test", &terraform.ProviderSchema{})
|
||||||
p.ApplyResourceChangeResponse = providers.ApplyResourceChangeResponse{NewState: cty.ObjectVal(map[string]cty.Value{"id": cty.StringVal("yes")})}
|
p.ApplyResourceChangeResponse = providers.ApplyResourceChangeResponse{NewState: cty.ObjectVal(map[string]cty.Value{"id": cty.StringVal("yes")})}
|
||||||
|
|
||||||
op, configCleanup := testOperationApply(t, "./test-fixtures/empty")
|
op, configCleanup := testOperationApply(t, "./testdata/empty")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
run, err := b.Operation(context.Background(), op)
|
run, err := b.Operation(context.Background(), op)
|
||||||
|
@ -99,7 +99,7 @@ func TestLocal_applyEmptyDirDestroy(t *testing.T) {
|
||||||
p := TestLocalProvider(t, b, "test", &terraform.ProviderSchema{})
|
p := TestLocalProvider(t, b, "test", &terraform.ProviderSchema{})
|
||||||
p.ApplyResourceChangeResponse = providers.ApplyResourceChangeResponse{}
|
p.ApplyResourceChangeResponse = providers.ApplyResourceChangeResponse{}
|
||||||
|
|
||||||
op, configCleanup := testOperationApply(t, "./test-fixtures/empty")
|
op, configCleanup := testOperationApply(t, "./testdata/empty")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
op.Destroy = true
|
op.Destroy = true
|
||||||
|
|
||||||
|
@ -161,7 +161,7 @@ func TestLocal_applyError(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
op, configCleanup := testOperationApply(t, "./test-fixtures/apply-error")
|
op, configCleanup := testOperationApply(t, "./testdata/apply-error")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
run, err := b.Operation(context.Background(), op)
|
run, err := b.Operation(context.Background(), op)
|
||||||
|
@ -201,7 +201,7 @@ func TestLocal_applyBackendFail(t *testing.T) {
|
||||||
}
|
}
|
||||||
defer os.Chdir(wd)
|
defer os.Chdir(wd)
|
||||||
|
|
||||||
op, configCleanup := testOperationApply(t, wd+"/test-fixtures/apply")
|
op, configCleanup := testOperationApply(t, wd+"/testdata/apply")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
b.Backend = &backendWithFailingState{}
|
b.Backend = &backendWithFailingState{}
|
||||||
|
@ -282,7 +282,7 @@ func testApplyState() *terraform.State {
|
||||||
}
|
}
|
||||||
|
|
||||||
// applyFixtureSchema returns a schema suitable for processing the
|
// applyFixtureSchema returns a schema suitable for processing the
|
||||||
// configuration in test-fixtures/apply . This schema should be
|
// configuration in testdata/apply . This schema should be
|
||||||
// assigned to a mock provider named "test".
|
// assigned to a mock provider named "test".
|
||||||
func applyFixtureSchema() *terraform.ProviderSchema {
|
func applyFixtureSchema() *terraform.ProviderSchema {
|
||||||
return &terraform.ProviderSchema{
|
return &terraform.ProviderSchema{
|
||||||
|
|
|
@ -25,7 +25,7 @@ func TestLocal_planBasic(t *testing.T) {
|
||||||
defer cleanup()
|
defer cleanup()
|
||||||
p := TestLocalProvider(t, b, "test", planFixtureSchema())
|
p := TestLocalProvider(t, b, "test", planFixtureSchema())
|
||||||
|
|
||||||
op, configCleanup := testOperationPlan(t, "./test-fixtures/plan")
|
op, configCleanup := testOperationPlan(t, "./testdata/plan")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
op.PlanRefresh = true
|
op.PlanRefresh = true
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ func TestLocal_planInAutomation(t *testing.T) {
|
||||||
b.RunningInAutomation = false
|
b.RunningInAutomation = false
|
||||||
b.CLI = cli.NewMockUi()
|
b.CLI = cli.NewMockUi()
|
||||||
{
|
{
|
||||||
op, configCleanup := testOperationPlan(t, "./test-fixtures/plan")
|
op, configCleanup := testOperationPlan(t, "./testdata/plan")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
op.PlanRefresh = true
|
op.PlanRefresh = true
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ func TestLocal_planInAutomation(t *testing.T) {
|
||||||
b.RunningInAutomation = true
|
b.RunningInAutomation = true
|
||||||
b.CLI = cli.NewMockUi()
|
b.CLI = cli.NewMockUi()
|
||||||
{
|
{
|
||||||
op, configCleanup := testOperationPlan(t, "./test-fixtures/plan")
|
op, configCleanup := testOperationPlan(t, "./testdata/plan")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
op.PlanRefresh = true
|
op.PlanRefresh = true
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ func TestLocal_planNoConfig(t *testing.T) {
|
||||||
|
|
||||||
b.CLI = cli.NewMockUi()
|
b.CLI = cli.NewMockUi()
|
||||||
|
|
||||||
op, configCleanup := testOperationPlan(t, "./test-fixtures/empty")
|
op, configCleanup := testOperationPlan(t, "./testdata/empty")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
op.PlanRefresh = true
|
op.PlanRefresh = true
|
||||||
|
|
||||||
|
@ -139,7 +139,7 @@ func TestLocal_planTainted(t *testing.T) {
|
||||||
outDir := testTempDir(t)
|
outDir := testTempDir(t)
|
||||||
defer os.RemoveAll(outDir)
|
defer os.RemoveAll(outDir)
|
||||||
planPath := filepath.Join(outDir, "plan.tfplan")
|
planPath := filepath.Join(outDir, "plan.tfplan")
|
||||||
op, configCleanup := testOperationPlan(t, "./test-fixtures/plan")
|
op, configCleanup := testOperationPlan(t, "./testdata/plan")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
op.PlanRefresh = true
|
op.PlanRefresh = true
|
||||||
op.PlanOutPath = planPath
|
op.PlanOutPath = planPath
|
||||||
|
@ -224,7 +224,7 @@ func TestLocal_planDeposedOnly(t *testing.T) {
|
||||||
outDir := testTempDir(t)
|
outDir := testTempDir(t)
|
||||||
defer os.RemoveAll(outDir)
|
defer os.RemoveAll(outDir)
|
||||||
planPath := filepath.Join(outDir, "plan.tfplan")
|
planPath := filepath.Join(outDir, "plan.tfplan")
|
||||||
op, configCleanup := testOperationPlan(t, "./test-fixtures/plan")
|
op, configCleanup := testOperationPlan(t, "./testdata/plan")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
op.PlanRefresh = true
|
op.PlanRefresh = true
|
||||||
op.PlanOutPath = planPath
|
op.PlanOutPath = planPath
|
||||||
|
@ -317,7 +317,7 @@ func TestLocal_planTainted_createBeforeDestroy(t *testing.T) {
|
||||||
outDir := testTempDir(t)
|
outDir := testTempDir(t)
|
||||||
defer os.RemoveAll(outDir)
|
defer os.RemoveAll(outDir)
|
||||||
planPath := filepath.Join(outDir, "plan.tfplan")
|
planPath := filepath.Join(outDir, "plan.tfplan")
|
||||||
op, configCleanup := testOperationPlan(t, "./test-fixtures/plan-cbd")
|
op, configCleanup := testOperationPlan(t, "./testdata/plan-cbd")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
op.PlanRefresh = true
|
op.PlanRefresh = true
|
||||||
op.PlanOutPath = planPath
|
op.PlanOutPath = planPath
|
||||||
|
@ -378,7 +378,7 @@ func TestLocal_planRefreshFalse(t *testing.T) {
|
||||||
p := TestLocalProvider(t, b, "test", planFixtureSchema())
|
p := TestLocalProvider(t, b, "test", planFixtureSchema())
|
||||||
testStateFile(t, b.StatePath, testPlanState())
|
testStateFile(t, b.StatePath, testPlanState())
|
||||||
|
|
||||||
op, configCleanup := testOperationPlan(t, "./test-fixtures/plan")
|
op, configCleanup := testOperationPlan(t, "./testdata/plan")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
run, err := b.Operation(context.Background(), op)
|
run, err := b.Operation(context.Background(), op)
|
||||||
|
@ -410,7 +410,7 @@ func TestLocal_planDestroy(t *testing.T) {
|
||||||
defer os.RemoveAll(outDir)
|
defer os.RemoveAll(outDir)
|
||||||
planPath := filepath.Join(outDir, "plan.tfplan")
|
planPath := filepath.Join(outDir, "plan.tfplan")
|
||||||
|
|
||||||
op, configCleanup := testOperationPlan(t, "./test-fixtures/plan")
|
op, configCleanup := testOperationPlan(t, "./testdata/plan")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
op.Destroy = true
|
op.Destroy = true
|
||||||
op.PlanRefresh = true
|
op.PlanRefresh = true
|
||||||
|
@ -466,7 +466,7 @@ func TestLocal_planDestroy_withDataSources(t *testing.T) {
|
||||||
defer os.RemoveAll(outDir)
|
defer os.RemoveAll(outDir)
|
||||||
planPath := filepath.Join(outDir, "plan.tfplan")
|
planPath := filepath.Join(outDir, "plan.tfplan")
|
||||||
|
|
||||||
op, configCleanup := testOperationPlan(t, "./test-fixtures/destroy-with-ds")
|
op, configCleanup := testOperationPlan(t, "./testdata/destroy-with-ds")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
op.Destroy = true
|
op.Destroy = true
|
||||||
op.PlanRefresh = true
|
op.PlanRefresh = true
|
||||||
|
@ -551,7 +551,7 @@ func TestLocal_planOutPathNoChange(t *testing.T) {
|
||||||
defer os.RemoveAll(outDir)
|
defer os.RemoveAll(outDir)
|
||||||
planPath := filepath.Join(outDir, "plan.tfplan")
|
planPath := filepath.Join(outDir, "plan.tfplan")
|
||||||
|
|
||||||
op, configCleanup := testOperationPlan(t, "./test-fixtures/plan")
|
op, configCleanup := testOperationPlan(t, "./testdata/plan")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
op.PlanOutPath = planPath
|
op.PlanOutPath = planPath
|
||||||
cfg := cty.ObjectVal(map[string]cty.Value{
|
cfg := cty.ObjectVal(map[string]cty.Value{
|
||||||
|
@ -601,7 +601,7 @@ func TestLocal_planScaleOutNoDupeCount(t *testing.T) {
|
||||||
outDir := testTempDir(t)
|
outDir := testTempDir(t)
|
||||||
defer os.RemoveAll(outDir)
|
defer os.RemoveAll(outDir)
|
||||||
|
|
||||||
op, configCleanup := testOperationPlan(t, "./test-fixtures/plan-scaleout")
|
op, configCleanup := testOperationPlan(t, "./testdata/plan-scaleout")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
op.PlanRefresh = true
|
op.PlanRefresh = true
|
||||||
|
|
||||||
|
@ -751,7 +751,7 @@ func testReadPlan(t *testing.T, path string) *plans.Plan {
|
||||||
}
|
}
|
||||||
|
|
||||||
// planFixtureSchema returns a schema suitable for processing the
|
// planFixtureSchema returns a schema suitable for processing the
|
||||||
// configuration in test-fixtures/plan . This schema should be
|
// configuration in testdata/plan . This schema should be
|
||||||
// assigned to a mock provider named "test".
|
// assigned to a mock provider named "test".
|
||||||
func planFixtureSchema() *terraform.ProviderSchema {
|
func planFixtureSchema() *terraform.ProviderSchema {
|
||||||
return &terraform.ProviderSchema{
|
return &terraform.ProviderSchema{
|
||||||
|
|
|
@ -26,7 +26,7 @@ func TestLocal_refresh(t *testing.T) {
|
||||||
"id": cty.StringVal("yes"),
|
"id": cty.StringVal("yes"),
|
||||||
})}
|
})}
|
||||||
|
|
||||||
op, configCleanup := testOperationRefresh(t, "./test-fixtures/refresh")
|
op, configCleanup := testOperationRefresh(t, "./testdata/refresh")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
run, err := b.Operation(context.Background(), op)
|
run, err := b.Operation(context.Background(), op)
|
||||||
|
@ -56,7 +56,7 @@ func TestLocal_refreshNoConfig(t *testing.T) {
|
||||||
"id": cty.StringVal("yes"),
|
"id": cty.StringVal("yes"),
|
||||||
})}
|
})}
|
||||||
|
|
||||||
op, configCleanup := testOperationRefresh(t, "./test-fixtures/empty")
|
op, configCleanup := testOperationRefresh(t, "./testdata/empty")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
run, err := b.Operation(context.Background(), op)
|
run, err := b.Operation(context.Background(), op)
|
||||||
|
@ -89,7 +89,7 @@ func TestLocal_refreshNilModuleWithInput(t *testing.T) {
|
||||||
|
|
||||||
b.OpInput = true
|
b.OpInput = true
|
||||||
|
|
||||||
op, configCleanup := testOperationRefresh(t, "./test-fixtures/empty")
|
op, configCleanup := testOperationRefresh(t, "./testdata/empty")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
run, err := b.Operation(context.Background(), op)
|
run, err := b.Operation(context.Background(), op)
|
||||||
|
@ -146,7 +146,7 @@ func TestLocal_refreshInput(t *testing.T) {
|
||||||
b.OpInput = true
|
b.OpInput = true
|
||||||
b.ContextOpts.UIInput = &terraform.MockUIInput{InputReturnString: "bar"}
|
b.ContextOpts.UIInput = &terraform.MockUIInput{InputReturnString: "bar"}
|
||||||
|
|
||||||
op, configCleanup := testOperationRefresh(t, "./test-fixtures/refresh-var-unset")
|
op, configCleanup := testOperationRefresh(t, "./testdata/refresh-var-unset")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
op.UIIn = b.ContextOpts.UIInput
|
op.UIIn = b.ContextOpts.UIInput
|
||||||
|
|
||||||
|
@ -180,7 +180,7 @@ func TestLocal_refreshValidate(t *testing.T) {
|
||||||
// Enable validation
|
// Enable validation
|
||||||
b.OpValidation = true
|
b.OpValidation = true
|
||||||
|
|
||||||
op, configCleanup := testOperationRefresh(t, "./test-fixtures/refresh")
|
op, configCleanup := testOperationRefresh(t, "./testdata/refresh")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
run, err := b.Operation(context.Background(), op)
|
run, err := b.Operation(context.Background(), op)
|
||||||
|
@ -234,7 +234,7 @@ func testRefreshState() *terraform.State {
|
||||||
}
|
}
|
||||||
|
|
||||||
// refreshFixtureSchema returns a schema suitable for processing the
|
// refreshFixtureSchema returns a schema suitable for processing the
|
||||||
// configuration in test-fixtures/refresh . This schema should be
|
// configuration in testdata/refresh . This schema should be
|
||||||
// assigned to a mock provider named "test".
|
// assigned to a mock provider named "test".
|
||||||
func refreshFixtureSchema() *terraform.ProviderSchema {
|
func refreshFixtureSchema() *terraform.ProviderSchema {
|
||||||
return &terraform.ProviderSchema{
|
return &terraform.ProviderSchema{
|
||||||
|
|
|
@ -36,7 +36,7 @@ func TestRemote_applyBasic(t *testing.T) {
|
||||||
b, bCleanup := testBackendDefault(t)
|
b, bCleanup := testBackendDefault(t)
|
||||||
defer bCleanup()
|
defer bCleanup()
|
||||||
|
|
||||||
op, configCleanup := testOperationApply(t, "./test-fixtures/apply")
|
op, configCleanup := testOperationApply(t, "./testdata/apply")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
input := testInput(t, map[string]string{
|
input := testInput(t, map[string]string{
|
||||||
|
@ -80,7 +80,7 @@ func TestRemote_applyCanceled(t *testing.T) {
|
||||||
b, bCleanup := testBackendDefault(t)
|
b, bCleanup := testBackendDefault(t)
|
||||||
defer bCleanup()
|
defer bCleanup()
|
||||||
|
|
||||||
op, configCleanup := testOperationApply(t, "./test-fixtures/apply")
|
op, configCleanup := testOperationApply(t, "./testdata/apply")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
op.Workspace = backend.DefaultStateName
|
op.Workspace = backend.DefaultStateName
|
||||||
|
@ -116,7 +116,7 @@ func TestRemote_applyWithoutPermissions(t *testing.T) {
|
||||||
}
|
}
|
||||||
w.Permissions.CanQueueApply = false
|
w.Permissions.CanQueueApply = false
|
||||||
|
|
||||||
op, configCleanup := testOperationApply(t, "./test-fixtures/apply")
|
op, configCleanup := testOperationApply(t, "./testdata/apply")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
op.UIOut = b.CLI
|
op.UIOut = b.CLI
|
||||||
|
@ -155,7 +155,7 @@ func TestRemote_applyWithVCS(t *testing.T) {
|
||||||
t.Fatalf("error creating named workspace: %v", err)
|
t.Fatalf("error creating named workspace: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
op, configCleanup := testOperationApply(t, "./test-fixtures/apply")
|
op, configCleanup := testOperationApply(t, "./testdata/apply")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
op.Workspace = "prod"
|
op.Workspace = "prod"
|
||||||
|
@ -183,7 +183,7 @@ func TestRemote_applyWithParallelism(t *testing.T) {
|
||||||
b, bCleanup := testBackendDefault(t)
|
b, bCleanup := testBackendDefault(t)
|
||||||
defer bCleanup()
|
defer bCleanup()
|
||||||
|
|
||||||
op, configCleanup := testOperationApply(t, "./test-fixtures/apply")
|
op, configCleanup := testOperationApply(t, "./testdata/apply")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
op.Parallelism = 3
|
op.Parallelism = 3
|
||||||
|
@ -209,7 +209,7 @@ func TestRemote_applyWithPlan(t *testing.T) {
|
||||||
b, bCleanup := testBackendDefault(t)
|
b, bCleanup := testBackendDefault(t)
|
||||||
defer bCleanup()
|
defer bCleanup()
|
||||||
|
|
||||||
op, configCleanup := testOperationApply(t, "./test-fixtures/apply")
|
op, configCleanup := testOperationApply(t, "./testdata/apply")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
op.PlanFile = &planfile.Reader{}
|
op.PlanFile = &planfile.Reader{}
|
||||||
|
@ -238,7 +238,7 @@ func TestRemote_applyWithoutRefresh(t *testing.T) {
|
||||||
b, bCleanup := testBackendDefault(t)
|
b, bCleanup := testBackendDefault(t)
|
||||||
defer bCleanup()
|
defer bCleanup()
|
||||||
|
|
||||||
op, configCleanup := testOperationApply(t, "./test-fixtures/apply")
|
op, configCleanup := testOperationApply(t, "./testdata/apply")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
op.PlanRefresh = false
|
op.PlanRefresh = false
|
||||||
|
@ -264,7 +264,7 @@ func TestRemote_applyWithTarget(t *testing.T) {
|
||||||
b, bCleanup := testBackendDefault(t)
|
b, bCleanup := testBackendDefault(t)
|
||||||
defer bCleanup()
|
defer bCleanup()
|
||||||
|
|
||||||
op, configCleanup := testOperationApply(t, "./test-fixtures/apply")
|
op, configCleanup := testOperationApply(t, "./testdata/apply")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
addr, _ := addrs.ParseAbsResourceStr("null_resource.foo")
|
addr, _ := addrs.ParseAbsResourceStr("null_resource.foo")
|
||||||
|
@ -295,7 +295,7 @@ func TestRemote_applyWithVariables(t *testing.T) {
|
||||||
b, bCleanup := testBackendDefault(t)
|
b, bCleanup := testBackendDefault(t)
|
||||||
defer bCleanup()
|
defer bCleanup()
|
||||||
|
|
||||||
op, configCleanup := testOperationApply(t, "./test-fixtures/apply-variables")
|
op, configCleanup := testOperationApply(t, "./testdata/apply-variables")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
op.Variables = testVariables(terraform.ValueFromNamedFile, "foo", "bar")
|
op.Variables = testVariables(terraform.ValueFromNamedFile, "foo", "bar")
|
||||||
|
@ -321,7 +321,7 @@ func TestRemote_applyNoConfig(t *testing.T) {
|
||||||
b, bCleanup := testBackendDefault(t)
|
b, bCleanup := testBackendDefault(t)
|
||||||
defer bCleanup()
|
defer bCleanup()
|
||||||
|
|
||||||
op, configCleanup := testOperationApply(t, "./test-fixtures/empty")
|
op, configCleanup := testOperationApply(t, "./testdata/empty")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
op.Workspace = backend.DefaultStateName
|
op.Workspace = backend.DefaultStateName
|
||||||
|
@ -349,7 +349,7 @@ func TestRemote_applyNoChanges(t *testing.T) {
|
||||||
b, bCleanup := testBackendDefault(t)
|
b, bCleanup := testBackendDefault(t)
|
||||||
defer bCleanup()
|
defer bCleanup()
|
||||||
|
|
||||||
op, configCleanup := testOperationApply(t, "./test-fixtures/apply-no-changes")
|
op, configCleanup := testOperationApply(t, "./testdata/apply-no-changes")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
op.Workspace = backend.DefaultStateName
|
op.Workspace = backend.DefaultStateName
|
||||||
|
@ -380,7 +380,7 @@ func TestRemote_applyNoApprove(t *testing.T) {
|
||||||
b, bCleanup := testBackendDefault(t)
|
b, bCleanup := testBackendDefault(t)
|
||||||
defer bCleanup()
|
defer bCleanup()
|
||||||
|
|
||||||
op, configCleanup := testOperationApply(t, "./test-fixtures/apply")
|
op, configCleanup := testOperationApply(t, "./testdata/apply")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
input := testInput(t, map[string]string{
|
input := testInput(t, map[string]string{
|
||||||
|
@ -418,7 +418,7 @@ func TestRemote_applyAutoApprove(t *testing.T) {
|
||||||
b, bCleanup := testBackendDefault(t)
|
b, bCleanup := testBackendDefault(t)
|
||||||
defer bCleanup()
|
defer bCleanup()
|
||||||
|
|
||||||
op, configCleanup := testOperationApply(t, "./test-fixtures/apply")
|
op, configCleanup := testOperationApply(t, "./testdata/apply")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
input := testInput(t, map[string]string{
|
input := testInput(t, map[string]string{
|
||||||
|
@ -463,7 +463,7 @@ func TestRemote_applyApprovedExternally(t *testing.T) {
|
||||||
b, bCleanup := testBackendDefault(t)
|
b, bCleanup := testBackendDefault(t)
|
||||||
defer bCleanup()
|
defer bCleanup()
|
||||||
|
|
||||||
op, configCleanup := testOperationApply(t, "./test-fixtures/apply")
|
op, configCleanup := testOperationApply(t, "./testdata/apply")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
input := testInput(t, map[string]string{
|
input := testInput(t, map[string]string{
|
||||||
|
@ -538,7 +538,7 @@ func TestRemote_applyDiscardedExternally(t *testing.T) {
|
||||||
b, bCleanup := testBackendDefault(t)
|
b, bCleanup := testBackendDefault(t)
|
||||||
defer bCleanup()
|
defer bCleanup()
|
||||||
|
|
||||||
op, configCleanup := testOperationApply(t, "./test-fixtures/apply")
|
op, configCleanup := testOperationApply(t, "./testdata/apply")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
input := testInput(t, map[string]string{
|
input := testInput(t, map[string]string{
|
||||||
|
@ -626,7 +626,7 @@ func TestRemote_applyWithAutoApply(t *testing.T) {
|
||||||
t.Fatalf("error creating named workspace: %v", err)
|
t.Fatalf("error creating named workspace: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
op, configCleanup := testOperationApply(t, "./test-fixtures/apply")
|
op, configCleanup := testOperationApply(t, "./testdata/apply")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
input := testInput(t, map[string]string{
|
input := testInput(t, map[string]string{
|
||||||
|
@ -677,7 +677,7 @@ func TestRemote_applyForceLocal(t *testing.T) {
|
||||||
b, bCleanup := testBackendDefault(t)
|
b, bCleanup := testBackendDefault(t)
|
||||||
defer bCleanup()
|
defer bCleanup()
|
||||||
|
|
||||||
op, configCleanup := testOperationApply(t, "./test-fixtures/apply")
|
op, configCleanup := testOperationApply(t, "./testdata/apply")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
input := testInput(t, map[string]string{
|
input := testInput(t, map[string]string{
|
||||||
|
@ -735,7 +735,7 @@ func TestRemote_applyWorkspaceWithoutOperations(t *testing.T) {
|
||||||
t.Fatalf("error creating named workspace: %v", err)
|
t.Fatalf("error creating named workspace: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
op, configCleanup := testOperationApply(t, "./test-fixtures/apply")
|
op, configCleanup := testOperationApply(t, "./testdata/apply")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
input := testInput(t, map[string]string{
|
input := testInput(t, map[string]string{
|
||||||
|
@ -802,7 +802,7 @@ func TestRemote_applyLockTimeout(t *testing.T) {
|
||||||
t.Fatalf("error creating pending run: %v", err)
|
t.Fatalf("error creating pending run: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
op, configCleanup := testOperationApply(t, "./test-fixtures/apply")
|
op, configCleanup := testOperationApply(t, "./testdata/apply")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
input := testInput(t, map[string]string{
|
input := testInput(t, map[string]string{
|
||||||
|
@ -853,7 +853,7 @@ func TestRemote_applyDestroy(t *testing.T) {
|
||||||
b, bCleanup := testBackendDefault(t)
|
b, bCleanup := testBackendDefault(t)
|
||||||
defer bCleanup()
|
defer bCleanup()
|
||||||
|
|
||||||
op, configCleanup := testOperationApply(t, "./test-fixtures/apply-destroy")
|
op, configCleanup := testOperationApply(t, "./testdata/apply-destroy")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
input := testInput(t, map[string]string{
|
input := testInput(t, map[string]string{
|
||||||
|
@ -902,7 +902,7 @@ func TestRemote_applyDestroyNoConfig(t *testing.T) {
|
||||||
"approve": "yes",
|
"approve": "yes",
|
||||||
})
|
})
|
||||||
|
|
||||||
op, configCleanup := testOperationApply(t, "./test-fixtures/empty")
|
op, configCleanup := testOperationApply(t, "./testdata/empty")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
op.Destroy = true
|
op.Destroy = true
|
||||||
|
@ -932,7 +932,7 @@ func TestRemote_applyPolicyPass(t *testing.T) {
|
||||||
b, bCleanup := testBackendDefault(t)
|
b, bCleanup := testBackendDefault(t)
|
||||||
defer bCleanup()
|
defer bCleanup()
|
||||||
|
|
||||||
op, configCleanup := testOperationApply(t, "./test-fixtures/apply-policy-passed")
|
op, configCleanup := testOperationApply(t, "./testdata/apply-policy-passed")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
input := testInput(t, map[string]string{
|
input := testInput(t, map[string]string{
|
||||||
|
@ -979,7 +979,7 @@ func TestRemote_applyPolicyHardFail(t *testing.T) {
|
||||||
b, bCleanup := testBackendDefault(t)
|
b, bCleanup := testBackendDefault(t)
|
||||||
defer bCleanup()
|
defer bCleanup()
|
||||||
|
|
||||||
op, configCleanup := testOperationApply(t, "./test-fixtures/apply-policy-hard-failed")
|
op, configCleanup := testOperationApply(t, "./testdata/apply-policy-hard-failed")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
input := testInput(t, map[string]string{
|
input := testInput(t, map[string]string{
|
||||||
|
@ -1031,7 +1031,7 @@ func TestRemote_applyPolicySoftFail(t *testing.T) {
|
||||||
b, bCleanup := testBackendDefault(t)
|
b, bCleanup := testBackendDefault(t)
|
||||||
defer bCleanup()
|
defer bCleanup()
|
||||||
|
|
||||||
op, configCleanup := testOperationApply(t, "./test-fixtures/apply-policy-soft-failed")
|
op, configCleanup := testOperationApply(t, "./testdata/apply-policy-soft-failed")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
input := testInput(t, map[string]string{
|
input := testInput(t, map[string]string{
|
||||||
|
@ -1079,7 +1079,7 @@ func TestRemote_applyPolicySoftFailAutoApprove(t *testing.T) {
|
||||||
b, bCleanup := testBackendDefault(t)
|
b, bCleanup := testBackendDefault(t)
|
||||||
defer bCleanup()
|
defer bCleanup()
|
||||||
|
|
||||||
op, configCleanup := testOperationApply(t, "./test-fixtures/apply-policy-soft-failed")
|
op, configCleanup := testOperationApply(t, "./testdata/apply-policy-soft-failed")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
input := testInput(t, map[string]string{
|
input := testInput(t, map[string]string{
|
||||||
|
@ -1145,7 +1145,7 @@ func TestRemote_applyPolicySoftFailAutoApply(t *testing.T) {
|
||||||
t.Fatalf("error creating named workspace: %v", err)
|
t.Fatalf("error creating named workspace: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
op, configCleanup := testOperationApply(t, "./test-fixtures/apply-policy-soft-failed")
|
op, configCleanup := testOperationApply(t, "./testdata/apply-policy-soft-failed")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
input := testInput(t, map[string]string{
|
input := testInput(t, map[string]string{
|
||||||
|
@ -1193,7 +1193,7 @@ func TestRemote_applyWithRemoteError(t *testing.T) {
|
||||||
b, bCleanup := testBackendDefault(t)
|
b, bCleanup := testBackendDefault(t)
|
||||||
defer bCleanup()
|
defer bCleanup()
|
||||||
|
|
||||||
op, configCleanup := testOperationApply(t, "./test-fixtures/apply-with-error")
|
op, configCleanup := testOperationApply(t, "./testdata/apply-with-error")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
op.Workspace = backend.DefaultStateName
|
op.Workspace = backend.DefaultStateName
|
||||||
|
|
|
@ -36,7 +36,7 @@ func TestRemote_planBasic(t *testing.T) {
|
||||||
b, bCleanup := testBackendDefault(t)
|
b, bCleanup := testBackendDefault(t)
|
||||||
defer bCleanup()
|
defer bCleanup()
|
||||||
|
|
||||||
op, configCleanup := testOperationPlan(t, "./test-fixtures/plan")
|
op, configCleanup := testOperationPlan(t, "./testdata/plan")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
op.Workspace = backend.DefaultStateName
|
op.Workspace = backend.DefaultStateName
|
||||||
|
@ -67,7 +67,7 @@ func TestRemote_planCanceled(t *testing.T) {
|
||||||
b, bCleanup := testBackendDefault(t)
|
b, bCleanup := testBackendDefault(t)
|
||||||
defer bCleanup()
|
defer bCleanup()
|
||||||
|
|
||||||
op, configCleanup := testOperationPlan(t, "./test-fixtures/plan")
|
op, configCleanup := testOperationPlan(t, "./testdata/plan")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
op.Workspace = backend.DefaultStateName
|
op.Workspace = backend.DefaultStateName
|
||||||
|
@ -90,7 +90,7 @@ func TestRemote_planLongLine(t *testing.T) {
|
||||||
b, bCleanup := testBackendDefault(t)
|
b, bCleanup := testBackendDefault(t)
|
||||||
defer bCleanup()
|
defer bCleanup()
|
||||||
|
|
||||||
op, configCleanup := testOperationPlan(t, "./test-fixtures/plan-long-line")
|
op, configCleanup := testOperationPlan(t, "./testdata/plan-long-line")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
op.Workspace = backend.DefaultStateName
|
op.Workspace = backend.DefaultStateName
|
||||||
|
@ -134,7 +134,7 @@ func TestRemote_planWithoutPermissions(t *testing.T) {
|
||||||
}
|
}
|
||||||
w.Permissions.CanQueueRun = false
|
w.Permissions.CanQueueRun = false
|
||||||
|
|
||||||
op, configCleanup := testOperationPlan(t, "./test-fixtures/plan")
|
op, configCleanup := testOperationPlan(t, "./testdata/plan")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
op.Workspace = "prod"
|
op.Workspace = "prod"
|
||||||
|
@ -159,7 +159,7 @@ func TestRemote_planWithParallelism(t *testing.T) {
|
||||||
b, bCleanup := testBackendDefault(t)
|
b, bCleanup := testBackendDefault(t)
|
||||||
defer bCleanup()
|
defer bCleanup()
|
||||||
|
|
||||||
op, configCleanup := testOperationPlan(t, "./test-fixtures/plan")
|
op, configCleanup := testOperationPlan(t, "./testdata/plan")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
op.Parallelism = 3
|
op.Parallelism = 3
|
||||||
|
@ -185,7 +185,7 @@ func TestRemote_planWithPlan(t *testing.T) {
|
||||||
b, bCleanup := testBackendDefault(t)
|
b, bCleanup := testBackendDefault(t)
|
||||||
defer bCleanup()
|
defer bCleanup()
|
||||||
|
|
||||||
op, configCleanup := testOperationPlan(t, "./test-fixtures/plan")
|
op, configCleanup := testOperationPlan(t, "./testdata/plan")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
op.PlanFile = &planfile.Reader{}
|
op.PlanFile = &planfile.Reader{}
|
||||||
|
@ -214,10 +214,10 @@ func TestRemote_planWithPath(t *testing.T) {
|
||||||
b, bCleanup := testBackendDefault(t)
|
b, bCleanup := testBackendDefault(t)
|
||||||
defer bCleanup()
|
defer bCleanup()
|
||||||
|
|
||||||
op, configCleanup := testOperationPlan(t, "./test-fixtures/plan")
|
op, configCleanup := testOperationPlan(t, "./testdata/plan")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
op.PlanOutPath = "./test-fixtures/plan"
|
op.PlanOutPath = "./testdata/plan"
|
||||||
op.Workspace = backend.DefaultStateName
|
op.Workspace = backend.DefaultStateName
|
||||||
|
|
||||||
run, err := b.Operation(context.Background(), op)
|
run, err := b.Operation(context.Background(), op)
|
||||||
|
@ -243,7 +243,7 @@ func TestRemote_planWithoutRefresh(t *testing.T) {
|
||||||
b, bCleanup := testBackendDefault(t)
|
b, bCleanup := testBackendDefault(t)
|
||||||
defer bCleanup()
|
defer bCleanup()
|
||||||
|
|
||||||
op, configCleanup := testOperationPlan(t, "./test-fixtures/plan")
|
op, configCleanup := testOperationPlan(t, "./testdata/plan")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
op.PlanRefresh = false
|
op.PlanRefresh = false
|
||||||
|
@ -269,7 +269,7 @@ func TestRemote_planWithTarget(t *testing.T) {
|
||||||
b, bCleanup := testBackendDefault(t)
|
b, bCleanup := testBackendDefault(t)
|
||||||
defer bCleanup()
|
defer bCleanup()
|
||||||
|
|
||||||
op, configCleanup := testOperationPlan(t, "./test-fixtures/plan")
|
op, configCleanup := testOperationPlan(t, "./testdata/plan")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
addr, _ := addrs.ParseAbsResourceStr("null_resource.foo")
|
addr, _ := addrs.ParseAbsResourceStr("null_resource.foo")
|
||||||
|
@ -300,7 +300,7 @@ func TestRemote_planWithVariables(t *testing.T) {
|
||||||
b, bCleanup := testBackendDefault(t)
|
b, bCleanup := testBackendDefault(t)
|
||||||
defer bCleanup()
|
defer bCleanup()
|
||||||
|
|
||||||
op, configCleanup := testOperationPlan(t, "./test-fixtures/plan-variables")
|
op, configCleanup := testOperationPlan(t, "./testdata/plan-variables")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
op.Variables = testVariables(terraform.ValueFromCLIArg, "foo", "bar")
|
op.Variables = testVariables(terraform.ValueFromCLIArg, "foo", "bar")
|
||||||
|
@ -326,7 +326,7 @@ func TestRemote_planNoConfig(t *testing.T) {
|
||||||
b, bCleanup := testBackendDefault(t)
|
b, bCleanup := testBackendDefault(t)
|
||||||
defer bCleanup()
|
defer bCleanup()
|
||||||
|
|
||||||
op, configCleanup := testOperationPlan(t, "./test-fixtures/empty")
|
op, configCleanup := testOperationPlan(t, "./testdata/empty")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
op.Workspace = backend.DefaultStateName
|
op.Workspace = backend.DefaultStateName
|
||||||
|
@ -354,7 +354,7 @@ func TestRemote_planNoChanges(t *testing.T) {
|
||||||
b, bCleanup := testBackendDefault(t)
|
b, bCleanup := testBackendDefault(t)
|
||||||
defer bCleanup()
|
defer bCleanup()
|
||||||
|
|
||||||
op, configCleanup := testOperationPlan(t, "./test-fixtures/plan-no-changes")
|
op, configCleanup := testOperationPlan(t, "./testdata/plan-no-changes")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
op.Workspace = backend.DefaultStateName
|
op.Workspace = backend.DefaultStateName
|
||||||
|
@ -392,7 +392,7 @@ func TestRemote_planForceLocal(t *testing.T) {
|
||||||
b, bCleanup := testBackendDefault(t)
|
b, bCleanup := testBackendDefault(t)
|
||||||
defer bCleanup()
|
defer bCleanup()
|
||||||
|
|
||||||
op, configCleanup := testOperationPlan(t, "./test-fixtures/plan")
|
op, configCleanup := testOperationPlan(t, "./testdata/plan")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
op.Workspace = backend.DefaultStateName
|
op.Workspace = backend.DefaultStateName
|
||||||
|
@ -423,7 +423,7 @@ func TestRemote_planWithoutOperationsEntitlement(t *testing.T) {
|
||||||
b, bCleanup := testBackendNoOperations(t)
|
b, bCleanup := testBackendNoOperations(t)
|
||||||
defer bCleanup()
|
defer bCleanup()
|
||||||
|
|
||||||
op, configCleanup := testOperationPlan(t, "./test-fixtures/plan")
|
op, configCleanup := testOperationPlan(t, "./testdata/plan")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
op.Workspace = backend.DefaultStateName
|
op.Workspace = backend.DefaultStateName
|
||||||
|
@ -468,7 +468,7 @@ func TestRemote_planWorkspaceWithoutOperations(t *testing.T) {
|
||||||
t.Fatalf("error creating named workspace: %v", err)
|
t.Fatalf("error creating named workspace: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
op, configCleanup := testOperationPlan(t, "./test-fixtures/plan")
|
op, configCleanup := testOperationPlan(t, "./testdata/plan")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
op.Workspace = "no-operations"
|
op.Workspace = "no-operations"
|
||||||
|
@ -522,7 +522,7 @@ func TestRemote_planLockTimeout(t *testing.T) {
|
||||||
t.Fatalf("error creating pending run: %v", err)
|
t.Fatalf("error creating pending run: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
op, configCleanup := testOperationPlan(t, "./test-fixtures/plan")
|
op, configCleanup := testOperationPlan(t, "./testdata/plan")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
input := testInput(t, map[string]string{
|
input := testInput(t, map[string]string{
|
||||||
|
@ -570,7 +570,7 @@ func TestRemote_planDestroy(t *testing.T) {
|
||||||
b, bCleanup := testBackendDefault(t)
|
b, bCleanup := testBackendDefault(t)
|
||||||
defer bCleanup()
|
defer bCleanup()
|
||||||
|
|
||||||
op, configCleanup := testOperationPlan(t, "./test-fixtures/plan")
|
op, configCleanup := testOperationPlan(t, "./testdata/plan")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
op.Destroy = true
|
op.Destroy = true
|
||||||
|
@ -594,7 +594,7 @@ func TestRemote_planDestroyNoConfig(t *testing.T) {
|
||||||
b, bCleanup := testBackendDefault(t)
|
b, bCleanup := testBackendDefault(t)
|
||||||
defer bCleanup()
|
defer bCleanup()
|
||||||
|
|
||||||
op, configCleanup := testOperationPlan(t, "./test-fixtures/empty")
|
op, configCleanup := testOperationPlan(t, "./testdata/empty")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
op.Destroy = true
|
op.Destroy = true
|
||||||
|
@ -628,7 +628,7 @@ func TestRemote_planWithWorkingDirectory(t *testing.T) {
|
||||||
t.Fatalf("error configuring working directory: %v", err)
|
t.Fatalf("error configuring working directory: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
op, configCleanup := testOperationPlan(t, "./test-fixtures/plan-with-working-directory/terraform")
|
op, configCleanup := testOperationPlan(t, "./testdata/plan-with-working-directory/terraform")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
op.Workspace = backend.DefaultStateName
|
op.Workspace = backend.DefaultStateName
|
||||||
|
@ -659,7 +659,7 @@ func TestRemote_planPolicyPass(t *testing.T) {
|
||||||
b, bCleanup := testBackendDefault(t)
|
b, bCleanup := testBackendDefault(t)
|
||||||
defer bCleanup()
|
defer bCleanup()
|
||||||
|
|
||||||
op, configCleanup := testOperationPlan(t, "./test-fixtures/plan-policy-passed")
|
op, configCleanup := testOperationPlan(t, "./testdata/plan-policy-passed")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
op.Workspace = backend.DefaultStateName
|
op.Workspace = backend.DefaultStateName
|
||||||
|
@ -693,7 +693,7 @@ func TestRemote_planPolicyHardFail(t *testing.T) {
|
||||||
b, bCleanup := testBackendDefault(t)
|
b, bCleanup := testBackendDefault(t)
|
||||||
defer bCleanup()
|
defer bCleanup()
|
||||||
|
|
||||||
op, configCleanup := testOperationPlan(t, "./test-fixtures/plan-policy-hard-failed")
|
op, configCleanup := testOperationPlan(t, "./testdata/plan-policy-hard-failed")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
op.Workspace = backend.DefaultStateName
|
op.Workspace = backend.DefaultStateName
|
||||||
|
@ -732,7 +732,7 @@ func TestRemote_planPolicySoftFail(t *testing.T) {
|
||||||
b, bCleanup := testBackendDefault(t)
|
b, bCleanup := testBackendDefault(t)
|
||||||
defer bCleanup()
|
defer bCleanup()
|
||||||
|
|
||||||
op, configCleanup := testOperationPlan(t, "./test-fixtures/plan-policy-soft-failed")
|
op, configCleanup := testOperationPlan(t, "./testdata/plan-policy-soft-failed")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
op.Workspace = backend.DefaultStateName
|
op.Workspace = backend.DefaultStateName
|
||||||
|
@ -771,7 +771,7 @@ func TestRemote_planWithRemoteError(t *testing.T) {
|
||||||
b, bCleanup := testBackendDefault(t)
|
b, bCleanup := testBackendDefault(t)
|
||||||
defer bCleanup()
|
defer bCleanup()
|
||||||
|
|
||||||
op, configCleanup := testOperationPlan(t, "./test-fixtures/plan-with-error")
|
op, configCleanup := testOperationPlan(t, "./testdata/plan-with-error")
|
||||||
defer configCleanup()
|
defer configCleanup()
|
||||||
|
|
||||||
op.Workspace = backend.DefaultStateName
|
op.Workspace = backend.DefaultStateName
|
||||||
|
|
|
@ -25,13 +25,13 @@ func TestState_basic(t *testing.T) {
|
||||||
cty.ObjectVal(map[string]cty.Value{
|
cty.ObjectVal(map[string]cty.Value{
|
||||||
"backend": cty.StringVal("local"),
|
"backend": cty.StringVal("local"),
|
||||||
"config": cty.ObjectVal(map[string]cty.Value{
|
"config": cty.ObjectVal(map[string]cty.Value{
|
||||||
"path": cty.StringVal("./test-fixtures/basic.tfstate"),
|
"path": cty.StringVal("./testdata/basic.tfstate"),
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
cty.ObjectVal(map[string]cty.Value{
|
cty.ObjectVal(map[string]cty.Value{
|
||||||
"backend": cty.StringVal("local"),
|
"backend": cty.StringVal("local"),
|
||||||
"config": cty.ObjectVal(map[string]cty.Value{
|
"config": cty.ObjectVal(map[string]cty.Value{
|
||||||
"path": cty.StringVal("./test-fixtures/basic.tfstate"),
|
"path": cty.StringVal("./testdata/basic.tfstate"),
|
||||||
}),
|
}),
|
||||||
"outputs": cty.ObjectVal(map[string]cty.Value{
|
"outputs": cty.ObjectVal(map[string]cty.Value{
|
||||||
"foo": cty.StringVal("bar"),
|
"foo": cty.StringVal("bar"),
|
||||||
|
@ -45,13 +45,13 @@ func TestState_basic(t *testing.T) {
|
||||||
cty.ObjectVal(map[string]cty.Value{
|
cty.ObjectVal(map[string]cty.Value{
|
||||||
"backend": cty.StringVal("local"),
|
"backend": cty.StringVal("local"),
|
||||||
"config": cty.ObjectVal(map[string]cty.Value{
|
"config": cty.ObjectVal(map[string]cty.Value{
|
||||||
"path": cty.StringVal("./test-fixtures/complex_outputs.tfstate"),
|
"path": cty.StringVal("./testdata/complex_outputs.tfstate"),
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
cty.ObjectVal(map[string]cty.Value{
|
cty.ObjectVal(map[string]cty.Value{
|
||||||
"backend": cty.StringVal("local"),
|
"backend": cty.StringVal("local"),
|
||||||
"config": cty.ObjectVal(map[string]cty.Value{
|
"config": cty.ObjectVal(map[string]cty.Value{
|
||||||
"path": cty.StringVal("./test-fixtures/complex_outputs.tfstate"),
|
"path": cty.StringVal("./testdata/complex_outputs.tfstate"),
|
||||||
}),
|
}),
|
||||||
"outputs": cty.ObjectVal(map[string]cty.Value{
|
"outputs": cty.ObjectVal(map[string]cty.Value{
|
||||||
"computed_map": cty.MapVal(map[string]cty.Value{
|
"computed_map": cty.MapVal(map[string]cty.Value{
|
||||||
|
@ -79,13 +79,13 @@ func TestState_basic(t *testing.T) {
|
||||||
cty.ObjectVal(map[string]cty.Value{
|
cty.ObjectVal(map[string]cty.Value{
|
||||||
"backend": cty.StringVal("local"),
|
"backend": cty.StringVal("local"),
|
||||||
"config": cty.ObjectVal(map[string]cty.Value{
|
"config": cty.ObjectVal(map[string]cty.Value{
|
||||||
"path": cty.StringVal("./test-fixtures/null_outputs.tfstate"),
|
"path": cty.StringVal("./testdata/null_outputs.tfstate"),
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
cty.ObjectVal(map[string]cty.Value{
|
cty.ObjectVal(map[string]cty.Value{
|
||||||
"backend": cty.StringVal("local"),
|
"backend": cty.StringVal("local"),
|
||||||
"config": cty.ObjectVal(map[string]cty.Value{
|
"config": cty.ObjectVal(map[string]cty.Value{
|
||||||
"path": cty.StringVal("./test-fixtures/null_outputs.tfstate"),
|
"path": cty.StringVal("./testdata/null_outputs.tfstate"),
|
||||||
}),
|
}),
|
||||||
"outputs": cty.ObjectVal(map[string]cty.Value{
|
"outputs": cty.ObjectVal(map[string]cty.Value{
|
||||||
"map": cty.NullVal(cty.DynamicPseudoType),
|
"map": cty.NullVal(cty.DynamicPseudoType),
|
||||||
|
@ -100,7 +100,7 @@ func TestState_basic(t *testing.T) {
|
||||||
cty.ObjectVal(map[string]cty.Value{
|
cty.ObjectVal(map[string]cty.Value{
|
||||||
"backend": cty.StringVal("local"),
|
"backend": cty.StringVal("local"),
|
||||||
"config": cty.ObjectVal(map[string]cty.Value{
|
"config": cty.ObjectVal(map[string]cty.Value{
|
||||||
"path": cty.StringVal("./test-fixtures/empty.tfstate"),
|
"path": cty.StringVal("./testdata/empty.tfstate"),
|
||||||
}),
|
}),
|
||||||
"defaults": cty.ObjectVal(map[string]cty.Value{
|
"defaults": cty.ObjectVal(map[string]cty.Value{
|
||||||
"foo": cty.StringVal("bar"),
|
"foo": cty.StringVal("bar"),
|
||||||
|
@ -109,7 +109,7 @@ func TestState_basic(t *testing.T) {
|
||||||
cty.ObjectVal(map[string]cty.Value{
|
cty.ObjectVal(map[string]cty.Value{
|
||||||
"backend": cty.StringVal("local"),
|
"backend": cty.StringVal("local"),
|
||||||
"config": cty.ObjectVal(map[string]cty.Value{
|
"config": cty.ObjectVal(map[string]cty.Value{
|
||||||
"path": cty.StringVal("./test-fixtures/empty.tfstate"),
|
"path": cty.StringVal("./testdata/empty.tfstate"),
|
||||||
}),
|
}),
|
||||||
"defaults": cty.ObjectVal(map[string]cty.Value{
|
"defaults": cty.ObjectVal(map[string]cty.Value{
|
||||||
"foo": cty.StringVal("bar"),
|
"foo": cty.StringVal("bar"),
|
||||||
|
@ -125,13 +125,13 @@ func TestState_basic(t *testing.T) {
|
||||||
cty.ObjectVal(map[string]cty.Value{
|
cty.ObjectVal(map[string]cty.Value{
|
||||||
"backend": cty.StringVal("local"),
|
"backend": cty.StringVal("local"),
|
||||||
"config": cty.ObjectVal(map[string]cty.Value{
|
"config": cty.ObjectVal(map[string]cty.Value{
|
||||||
"path": cty.StringVal("./test-fixtures/missing.tfstate"), // intentionally not present on disk
|
"path": cty.StringVal("./testdata/missing.tfstate"), // intentionally not present on disk
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
cty.ObjectVal(map[string]cty.Value{
|
cty.ObjectVal(map[string]cty.Value{
|
||||||
"backend": cty.StringVal("local"),
|
"backend": cty.StringVal("local"),
|
||||||
"config": cty.ObjectVal(map[string]cty.Value{
|
"config": cty.ObjectVal(map[string]cty.Value{
|
||||||
"path": cty.StringVal("./test-fixtures/missing.tfstate"),
|
"path": cty.StringVal("./testdata/missing.tfstate"),
|
||||||
}),
|
}),
|
||||||
"defaults": cty.NullVal(cty.DynamicPseudoType),
|
"defaults": cty.NullVal(cty.DynamicPseudoType),
|
||||||
"outputs": cty.EmptyObjectVal,
|
"outputs": cty.EmptyObjectVal,
|
||||||
|
@ -167,7 +167,7 @@ func TestState_basic(t *testing.T) {
|
||||||
cty.ObjectVal(map[string]cty.Value{
|
cty.ObjectVal(map[string]cty.Value{
|
||||||
"backend": cty.StringVal("local"),
|
"backend": cty.StringVal("local"),
|
||||||
"config": cty.ObjectVal(map[string]cty.Value{
|
"config": cty.ObjectVal(map[string]cty.Value{
|
||||||
"path": cty.StringVal("./test-fixtures/basic.tfstate"),
|
"path": cty.StringVal("./testdata/basic.tfstate"),
|
||||||
}),
|
}),
|
||||||
"defaults": cty.StringVal("nope"),
|
"defaults": cty.StringVal("nope"),
|
||||||
}),
|
}),
|
||||||
|
@ -178,13 +178,13 @@ func TestState_basic(t *testing.T) {
|
||||||
cty.ObjectVal(map[string]cty.Value{
|
cty.ObjectVal(map[string]cty.Value{
|
||||||
"backend": cty.StringVal("local"),
|
"backend": cty.StringVal("local"),
|
||||||
"config": cty.MapVal(map[string]cty.Value{
|
"config": cty.MapVal(map[string]cty.Value{
|
||||||
"path": cty.StringVal("./test-fixtures/empty.tfstate"),
|
"path": cty.StringVal("./testdata/empty.tfstate"),
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
cty.ObjectVal(map[string]cty.Value{
|
cty.ObjectVal(map[string]cty.Value{
|
||||||
"backend": cty.StringVal("local"),
|
"backend": cty.StringVal("local"),
|
||||||
"config": cty.MapVal(map[string]cty.Value{
|
"config": cty.MapVal(map[string]cty.Value{
|
||||||
"path": cty.StringVal("./test-fixtures/empty.tfstate"),
|
"path": cty.StringVal("./testdata/empty.tfstate"),
|
||||||
}),
|
}),
|
||||||
"defaults": cty.NullVal(cty.DynamicPseudoType),
|
"defaults": cty.NullVal(cty.DynamicPseudoType),
|
||||||
"outputs": cty.EmptyObjectVal,
|
"outputs": cty.EmptyObjectVal,
|
||||||
|
@ -196,14 +196,14 @@ func TestState_basic(t *testing.T) {
|
||||||
cty.ObjectVal(map[string]cty.Value{
|
cty.ObjectVal(map[string]cty.Value{
|
||||||
"backend": cty.StringVal("local"),
|
"backend": cty.StringVal("local"),
|
||||||
"config": cty.ObjectVal(map[string]cty.Value{
|
"config": cty.ObjectVal(map[string]cty.Value{
|
||||||
"path": cty.StringVal("./test-fixtures/basic.tfstate"),
|
"path": cty.StringVal("./testdata/basic.tfstate"),
|
||||||
}),
|
}),
|
||||||
"defaults": cty.MapValEmpty(cty.String),
|
"defaults": cty.MapValEmpty(cty.String),
|
||||||
}),
|
}),
|
||||||
cty.ObjectVal(map[string]cty.Value{
|
cty.ObjectVal(map[string]cty.Value{
|
||||||
"backend": cty.StringVal("local"),
|
"backend": cty.StringVal("local"),
|
||||||
"config": cty.ObjectVal(map[string]cty.Value{
|
"config": cty.ObjectVal(map[string]cty.Value{
|
||||||
"path": cty.StringVal("./test-fixtures/basic.tfstate"),
|
"path": cty.StringVal("./testdata/basic.tfstate"),
|
||||||
}),
|
}),
|
||||||
"defaults": cty.MapValEmpty(cty.String),
|
"defaults": cty.MapValEmpty(cty.String),
|
||||||
"outputs": cty.ObjectVal(map[string]cty.Value{
|
"outputs": cty.ObjectVal(map[string]cty.Value{
|
||||||
|
|
|
@ -175,7 +175,7 @@ func TestResourceProvider_linuxCreateConfigFiles(t *testing.T) {
|
||||||
}{
|
}{
|
||||||
"Sudo": {
|
"Sudo": {
|
||||||
Config: map[string]interface{}{
|
Config: map[string]interface{}{
|
||||||
"ohai_hints": []interface{}{"test-fixtures/ohaihint.json"},
|
"ohai_hints": []interface{}{"testdata/ohaihint.json"},
|
||||||
"node_name": "nodename1",
|
"node_name": "nodename1",
|
||||||
"run_list": []interface{}{"cookbook::recipe"},
|
"run_list": []interface{}{"cookbook::recipe"},
|
||||||
"secret_key": "SECRET-KEY",
|
"secret_key": "SECRET-KEY",
|
||||||
|
|
|
@ -125,7 +125,7 @@ func TestResourceProvider_windowsCreateConfigFiles(t *testing.T) {
|
||||||
}{
|
}{
|
||||||
"Default": {
|
"Default": {
|
||||||
Config: map[string]interface{}{
|
Config: map[string]interface{}{
|
||||||
"ohai_hints": []interface{}{"test-fixtures/ohaihint.json"},
|
"ohai_hints": []interface{}{"testdata/ohaihint.json"},
|
||||||
"node_name": "nodename1",
|
"node_name": "nodename1",
|
||||||
"run_list": []interface{}{"cookbook::recipe"},
|
"run_list": []interface{}{"cookbook::recipe"},
|
||||||
"secret_key": "SECRET-KEY",
|
"secret_key": "SECRET-KEY",
|
||||||
|
|
|
@ -134,7 +134,7 @@ func TestResourceProvider_CollectScripts_inline(t *testing.T) {
|
||||||
|
|
||||||
func TestResourceProvider_CollectScripts_script(t *testing.T) {
|
func TestResourceProvider_CollectScripts_script(t *testing.T) {
|
||||||
conf := map[string]interface{}{
|
conf := map[string]interface{}{
|
||||||
"script": "test-fixtures/script1.sh",
|
"script": "testdata/script1.sh",
|
||||||
}
|
}
|
||||||
|
|
||||||
scripts, err := collectScripts(
|
scripts, err := collectScripts(
|
||||||
|
@ -162,9 +162,9 @@ func TestResourceProvider_CollectScripts_script(t *testing.T) {
|
||||||
func TestResourceProvider_CollectScripts_scripts(t *testing.T) {
|
func TestResourceProvider_CollectScripts_scripts(t *testing.T) {
|
||||||
conf := map[string]interface{}{
|
conf := map[string]interface{}{
|
||||||
"scripts": []interface{}{
|
"scripts": []interface{}{
|
||||||
"test-fixtures/script1.sh",
|
"testdata/script1.sh",
|
||||||
"test-fixtures/script1.sh",
|
"testdata/script1.sh",
|
||||||
"test-fixtures/script1.sh",
|
"testdata/script1.sh",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1588,7 +1588,7 @@ func testHttpHandlerHeader(w http.ResponseWriter, r *http.Request) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// applyFixtureSchema returns a schema suitable for processing the
|
// applyFixtureSchema returns a schema suitable for processing the
|
||||||
// configuration in test-fixtures/apply . This schema should be
|
// configuration in testdata/apply . This schema should be
|
||||||
// assigned to a mock provider named "test".
|
// assigned to a mock provider named "test".
|
||||||
func applyFixtureSchema() *terraform.ProviderSchema {
|
func applyFixtureSchema() *terraform.ProviderSchema {
|
||||||
return &terraform.ProviderSchema{
|
return &terraform.ProviderSchema{
|
||||||
|
@ -1604,7 +1604,7 @@ func applyFixtureSchema() *terraform.ProviderSchema {
|
||||||
}
|
}
|
||||||
|
|
||||||
// applyFixtureProvider returns a mock provider that is configured for basic
|
// applyFixtureProvider returns a mock provider that is configured for basic
|
||||||
// operation with the configuration in test-fixtures/apply. This mock has
|
// operation with the configuration in testdata/apply. This mock has
|
||||||
// GetSchemaReturn, PlanResourceChangeFn, and ApplyResourceChangeFn populated,
|
// GetSchemaReturn, PlanResourceChangeFn, and ApplyResourceChangeFn populated,
|
||||||
// with the plan/apply steps just passing through the data determined by
|
// with the plan/apply steps just passing through the data determined by
|
||||||
// Terraform Core.
|
// Terraform Core.
|
||||||
|
|
|
@ -43,7 +43,7 @@ import (
|
||||||
|
|
||||||
// These are the directories for our test data and fixtures.
|
// These are the directories for our test data and fixtures.
|
||||||
var (
|
var (
|
||||||
fixtureDir = "./test-fixtures"
|
fixtureDir = "./testdata"
|
||||||
testDataDir = "./testdata"
|
testDataDir = "./testdata"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ func TestPlanApplyInAutomation(t *testing.T) {
|
||||||
// allowed.
|
// allowed.
|
||||||
skipIfCannotAccessNetwork(t)
|
skipIfCannotAccessNetwork(t)
|
||||||
|
|
||||||
fixturePath := filepath.Join("test-fixtures", "full-workflow-null")
|
fixturePath := filepath.Join("testdata", "full-workflow-null")
|
||||||
tf := e2e.NewBinary(terraformBin, fixturePath)
|
tf := e2e.NewBinary(terraformBin, fixturePath)
|
||||||
defer tf.Close()
|
defer tf.Close()
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@ func TestAutoApplyInAutomation(t *testing.T) {
|
||||||
// allowed.
|
// allowed.
|
||||||
skipIfCannotAccessNetwork(t)
|
skipIfCannotAccessNetwork(t)
|
||||||
|
|
||||||
fixturePath := filepath.Join("test-fixtures", "full-workflow-null")
|
fixturePath := filepath.Join("testdata", "full-workflow-null")
|
||||||
tf := e2e.NewBinary(terraformBin, fixturePath)
|
tf := e2e.NewBinary(terraformBin, fixturePath)
|
||||||
defer tf.Close()
|
defer tf.Close()
|
||||||
|
|
||||||
|
@ -186,7 +186,7 @@ func TestPlanOnlyInAutomation(t *testing.T) {
|
||||||
// allowed.
|
// allowed.
|
||||||
skipIfCannotAccessNetwork(t)
|
skipIfCannotAccessNetwork(t)
|
||||||
|
|
||||||
fixturePath := filepath.Join("test-fixtures", "full-workflow-null")
|
fixturePath := filepath.Join("testdata", "full-workflow-null")
|
||||||
tf := e2e.NewBinary(terraformBin, fixturePath)
|
tf := e2e.NewBinary(terraformBin, fixturePath)
|
||||||
defer tf.Close()
|
defer tf.Close()
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ func TestInitProviders(t *testing.T) {
|
||||||
// is to test the interaction with the real repository.
|
// is to test the interaction with the real repository.
|
||||||
skipIfCannotAccessNetwork(t)
|
skipIfCannotAccessNetwork(t)
|
||||||
|
|
||||||
fixturePath := filepath.Join("test-fixtures", "template-provider")
|
fixturePath := filepath.Join("testdata", "template-provider")
|
||||||
tf := e2e.NewBinary(terraformBin, fixturePath)
|
tf := e2e.NewBinary(terraformBin, fixturePath)
|
||||||
defer tf.Close()
|
defer tf.Close()
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ func TestInitProvidersInternal(t *testing.T) {
|
||||||
// This test should _not_ reach out anywhere because the "terraform"
|
// This test should _not_ reach out anywhere because the "terraform"
|
||||||
// provider is internal to the core terraform binary.
|
// provider is internal to the core terraform binary.
|
||||||
|
|
||||||
fixturePath := filepath.Join("test-fixtures", "terraform-provider")
|
fixturePath := filepath.Join("testdata", "terraform-provider")
|
||||||
tf := e2e.NewBinary(terraformBin, fixturePath)
|
tf := e2e.NewBinary(terraformBin, fixturePath)
|
||||||
defer tf.Close()
|
defer tf.Close()
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ func TestInitProviders_pluginCache(t *testing.T) {
|
||||||
// should come from local cache.
|
// should come from local cache.
|
||||||
skipIfCannotAccessNetwork(t)
|
skipIfCannotAccessNetwork(t)
|
||||||
|
|
||||||
fixturePath := filepath.Join("test-fixtures", "plugin-cache")
|
fixturePath := filepath.Join("testdata", "plugin-cache")
|
||||||
tf := e2e.NewBinary(terraformBin, fixturePath)
|
tf := e2e.NewBinary(terraformBin, fixturePath)
|
||||||
defer tf.Close()
|
defer tf.Close()
|
||||||
|
|
||||||
|
@ -140,7 +140,7 @@ func TestInit_fromModule(t *testing.T) {
|
||||||
// and fetch a module.
|
// and fetch a module.
|
||||||
skipIfCannotAccessNetwork(t)
|
skipIfCannotAccessNetwork(t)
|
||||||
|
|
||||||
fixturePath := filepath.Join("test-fixtures", "empty")
|
fixturePath := filepath.Join("testdata", "empty")
|
||||||
tf := e2e.NewBinary(terraformBin, fixturePath)
|
tf := e2e.NewBinary(terraformBin, fixturePath)
|
||||||
defer tf.Close()
|
defer tf.Close()
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ OUTFILE="terraform-e2etest_${GOOS}_${GOARCH}.zip"
|
||||||
mkdir -p "$OUTDIR"
|
mkdir -p "$OUTDIR"
|
||||||
|
|
||||||
# We need the test fixtures available when we run the tests.
|
# We need the test fixtures available when we run the tests.
|
||||||
cp -r test-fixtures "$OUTDIR/test-fixtures"
|
cp -r testdata "$OUTDIR/testdata"
|
||||||
|
|
||||||
# Bundle a copy of our binary so the target system doesn't need the go
|
# Bundle a copy of our binary so the target system doesn't need the go
|
||||||
# compiler installed.
|
# compiler installed.
|
||||||
|
|
|
@ -26,7 +26,7 @@ func TestPrimarySeparatePlan(t *testing.T) {
|
||||||
// allowed.
|
// allowed.
|
||||||
skipIfCannotAccessNetwork(t)
|
skipIfCannotAccessNetwork(t)
|
||||||
|
|
||||||
fixturePath := filepath.Join("test-fixtures", "full-workflow-null")
|
fixturePath := filepath.Join("testdata", "full-workflow-null")
|
||||||
tf := e2e.NewBinary(terraformBin, fixturePath)
|
tf := e2e.NewBinary(terraformBin, fixturePath)
|
||||||
defer tf.Close()
|
defer tf.Close()
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ func TestVersion(t *testing.T) {
|
||||||
|
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
fixturePath := filepath.Join("test-fixtures", "empty")
|
fixturePath := filepath.Join("testdata", "empty")
|
||||||
tf := e2e.NewBinary(terraformBin, fixturePath)
|
tf := e2e.NewBinary(terraformBin, fixturePath)
|
||||||
defer tf.Close()
|
defer tf.Close()
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ func TestVersionWithProvider(t *testing.T) {
|
||||||
// allowed.
|
// allowed.
|
||||||
skipIfCannotAccessNetwork(t)
|
skipIfCannotAccessNetwork(t)
|
||||||
|
|
||||||
fixturePath := filepath.Join("test-fixtures", "template-provider")
|
fixturePath := filepath.Join("testdata", "template-provider")
|
||||||
tf := e2e.NewBinary(terraformBin, fixturePath)
|
tf := e2e.NewBinary(terraformBin, fixturePath)
|
||||||
defer tf.Close()
|
defer tf.Close()
|
||||||
|
|
||||||
|
|
|
@ -848,7 +848,7 @@ func TestPlan_shutdown(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// planFixtureSchema returns a schema suitable for processing the
|
// planFixtureSchema returns a schema suitable for processing the
|
||||||
// configuration in test-fixtures/plan . This schema should be
|
// configuration in testdata/plan . This schema should be
|
||||||
// assigned to a mock provider named "test".
|
// assigned to a mock provider named "test".
|
||||||
func planFixtureSchema() *terraform.ProviderSchema {
|
func planFixtureSchema() *terraform.ProviderSchema {
|
||||||
return &terraform.ProviderSchema{
|
return &terraform.ProviderSchema{
|
||||||
|
@ -875,7 +875,7 @@ func planFixtureSchema() *terraform.ProviderSchema {
|
||||||
}
|
}
|
||||||
|
|
||||||
// planFixtureProvider returns a mock provider that is configured for basic
|
// planFixtureProvider returns a mock provider that is configured for basic
|
||||||
// operation with the configuration in test-fixtures/plan. This mock has
|
// operation with the configuration in testdata/plan. This mock has
|
||||||
// GetSchemaReturn and PlanResourceChangeFn populated, with the plan
|
// GetSchemaReturn and PlanResourceChangeFn populated, with the plan
|
||||||
// step just passing through the new object proposed by Terraform Core.
|
// step just passing through the new object proposed by Terraform Core.
|
||||||
func planFixtureProvider() *terraform.MockProvider {
|
func planFixtureProvider() *terraform.MockProvider {
|
||||||
|
@ -890,7 +890,7 @@ func planFixtureProvider() *terraform.MockProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
// planVarsFixtureSchema returns a schema suitable for processing the
|
// planVarsFixtureSchema returns a schema suitable for processing the
|
||||||
// configuration in test-fixtures/plan-vars . This schema should be
|
// configuration in testdata/plan-vars . This schema should be
|
||||||
// assigned to a mock provider named "test".
|
// assigned to a mock provider named "test".
|
||||||
func planVarsFixtureSchema() *terraform.ProviderSchema {
|
func planVarsFixtureSchema() *terraform.ProviderSchema {
|
||||||
return &terraform.ProviderSchema{
|
return &terraform.ProviderSchema{
|
||||||
|
@ -906,7 +906,7 @@ func planVarsFixtureSchema() *terraform.ProviderSchema {
|
||||||
}
|
}
|
||||||
|
|
||||||
// planVarsFixtureProvider returns a mock provider that is configured for basic
|
// planVarsFixtureProvider returns a mock provider that is configured for basic
|
||||||
// operation with the configuration in test-fixtures/plan-vars. This mock has
|
// operation with the configuration in testdata/plan-vars. This mock has
|
||||||
// GetSchemaReturn and PlanResourceChangeFn populated, with the plan
|
// GetSchemaReturn and PlanResourceChangeFn populated, with the plan
|
||||||
// step just passing through the new object proposed by Terraform Core.
|
// step just passing through the new object proposed by Terraform Core.
|
||||||
func planVarsFixtureProvider() *terraform.MockProvider {
|
func planVarsFixtureProvider() *terraform.MockProvider {
|
||||||
|
|
|
@ -19,7 +19,7 @@ func TestMultiVersionProviderResolver(t *testing.T) {
|
||||||
available.Add(discovery.PluginMeta{
|
available.Add(discovery.PluginMeta{
|
||||||
Name: "plugin",
|
Name: "plugin",
|
||||||
Version: "1.0.0",
|
Version: "1.0.0",
|
||||||
Path: "test-fixtures/empty-file",
|
Path: "testdata/empty-file",
|
||||||
})
|
})
|
||||||
|
|
||||||
resolver := &multiVersionProviderResolver{
|
resolver := &multiVersionProviderResolver{
|
||||||
|
|
|
@ -32,7 +32,7 @@ func TestProvidersSchema_error(t *testing.T) {
|
||||||
func TestProvidersSchema_output(t *testing.T) {
|
func TestProvidersSchema_output(t *testing.T) {
|
||||||
// there's only one test at this time. This can be refactored to have
|
// there's only one test at this time. This can be refactored to have
|
||||||
// multiple test cases in individual directories as needed.
|
// multiple test cases in individual directories as needed.
|
||||||
fixtureDir := "test-fixtures/providers-schema"
|
fixtureDir := "testdata/providers-schema"
|
||||||
testDirs, err := ioutil.ReadDir(fixtureDir)
|
testDirs, err := ioutil.ReadDir(fixtureDir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
|
|
|
@ -707,7 +707,7 @@ func newInstanceState(id string) *states.ResourceInstanceObjectSrc {
|
||||||
}
|
}
|
||||||
|
|
||||||
// refreshFixtureSchema returns a schema suitable for processing the
|
// refreshFixtureSchema returns a schema suitable for processing the
|
||||||
// configuration in test-fixtures/refresh . This schema should be
|
// configuration in testdata/refresh . This schema should be
|
||||||
// assigned to a mock provider named "test".
|
// assigned to a mock provider named "test".
|
||||||
func refreshFixtureSchema() *terraform.ProviderSchema {
|
func refreshFixtureSchema() *terraform.ProviderSchema {
|
||||||
return &terraform.ProviderSchema{
|
return &terraform.ProviderSchema{
|
||||||
|
@ -723,7 +723,7 @@ func refreshFixtureSchema() *terraform.ProviderSchema {
|
||||||
}
|
}
|
||||||
|
|
||||||
// refreshVarFixtureSchema returns a schema suitable for processing the
|
// refreshVarFixtureSchema returns a schema suitable for processing the
|
||||||
// configuration in test-fixtures/refresh-var . This schema should be
|
// configuration in testdata/refresh-var . This schema should be
|
||||||
// assigned to a mock provider named "test".
|
// assigned to a mock provider named "test".
|
||||||
func refreshVarFixtureSchema() *terraform.ProviderSchema {
|
func refreshVarFixtureSchema() *terraform.ProviderSchema {
|
||||||
return &terraform.ProviderSchema{
|
return &terraform.ProviderSchema{
|
||||||
|
|
|
@ -135,7 +135,7 @@ func TestShow_state(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestShow_json_output(t *testing.T) {
|
func TestShow_json_output(t *testing.T) {
|
||||||
fixtureDir := "test-fixtures/show-json"
|
fixtureDir := "testdata/show-json"
|
||||||
testDirs, err := ioutil.ReadDir(fixtureDir)
|
testDirs, err := ioutil.ReadDir(fixtureDir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
|
@ -230,7 +230,7 @@ func TestShow_json_output(t *testing.T) {
|
||||||
|
|
||||||
// similar test as above, without the plan
|
// similar test as above, without the plan
|
||||||
func TestShow_json_output_state(t *testing.T) {
|
func TestShow_json_output_state(t *testing.T) {
|
||||||
fixtureDir := "test-fixtures/show-json-state"
|
fixtureDir := "testdata/show-json-state"
|
||||||
testDirs, err := ioutil.ReadDir(fixtureDir)
|
testDirs, err := ioutil.ReadDir(fixtureDir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
|
@ -311,7 +311,7 @@ func TestShow_json_output_state(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// showFixtureSchema returns a schema suitable for processing the configuration
|
// showFixtureSchema returns a schema suitable for processing the configuration
|
||||||
// in test-fixtures/show. This schema should be assigned to a mock provider
|
// in testdata/show. This schema should be assigned to a mock provider
|
||||||
// named "test".
|
// named "test".
|
||||||
func showFixtureSchema() *terraform.ProviderSchema {
|
func showFixtureSchema() *terraform.ProviderSchema {
|
||||||
return &terraform.ProviderSchema{
|
return &terraform.ProviderSchema{
|
||||||
|
@ -327,7 +327,7 @@ func showFixtureSchema() *terraform.ProviderSchema {
|
||||||
}
|
}
|
||||||
|
|
||||||
// showFixtureProvider returns a mock provider that is configured for basic
|
// showFixtureProvider returns a mock provider that is configured for basic
|
||||||
// operation with the configuration in test-fixtures/show. This mock has
|
// operation with the configuration in testdata/show. This mock has
|
||||||
// GetSchemaReturn, PlanResourceChangeFn, and ApplyResourceChangeFn populated,
|
// GetSchemaReturn, PlanResourceChangeFn, and ApplyResourceChangeFn populated,
|
||||||
// with the plan/apply steps just passing through the data determined by
|
// with the plan/apply steps just passing through the data determined by
|
||||||
// Terraform Core.
|
// Terraform Core.
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
*.tfstate
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue