core: Mock schema for TestContext2Apply_multiProviderDestroy

This test seems to have been buggy before our current work, with the test
fixture containing a reference to a resource that doesn't exist.

This both fixes the fixture and adds a mock schema for it, though this
just revealed another error which isn't fixed here, where the a_ids value
seems to come through as unknown after apply. That will be fixed in a
subsequent commit.
This commit is contained in:
Martin Atkins 2018-05-25 15:42:33 -07:00
parent cdb32390b9
commit 687830a5d5
2 changed files with 12 additions and 2 deletions

View File

@ -3900,6 +3900,16 @@ func TestContext2Apply_multiVarMissingState(t *testing.T) {
p := testProvider("test")
p.ApplyFn = testApplyFn
p.DiffFn = testDiffFn
p.GetSchemaReturn = &ProviderSchema{
ResourceTypes: map[string]*configschema.Block{
"test_thing": {
Attributes: map[string]*configschema.Attribute{
"a_ids": {Type: cty.String, Optional: true},
"id": {Type: cty.String, Computed: true},
},
},
},
}
// First, apply with a count of 3
ctx := testContext2(t, &ContextOpts{

View File

@ -11,5 +11,5 @@ resource "test_thing" "a" {
# over all of the resource in the state. This should succeed even though the
# module state will be nil when evaluating the variable.
resource "test_thing" "b" {
a_ids = "${join(" ", null_resource.a.*.id)}"
a_ids = "${join(" ", test_thing.a.*.id)}"
}