Merge pull request #1443 from hashicorp/f-acc-tests-check-empty-plan
providers: check for empty plan after each test step
This commit is contained in:
commit
968a152df4
|
@ -230,6 +230,16 @@ func testStep(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Verify that Plan is now empty and we don't have a perpetual diff issue
|
||||||
|
if p, err := ctx.Plan(); err != nil {
|
||||||
|
return state, fmt.Errorf("Error on follow-up plan: %s", err)
|
||||||
|
} else {
|
||||||
|
if p.Diff != nil && !p.Diff.Empty() {
|
||||||
|
return state, fmt.Errorf(
|
||||||
|
"After applying this step, the plan was not empty:\n\n%s", p)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return state, err
|
return state, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,8 @@ func init() {
|
||||||
|
|
||||||
func TestTest(t *testing.T) {
|
func TestTest(t *testing.T) {
|
||||||
mp := testProvider()
|
mp := testProvider()
|
||||||
|
mp.DiffReturn = nil
|
||||||
|
|
||||||
mp.ApplyReturn = &terraform.InstanceState{
|
mp.ApplyReturn = &terraform.InstanceState{
|
||||||
ID: "foo",
|
ID: "foo",
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue