From b99b31ebea866c2717abe4b7e0420cf0e47061aa Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Fri, 1 Jun 2018 15:02:26 -0700 Subject: [PATCH] core: Correct schema for TestContext2Apply_issue5254 This test is now failing due to the fact that WritePlan is currently disabled pending a rewrite. This will be addressed in a subsequent commit. --- terraform/context_apply_test.go | 11 ++++++++++- terraform/test-fixtures/issue-5254/step-0/main.tf | 2 +- terraform/test-fixtures/issue-5254/step-1/main.tf | 6 +++--- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/terraform/context_apply_test.go b/terraform/context_apply_test.go index d32c650ca..f1d527fdc 100644 --- a/terraform/context_apply_test.go +++ b/terraform/context_apply_test.go @@ -8615,9 +8615,18 @@ func TestContext2Apply_issue7824(t *testing.T) { p.ResourcesReturn = append(p.ResourcesReturn, ResourceType{ Name: "template_file", }) - p.ApplyFn = testApplyFn p.DiffFn = testDiffFn + p.GetSchemaReturn = &ProviderSchema{ + ResourceTypes: map[string]*configschema.Block{ + "template_file": { + Attributes: map[string]*configschema.Attribute{ + "template": {Type: cty.String, Optional: true}, + "__template_requires_new": {Type: cty.Bool, Optional: true}, + }, + }, + }, + } // Apply cleanly step 0 ctx := testContext2(t, &ContextOpts{ diff --git a/terraform/test-fixtures/issue-5254/step-0/main.tf b/terraform/test-fixtures/issue-5254/step-0/main.tf index 717d241a9..dd666eba1 100644 --- a/terraform/test-fixtures/issue-5254/step-0/main.tf +++ b/terraform/test-fixtures/issue-5254/step-0/main.tf @@ -3,7 +3,7 @@ variable "c" { } resource "template_file" "parent" { - count = "${var.c}" + count = var.c template = "Hi" } diff --git a/terraform/test-fixtures/issue-5254/step-1/main.tf b/terraform/test-fixtures/issue-5254/step-1/main.tf index c30446c5a..3510fe1c4 100644 --- a/terraform/test-fixtures/issue-5254/step-1/main.tf +++ b/terraform/test-fixtures/issue-5254/step-1/main.tf @@ -3,11 +3,11 @@ variable "c" { } resource "template_file" "parent" { - count = "${var.c}" + count = var.c template = "Hi" } resource "template_file" "child" { - template = "${join(",", template_file.parent.*.template)}" - __template_requires_new = 1 + template = join(",", template_file.parent.*.template) + __template_requires_new = true }