From 0ac663bb2bb5389ffac6982d8dda6994a3a5fe2d Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Wed, 23 May 2018 14:18:43 -0700 Subject: [PATCH] core: context plan tests update wanted output for new behavior Previously Terraform Core was unaware of the structure of a resource type schema and so the strange behavior of our testDiffFn caused some attributes to not appear at all in the result. With core now more aware, it "fills in" these missing items before calling, and as a result they now appear in the diff even with the testDiffFn. In real code, where helper/schema is constructing diffs, this situation doesn't arise because the framework always produces schema-compatible diffs. --- terraform/terraform_test.go | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/terraform/terraform_test.go b/terraform/terraform_test.go index 6e9ce637a..df1bc4749 100644 --- a/terraform/terraform_test.go +++ b/terraform/terraform_test.go @@ -1021,9 +1021,11 @@ CREATE: aws_instance.bar foo: "" => "" type: "" => "aws_instance" CREATE: aws_instance.foo - foo: "" => "" - num: "" => "2" - type: "" => "aws_instance" + compute: "" => "foo" + compute_value: "" => "" + foo: "" => "" + num: "" => "2" + type: "" => "aws_instance" STATE: @@ -1069,11 +1071,15 @@ CREATE: aws_instance.bar foo: "" => "" type: "" => "aws_instance" CREATE: aws_instance.foo.0 - ip.#: "" => "" - type: "" => "aws_instance" + compute: "" => "ip.#" + compute_value: "" => "" + ip.#: "" => "" + type: "" => "aws_instance" CREATE: aws_instance.foo.1 - ip.#: "" => "" - type: "" => "aws_instance" + compute: "" => "ip.#" + compute_value: "" => "" + ip.#: "" => "" + type: "" => "aws_instance" STATE: @@ -1431,8 +1437,10 @@ const testTerraformPlanModuleInputComputedStr = ` DIFF: CREATE: aws_instance.bar - foo: "" => "" - type: "" => "aws_instance" + compute: "" => "foo" + compute_value: "" => "" + foo: "" => "" + type: "" => "aws_instance" module.child: CREATE: aws_instance.foo @@ -1539,8 +1547,10 @@ CREATE: aws_instance.bar module.child: CREATE: aws_instance.foo - foo: "" => "" - type: "" => "aws_instance" + compute: "" => "foo" + compute_value: "" => "" + foo: "" => "" + type: "" => "aws_instance" STATE: