From ab1dc08e5cee3d3e5cde629315f4bddce894086f Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Wed, 26 Sep 2018 13:27:56 -0700 Subject: [PATCH] core: Fix TestContext2Apply_dataDependsOn The value returned from ReadDataSourceFn must conform to the schema for the data source. --- terraform/context_apply_test.go | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/terraform/context_apply_test.go b/terraform/context_apply_test.go index 4f22026e2..95b5b504f 100644 --- a/terraform/context_apply_test.go +++ b/terraform/context_apply_test.go @@ -9181,24 +9181,20 @@ func TestContext2Apply_dataDependsOn(t *testing.T) { p.ReadDataSourceFn = func(req providers.ReadDataSourceRequest) providers.ReadDataSourceResponse { return providers.ReadDataSourceResponse{ State: cty.ObjectVal(map[string]cty.Value{ + "id": cty.StringVal("boop"), "foo": cty.StringVal(provisionerOutput), }), } } _, diags := ctx.Refresh() - if diags.HasErrors() { - t.Fatalf("diags: %s", diags.Err()) - } + assertNoErrors(t, diags) - if _, diags := ctx.Plan(); diags.HasErrors() { - t.Fatalf("plan errors: %s", diags.Err()) - } + _, diags = ctx.Plan() + assertNoErrors(t, diags) state, diags := ctx.Apply() - if diags.HasErrors() { - t.Fatalf("diags: %s", diags.Err()) - } + assertNoErrors(t, diags) root := state.Module(addrs.RootModuleInstance) var attrs map[string]interface{}