refresh is expected for destroy
These tests were not previously running a refresh, and hence did not expect the resources to be read.
This commit is contained in:
parent
0b3b84acc1
commit
e614fb9aed
|
@ -559,7 +559,7 @@ func TestLocal_planDestroy(t *testing.T) {
|
||||||
b, cleanup := TestLocal(t)
|
b, cleanup := TestLocal(t)
|
||||||
defer cleanup()
|
defer cleanup()
|
||||||
|
|
||||||
p := TestLocalProvider(t, b, "test", planFixtureSchema())
|
TestLocalProvider(t, b, "test", planFixtureSchema())
|
||||||
testStateFile(t, b.StatePath, testPlanState())
|
testStateFile(t, b.StatePath, testPlanState())
|
||||||
|
|
||||||
outDir := testTempDir(t)
|
outDir := testTempDir(t)
|
||||||
|
@ -593,10 +593,6 @@ func TestLocal_planDestroy(t *testing.T) {
|
||||||
t.Fatalf("plan operation failed")
|
t.Fatalf("plan operation failed")
|
||||||
}
|
}
|
||||||
|
|
||||||
if p.ReadResourceCalled {
|
|
||||||
t.Fatal("ReadResource should not be called")
|
|
||||||
}
|
|
||||||
|
|
||||||
if run.PlanEmpty {
|
if run.PlanEmpty {
|
||||||
t.Fatal("plan should not be empty")
|
t.Fatal("plan should not be empty")
|
||||||
}
|
}
|
||||||
|
@ -613,7 +609,7 @@ func TestLocal_planDestroy_withDataSources(t *testing.T) {
|
||||||
b, cleanup := TestLocal(t)
|
b, cleanup := TestLocal(t)
|
||||||
defer cleanup()
|
defer cleanup()
|
||||||
|
|
||||||
p := TestLocalProvider(t, b, "test", planFixtureSchema())
|
TestLocalProvider(t, b, "test", planFixtureSchema())
|
||||||
testStateFile(t, b.StatePath, testPlanState_withDataSource())
|
testStateFile(t, b.StatePath, testPlanState_withDataSource())
|
||||||
|
|
||||||
b.CLI = cli.NewMockUi()
|
b.CLI = cli.NewMockUi()
|
||||||
|
@ -649,14 +645,6 @@ func TestLocal_planDestroy_withDataSources(t *testing.T) {
|
||||||
t.Fatalf("plan operation failed")
|
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 {
|
if run.PlanEmpty {
|
||||||
t.Fatal("plan should not be empty")
|
t.Fatal("plan should not be empty")
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
resource "test_instance" "foo" {
|
resource "test_instance" "foo" {
|
||||||
|
count = 1
|
||||||
ami = "bar"
|
ami = "bar"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue