mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-07 22:53:08 -06:00
core: Fix TestContext2Plan_dataResourceBecomesComputed
Data resources get processed during refresh, so it doesn't make sense to have a data resource test that doesn't run the refresh walk.
This commit is contained in:
parent
f51d8a0a9f
commit
206a4b5de9
@ -2095,9 +2095,14 @@ func TestContext2Plan_dataResourceBecomesComputed(t *testing.T) {
|
||||
}),
|
||||
})
|
||||
|
||||
_, diags := ctx.Refresh()
|
||||
if diags.HasErrors() {
|
||||
t.Fatalf("unexpected errors during refresh: %s", diags.Err())
|
||||
}
|
||||
|
||||
plan, diags := ctx.Plan()
|
||||
if diags.HasErrors() {
|
||||
t.Fatalf("unexpected errors: %s", diags.Err())
|
||||
t.Fatalf("unexpected errors during plan: %s", diags.Err())
|
||||
}
|
||||
|
||||
rcs := plan.Changes.ResourceInstance(addrs.Resource{
|
||||
@ -2106,6 +2111,7 @@ func TestContext2Plan_dataResourceBecomesComputed(t *testing.T) {
|
||||
Name: "foo",
|
||||
}.Instance(addrs.NoKey).Absolute(addrs.RootModuleInstance))
|
||||
if rcs == nil {
|
||||
t.Logf("full changeset: %s", spew.Sdump(plan.Changes))
|
||||
t.Fatalf("missing diff for data.aws_data_resource.foo")
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user