From 09180a10ff8fc7df10bd351f5f4edc0ebcd0a9a9 Mon Sep 17 00:00:00 2001 From: James Bardin Date: Tue, 7 Nov 2017 21:23:37 -0500 Subject: [PATCH] cannot destroy without a config --- backend/local/backend_plan_test.go | 42 ------------------------------ 1 file changed, 42 deletions(-) diff --git a/backend/local/backend_plan_test.go b/backend/local/backend_plan_test.go index 244bdc1305..de71555a79 100644 --- a/backend/local/backend_plan_test.go +++ b/backend/local/backend_plan_test.go @@ -199,48 +199,6 @@ func TestLocal_planDestroy(t *testing.T) { } } -func TestLocal_planDestroyNoConfig(t *testing.T) { - b := TestLocal(t) - p := TestLocalProvider(t, b, "test") - terraform.TestStateFile(t, b.StatePath, testPlanState()) - - outDir := testTempDir(t) - defer os.RemoveAll(outDir) - planPath := filepath.Join(outDir, "plan.tfplan") - - op := testOperationPlan() - op.Destroy = true - op.PlanRefresh = true - op.Module = nil - op.PlanOutPath = planPath - - run, err := b.Operation(context.Background(), op) - if err != nil { - t.Fatalf("bad: %s", err) - } - <-run.Done() - if run.Err != nil { - t.Fatalf("err: %s", run.Err) - } - - if !p.RefreshCalled { - t.Fatal("refresh should be called") - } - - if run.PlanEmpty { - t.Fatal("plan should not be empty") - } - - plan := testReadPlan(t, planPath) - for _, m := range plan.Diff.Modules { - for _, r := range m.Resources { - if !r.Destroy { - t.Fatalf("bad: %#v", r) - } - } - } -} - func TestLocal_planOutPathNoChange(t *testing.T) { b := TestLocal(t) TestLocalProvider(t, b, "test")