Commit f7264a24 authored by Martin Atkins's avatar Martin Atkins
Browse files

core: Don't panic in TestContext2Apply_dataDependsOn if data source fails

No related merge requests found
Showing with 9 additions and 1 deletion
+9 -1
......@@ -9276,8 +9276,16 @@ func TestContext2Apply_dataDependsOn(t *testing.T) {
assertNoErrors(t, diags)
root := state.Module(addrs.RootModuleInstance)
is := root.ResourceInstance(addrs.Resource{
Mode: addrs.DataResourceMode,
Type: "null_data_source",
Name: "read",
}.Instance(addrs.NoKey))
if is == nil {
t.Fatal("data resource instance is not present in state; should be")
}
var attrs map[string]interface{}
err := json.Unmarshal(root.Resources["data.null_data_source.read"].Instances[addrs.NoKey].Current.AttrsJSON, &attrs)
err := json.Unmarshal(is.Current.AttrsJSON, &attrs)
if err != nil {
t.Fatal(err)
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment