From d104e450d87cf3481e3d70404e678bdfbf877151 Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Wed, 12 Sep 2018 12:00:50 -0700 Subject: [PATCH] core: testProviderSchema aws_instance must include "unknown" attribute This is computed in the special case where compute = "unknown" in order to force inclusion of an unknown value into the ultimate result, which is invalid. This fixes TestContext2Apply_unknownAttribute, which is intending to test this error handling behavior. --- terraform/context_apply_test.go | 2 +- terraform/context_test.go | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/terraform/context_apply_test.go b/terraform/context_apply_test.go index ba0e98694..b1b70283c 100644 --- a/terraform/context_apply_test.go +++ b/terraform/context_apply_test.go @@ -8281,7 +8281,7 @@ func TestContext2Apply_unknownAttribute(t *testing.T) { state, diags := ctx.Apply() if !diags.HasErrors() { - t.Fatal("should error with UnknownVariableValue") + t.Error("should error, because attribute 'unknown' is still unknown after apply") } actual := strings.TrimSpace(state.String()) diff --git a/terraform/context_test.go b/terraform/context_test.go index 78a724915..4b4c28091 100644 --- a/terraform/context_test.go +++ b/terraform/context_test.go @@ -531,6 +531,12 @@ func testProviderSchema(name string) *ProviderSchema { Type: cty.String, Computed: true, }, + + // Generated by testDiffFn if compute = "unknown" is set in the test config + "unknown": { + Type: cty.String, + Computed: true, + }, }, }, name + "_eip": {