From 6491c6d99703ee2b1f79ed2c2d9ed49ad0149ffb Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Mon, 24 Sep 2018 14:14:45 -0700 Subject: [PATCH] core: Fix TestContext2Apply_dataBasic The mock provider must be configured to return an object of a type that conforms to the schema for the test_data_source resource type. --- terraform/context_apply_test.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/terraform/context_apply_test.go b/terraform/context_apply_test.go index c9bd669e9..d76790b11 100644 --- a/terraform/context_apply_test.go +++ b/terraform/context_apply_test.go @@ -1493,6 +1493,7 @@ func TestContext2Apply_dataBasic(t *testing.T) { p.ReadDataSourceResponse = providers.ReadDataSourceResponse{ State: cty.ObjectVal(map[string]cty.Value{ "id": cty.StringVal("yo"), + "foo": cty.NullVal(cty.String), }), } @@ -1512,9 +1513,7 @@ func TestContext2Apply_dataBasic(t *testing.T) { } state, diags := ctx.Apply() - if diags.HasErrors() { - t.Fatalf("diags: %s", diags.Err()) - } + assertNoErrors(t, diags) actual := strings.TrimSpace(state.String()) expected := strings.TrimSpace(testTerraformApplyDataBasicStr)