From e614fb9aed597252e6ca18244ca779e0d61d3683 Mon Sep 17 00:00:00 2001 From: James Bardin Date: Mon, 4 Jan 2021 18:27:08 -0500 Subject: [PATCH] refresh is expected for destroy These tests were not previously running a refresh, and hence did not expect the resources to be read. --- backend/local/backend_plan_test.go | 16 ++-------------- backend/local/testdata/destroy-with-ds/main.tf | 1 + 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/backend/local/backend_plan_test.go b/backend/local/backend_plan_test.go index 5c0545380..3f72168f1 100644 --- a/backend/local/backend_plan_test.go +++ b/backend/local/backend_plan_test.go @@ -559,7 +559,7 @@ func TestLocal_planDestroy(t *testing.T) { b, cleanup := TestLocal(t) defer cleanup() - p := TestLocalProvider(t, b, "test", planFixtureSchema()) + TestLocalProvider(t, b, "test", planFixtureSchema()) testStateFile(t, b.StatePath, testPlanState()) outDir := testTempDir(t) @@ -593,10 +593,6 @@ func TestLocal_planDestroy(t *testing.T) { t.Fatalf("plan operation failed") } - if p.ReadResourceCalled { - t.Fatal("ReadResource should not be called") - } - if run.PlanEmpty { t.Fatal("plan should not be empty") } @@ -613,7 +609,7 @@ func TestLocal_planDestroy_withDataSources(t *testing.T) { b, cleanup := TestLocal(t) defer cleanup() - p := TestLocalProvider(t, b, "test", planFixtureSchema()) + TestLocalProvider(t, b, "test", planFixtureSchema()) testStateFile(t, b.StatePath, testPlanState_withDataSource()) b.CLI = cli.NewMockUi() @@ -649,14 +645,6 @@ func TestLocal_planDestroy_withDataSources(t *testing.T) { t.Fatalf("plan operation failed") } - if p.ReadResourceCalled { - t.Fatal("ReadResource should not be called") - } - - if p.ReadDataSourceCalled { - t.Fatal("ReadDataSourceCalled should not be called") - } - if run.PlanEmpty { t.Fatal("plan should not be empty") } diff --git a/backend/local/testdata/destroy-with-ds/main.tf b/backend/local/testdata/destroy-with-ds/main.tf index 4ee80ea3d..7062d896b 100644 --- a/backend/local/testdata/destroy-with-ds/main.tf +++ b/backend/local/testdata/destroy-with-ds/main.tf @@ -1,4 +1,5 @@ resource "test_instance" "foo" { + count = 1 ami = "bar" }