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.
This commit is contained in:
Martin Atkins 2018-09-12 12:00:50 -07:00
parent e3f2c2c03f
commit d104e450d8
2 changed files with 7 additions and 1 deletions

View File

@ -8281,7 +8281,7 @@ func TestContext2Apply_unknownAttribute(t *testing.T) {
state, diags := ctx.Apply() state, diags := ctx.Apply()
if !diags.HasErrors() { 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()) actual := strings.TrimSpace(state.String())

View File

@ -531,6 +531,12 @@ func testProviderSchema(name string) *ProviderSchema {
Type: cty.String, Type: cty.String,
Computed: true, Computed: true,
}, },
// Generated by testDiffFn if compute = "unknown" is set in the test config
"unknown": {
Type: cty.String,
Computed: true,
},
}, },
}, },
name + "_eip": { name + "_eip": {