From bca1c958226d02df427d7b4eeff1c30e050a638c Mon Sep 17 00:00:00 2001 From: Venelin Date: Thu, 12 Dec 2024 11:58:08 +0000 Subject: [PATCH 1/3] Add SDKv2 Detailed Diff tests for list replacements --- pkg/tests/detailed_diff_list_test.go | 108 ++++++++++++++++++ .../added_empty.golden | 15 +++ .../added_non-empty.golden | 37 ++++++ .../list_attribute_force_new/changed.golden | 38 ++++++ .../list_element_added_back.golden | 45 ++++++++ .../list_element_added_front.golden | 51 +++++++++ .../list_element_added_middle.golden | 49 ++++++++ .../list_element_removed_end.golden | 52 +++++++++ .../list_element_removed_front.golden | 50 ++++++++ .../list_element_removed_middle.golden | 52 +++++++++ .../removed_empty.golden | 15 +++ .../removed_non-empty.golden | 37 ++++++ .../unchanged_empty.golden | 11 ++ .../unchanged_non-empty.golden | 18 +++ .../list_block_force_new/added_empty.golden | 15 +++ .../added_non-empty.golden | 40 +++++++ .../list_block_force_new/changed.golden | 41 +++++++ .../list_element_added_back.golden | 48 ++++++++ .../list_element_added_front.golden | 62 ++++++++++ .../list_element_added_middle.golden | 57 +++++++++ .../list_element_removed_end.golden | 62 ++++++++++ .../list_element_removed_front.golden | 57 +++++++++ .../list_element_removed_middle.golden | 62 ++++++++++ .../list_block_force_new/removed_empty.golden | 15 +++ .../removed_non-empty.golden | 40 +++++++ .../unchanged_empty.golden | 11 ++ .../unchanged_non-empty.golden | 18 +++ .../added_empty.golden | 15 +++ .../added_non-empty.golden | 35 ++++++ .../changed.golden | 36 ++++++ .../removed_empty.golden | 15 +++ .../removed_non-empty.golden | 35 ++++++ .../unchanged_empty.golden | 11 ++ .../unchanged_non-empty.golden | 18 +++ 34 files changed, 1271 insertions(+) create mode 100644 pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/added_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/added_non-empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/changed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/list_element_added_back.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/list_element_added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/list_element_added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/list_element_removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/list_element_removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/list_element_removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/removed_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/removed_non-empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/unchanged_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/unchanged_non-empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/added_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/added_non-empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/changed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/list_element_added_back.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/list_element_added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/list_element_added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/list_element_removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/list_element_removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/list_element_removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/removed_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/removed_non-empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/unchanged_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/unchanged_non-empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffList/max_items_one_attribute_force_new/added_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffList/max_items_one_attribute_force_new/added_non-empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffList/max_items_one_attribute_force_new/changed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffList/max_items_one_attribute_force_new/removed_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffList/max_items_one_attribute_force_new/removed_non-empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffList/max_items_one_attribute_force_new/unchanged_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffList/max_items_one_attribute_force_new/unchanged_non-empty.golden diff --git a/pkg/tests/detailed_diff_list_test.go b/pkg/tests/detailed_diff_list_test.go index 493cc6258..166a9ad70 100644 --- a/pkg/tests/detailed_diff_list_test.go +++ b/pkg/tests/detailed_diff_list_test.go @@ -23,6 +23,17 @@ func TestDetailedDiffList(t *testing.T) { }, } + listAttrSchemaForceNew := schema.Resource{ + Schema: map[string]*schema.Schema{ + "list_attr": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + ForceNew: true, + }, + }, + } + maxItemsOneAttrSchema := schema.Resource{ Schema: map[string]*schema.Schema{ "list_attr": { @@ -34,6 +45,18 @@ func TestDetailedDiffList(t *testing.T) { }, } + maxItemsOneAttrSchemaForceNew := schema.Resource{ + Schema: map[string]*schema.Schema{ + "list_attr": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Schema{Type: schema.TypeString}, + ForceNew: true, + }, + }, + } + listBlockSchema := schema.Resource{ Schema: map[string]*schema.Schema{ "list_block": { @@ -51,6 +74,43 @@ func TestDetailedDiffList(t *testing.T) { }, } + listBlockSchemaForceNew := schema.Resource{ + Schema: map[string]*schema.Schema{ + "list_block": { + Type: schema.TypeList, + Optional: true, + ForceNew: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "prop": { + Type: schema.TypeString, + Optional: true, + }, + }, + }, + }, + }, + } + + listBlockSchemaNestedForceNew := schema.Resource{ + Schema: map[string]*schema.Schema{ + "list_block": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "nested_prop": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, + }, + }, + }, + }, + } + _ = listBlockSchemaNestedForceNew + maxItemsOneBlockSchema := schema.Resource{ Schema: map[string]*schema.Schema{ "list_block": { @@ -69,6 +129,46 @@ func TestDetailedDiffList(t *testing.T) { }, } + maxItemsOneBlockSchemaForceNew := schema.Resource{ + Schema: map[string]*schema.Schema{ + "list_block": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + ForceNew: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "nested_prop": { + Type: schema.TypeString, + Optional: true, + }, + }, + }, + }, + }, + } + _ = maxItemsOneBlockSchemaForceNew + + maxItemsOneBlockSchemaNestedForceNew := schema.Resource{ + Schema: map[string]*schema.Schema{ + "list_block": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "nested_prop": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, + }, + }, + }, + }, + } + _ = maxItemsOneBlockSchemaNestedForceNew + attrList := func(arr *[]string) map[string]cty.Value { if arr == nil { return map[string]cty.Value{} @@ -135,7 +235,11 @@ func TestDetailedDiffList(t *testing.T) { valueMaker func(*[]string) map[string]cty.Value }{ {"list attribute", listAttrSchema, attrList}, + {"list attribute force new", listAttrSchemaForceNew, attrList}, {"list block", listBlockSchema, blockList}, + {"list block force new", listBlockSchemaForceNew, blockList}, + // TODO[pulumi/pulumi-terraform-bridge#2726]: These tests fail to produce the correct replacement plan + // {"list block nested force new", listBlockSchemaNestedForceNew, blockList}, } maxItemsOnePairs := []struct { @@ -144,7 +248,11 @@ func TestDetailedDiffList(t *testing.T) { valueMaker func(*[]string) map[string]cty.Value }{ {"max items one attribute", maxItemsOneAttrSchema, attrList}, + {"max items one attribute force new", maxItemsOneAttrSchemaForceNew, attrList}, {"max items one block", maxItemsOneBlockSchema, nestedBlockList}, + // TODO[pulumi/pulumi-terraform-bridge#2726]: These tests fail to produce the correct replacement plan + // {"max items one block force new", maxItemsOneBlockSchemaForceNew, nestedBlockList}, + // {"max items one block nested force new", maxItemsOneBlockSchemaNestedForceNew, nestedBlockList}, } oneElementScenarios := []struct { diff --git a/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/added_empty.golden b/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/added_empty.golden new file mode 100644 index 000000000..9589fbdf0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/added_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/added_non-empty.golden b/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/added_non-empty.golden new file mode 100644 index 000000000..cd609ef34 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/added_non-empty.golden @@ -0,0 +1,37 @@ +tests.testOutput{ + changeValue: &[]string{ + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "newid" -> (known after apply) + + list_attr = [ # forces replacement + + "val1", + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + listAttrs: [ + + [0]: "val1" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"listAttrs": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/changed.golden b/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/changed.golden new file mode 100644 index 000000000..48e3d2338 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/changed.golden @@ -0,0 +1,38 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + }, + changeValue: &[]string{"val2"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "newid" -> (known after apply) + ~ list_attr = [ # forces replacement + ~ "val1" -> "val2", + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ listAttrs: [ + ~ [0]: "val1" => "val2" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"listAttrs[0]": map[string]interface{}{"kind": "UPDATE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/list_element_added_back.golden b/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/list_element_added_back.golden new file mode 100644 index 000000000..5d48729c4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/list_element_added_back.golden @@ -0,0 +1,45 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "newid" -> (known after apply) + ~ list_attr = [ # forces replacement + # (1 unchanged element hidden) + "val2", + + "val3", + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ listAttrs: [ + + [2]: "val3" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"listAttrs[2]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/list_element_added_front.golden b/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/list_element_added_front.golden new file mode 100644 index 000000000..27cc4f86f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/list_element_added_front.golden @@ -0,0 +1,51 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "newid" -> (known after apply) + ~ list_attr = [ # forces replacement + + "val1", + "val2", + # (1 unchanged element hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ listAttrs: [ + ~ [0]: "val2" => "val1" + ~ [1]: "val3" => "val2" + + [2]: "val3" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "listAttrs[0]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "listAttrs[1]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "listAttrs[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/list_element_added_middle.golden b/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/list_element_added_middle.golden new file mode 100644 index 000000000..7d7ef68aa --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/list_element_added_middle.golden @@ -0,0 +1,49 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "newid" -> (known after apply) + ~ list_attr = [ # forces replacement + "val1", + + "val2", + "val3", + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ listAttrs: [ + ~ [1]: "val3" => "val2" + + [2]: "val3" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "listAttrs[1]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "listAttrs[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/list_element_removed_end.golden b/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/list_element_removed_end.golden new file mode 100644 index 000000000..8edd22139 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/list_element_removed_end.golden @@ -0,0 +1,52 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "newid" -> (known after apply) + ~ list_attr = [ # forces replacement + - "val1", + "val2", + - "val3", + + "val1", + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ listAttrs: [ + ~ [0]: "val1" => "val2" + ~ [1]: "val2" => "val1" + - [2]: "val3" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "listAttrs[0]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "listAttrs[1]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "listAttrs[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/list_element_removed_front.golden b/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/list_element_removed_front.golden new file mode 100644 index 000000000..e171ece6c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/list_element_removed_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "newid" -> (known after apply) + ~ list_attr = [ # forces replacement + - "val1", + - "val2", + "val3", + + "val2", + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ listAttrs: [ + ~ [0]: "val1" => "val3" + - [2]: "val3" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "listAttrs[0]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "listAttrs[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/list_element_removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/list_element_removed_middle.golden new file mode 100644 index 000000000..134bbf98e --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/list_element_removed_middle.golden @@ -0,0 +1,52 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "newid" -> (known after apply) + ~ list_attr = [ # forces replacement + - "val1", + - "val2", + "val3", + + "val1", + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ listAttrs: [ + ~ [0]: "val1" => "val3" + ~ [1]: "val2" => "val1" + - [2]: "val3" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "listAttrs[0]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "listAttrs[1]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "listAttrs[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/removed_empty.golden b/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/removed_empty.golden new file mode 100644 index 000000000..7bae19762 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/removed_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/removed_non-empty.golden b/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/removed_non-empty.golden new file mode 100644 index 000000000..68a7430f8 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/removed_non-empty.golden @@ -0,0 +1,37 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "newid" -> (known after apply) + - list_attr = [ # forces replacement + - "val1", + ] -> null + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - listAttrs: [ + - [0]: "val1" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"listAttrs": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/unchanged_empty.golden b/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/unchanged_empty.golden new file mode 100644 index 000000000..a53fac34d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/unchanged_empty.golden @@ -0,0 +1,11 @@ +tests.testOutput{tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`} diff --git a/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/unchanged_non-empty.golden b/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/unchanged_non-empty.golden new file mode 100644 index 000000000..e250a9f9c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/unchanged_non-empty.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + }, + changeValue: &[]string{"val1"}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/added_empty.golden b/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/added_empty.golden new file mode 100644 index 000000000..9589fbdf0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/added_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/added_non-empty.golden b/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/added_non-empty.golden new file mode 100644 index 000000000..83661c298 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/added_non-empty.golden @@ -0,0 +1,40 @@ +tests.testOutput{ + changeValue: &[]string{ + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "newid" -> (known after apply) + + + list_block { # forces replacement + + prop = "val1" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + listBlocks: [ + + [0]: { + + prop : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"listBlocks": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/changed.golden b/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/changed.golden new file mode 100644 index 000000000..b2bedc1d1 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/changed.golden @@ -0,0 +1,41 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + }, + changeValue: &[]string{"val2"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "newid" + + ~ list_block { + ~ prop = "val1" -> "val2" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ listBlocks: [ + ~ [0]: { + ~ prop: "val1" => "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"listBlocks[0].prop": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/list_element_added_back.golden b/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/list_element_added_back.golden new file mode 100644 index 000000000..6f65e800c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/list_element_added_back.golden @@ -0,0 +1,48 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "newid" -> (known after apply) + + + list_block { # forces replacement + + prop = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ listBlocks: [ + + [2]: { + + prop : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"listBlocks[2]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/list_element_added_front.golden b/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/list_element_added_front.golden new file mode 100644 index 000000000..db3969bd2 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/list_element_added_front.golden @@ -0,0 +1,62 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "newid" -> (known after apply) + + ~ list_block { # forces replacement + ~ prop = "val2" -> "val1" + } + ~ list_block { # forces replacement + ~ prop = "val3" -> "val2" + } + + list_block { # forces replacement + + prop = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ listBlocks: [ + ~ [0]: { + ~ prop: "val2" => "val1" + } + ~ [1]: { + ~ prop: "val3" => "val2" + } + + [2]: { + + prop : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "listBlocks[0].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[1].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/list_element_added_middle.golden b/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/list_element_added_middle.golden new file mode 100644 index 000000000..702605e95 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/list_element_added_middle.golden @@ -0,0 +1,57 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "newid" -> (known after apply) + + ~ list_block { # forces replacement + ~ prop = "val3" -> "val2" + } + + list_block { # forces replacement + + prop = "val3" + } + + # (1 unchanged block hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ listBlocks: [ + ~ [1]: { + ~ prop: "val3" => "val2" + } + + [2]: { + + prop : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "listBlocks[1].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/list_element_removed_end.golden b/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/list_element_removed_end.golden new file mode 100644 index 000000000..205bac165 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/list_element_removed_end.golden @@ -0,0 +1,62 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "newid" -> (known after apply) + + ~ list_block { # forces replacement + ~ prop = "val1" -> "val2" + } + ~ list_block { # forces replacement + ~ prop = "val2" -> "val1" + } + - list_block { # forces replacement + - prop = "val3" -> null + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ listBlocks: [ + ~ [0]: { + ~ prop: "val1" => "val2" + } + ~ [1]: { + ~ prop: "val2" => "val1" + } + - [2]: { + - prop: "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "listBlocks[0].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[1].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/list_element_removed_front.golden b/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/list_element_removed_front.golden new file mode 100644 index 000000000..9a92bb6cc --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/list_element_removed_front.golden @@ -0,0 +1,57 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "newid" -> (known after apply) + + ~ list_block { # forces replacement + ~ prop = "val1" -> "val3" + } + - list_block { # forces replacement + - prop = "val3" -> null + } + + # (1 unchanged block hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ listBlocks: [ + ~ [0]: { + ~ prop: "val1" => "val3" + } + - [2]: { + - prop: "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "listBlocks[0].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/list_element_removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/list_element_removed_middle.golden new file mode 100644 index 000000000..fe9e940b6 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/list_element_removed_middle.golden @@ -0,0 +1,62 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "newid" -> (known after apply) + + ~ list_block { # forces replacement + ~ prop = "val1" -> "val3" + } + ~ list_block { # forces replacement + ~ prop = "val2" -> "val1" + } + - list_block { # forces replacement + - prop = "val3" -> null + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ listBlocks: [ + ~ [0]: { + ~ prop: "val1" => "val3" + } + ~ [1]: { + ~ prop: "val2" => "val1" + } + - [2]: { + - prop: "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "listBlocks[0].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[1].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/removed_empty.golden b/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/removed_empty.golden new file mode 100644 index 000000000..7bae19762 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/removed_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/removed_non-empty.golden b/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/removed_non-empty.golden new file mode 100644 index 000000000..9379b5e65 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/removed_non-empty.golden @@ -0,0 +1,40 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "newid" -> (known after apply) + + - list_block { # forces replacement + - prop = "val1" -> null + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - listBlocks: [ + - [0]: { + - prop: "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"listBlocks": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/unchanged_empty.golden b/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/unchanged_empty.golden new file mode 100644 index 000000000..a53fac34d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/unchanged_empty.golden @@ -0,0 +1,11 @@ +tests.testOutput{tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`} diff --git a/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/unchanged_non-empty.golden b/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/unchanged_non-empty.golden new file mode 100644 index 000000000..e250a9f9c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/unchanged_non-empty.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + }, + changeValue: &[]string{"val1"}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffList/max_items_one_attribute_force_new/added_empty.golden b/pkg/tests/testdata/TestDetailedDiffList/max_items_one_attribute_force_new/added_empty.golden new file mode 100644 index 000000000..9589fbdf0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/max_items_one_attribute_force_new/added_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffList/max_items_one_attribute_force_new/added_non-empty.golden b/pkg/tests/testdata/TestDetailedDiffList/max_items_one_attribute_force_new/added_non-empty.golden new file mode 100644 index 000000000..86534e8c0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/max_items_one_attribute_force_new/added_non-empty.golden @@ -0,0 +1,35 @@ +tests.testOutput{ + changeValue: &[]string{ + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "newid" -> (known after apply) + + list_attr = [ # forces replacement + + "val1", + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + listAttr: "val1" +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"listAttr": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffList/max_items_one_attribute_force_new/changed.golden b/pkg/tests/testdata/TestDetailedDiffList/max_items_one_attribute_force_new/changed.golden new file mode 100644 index 000000000..67bd378f9 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/max_items_one_attribute_force_new/changed.golden @@ -0,0 +1,36 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + }, + changeValue: &[]string{"val2"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "newid" -> (known after apply) + ~ list_attr = [ # forces replacement + ~ "val1" -> "val2", + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ listAttr: "val1" => "val2" +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"listAttr": map[string]interface{}{"kind": "UPDATE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffList/max_items_one_attribute_force_new/removed_empty.golden b/pkg/tests/testdata/TestDetailedDiffList/max_items_one_attribute_force_new/removed_empty.golden new file mode 100644 index 000000000..7bae19762 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/max_items_one_attribute_force_new/removed_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffList/max_items_one_attribute_force_new/removed_non-empty.golden b/pkg/tests/testdata/TestDetailedDiffList/max_items_one_attribute_force_new/removed_non-empty.golden new file mode 100644 index 000000000..3db772324 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/max_items_one_attribute_force_new/removed_non-empty.golden @@ -0,0 +1,35 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "newid" -> (known after apply) + - list_attr = [ # forces replacement + - "val1", + ] -> null + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - listAttr: "val1" +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"listAttr": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffList/max_items_one_attribute_force_new/unchanged_empty.golden b/pkg/tests/testdata/TestDetailedDiffList/max_items_one_attribute_force_new/unchanged_empty.golden new file mode 100644 index 000000000..a53fac34d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/max_items_one_attribute_force_new/unchanged_empty.golden @@ -0,0 +1,11 @@ +tests.testOutput{tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`} diff --git a/pkg/tests/testdata/TestDetailedDiffList/max_items_one_attribute_force_new/unchanged_non-empty.golden b/pkg/tests/testdata/TestDetailedDiffList/max_items_one_attribute_force_new/unchanged_non-empty.golden new file mode 100644 index 000000000..e250a9f9c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/max_items_one_attribute_force_new/unchanged_non-empty.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + }, + changeValue: &[]string{"val1"}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} From 9ce613bd2cd941db0108d0ecab47e40de5bc9746 Mon Sep 17 00:00:00 2001 From: Venelin Date: Thu, 12 Dec 2024 12:18:03 +0000 Subject: [PATCH 2/3] Add SDKv2 Detailed Diff tests for lists with many elements --- pkg/tests/detailed_diff_list_test.go | 15 ++ .../long_list_added_back.golden | 81 +++++++ .../long_list_added_front.golden | 123 ++++++++++ .../long_list_removed_back.golden | 81 +++++++ .../long_list_removed_front.golden | 123 ++++++++++ .../one_added,_one_removed.golden | 52 ++++ .../long_list_added_back.golden | 81 +++++++ .../long_list_added_front.golden | 123 ++++++++++ .../long_list_removed_back.golden | 81 +++++++ .../long_list_removed_front.golden | 123 ++++++++++ .../one_added,_one_removed.golden | 52 ++++ .../list_block/long_list_added_back.golden | 84 +++++++ .../list_block/long_list_added_front.golden | 224 ++++++++++++++++++ .../list_block/long_list_removed_back.golden | 84 +++++++ .../list_block/long_list_removed_front.golden | 224 ++++++++++++++++++ .../list_block/one_added,_one_removed.golden | 63 +++++ .../long_list_added_back.golden | 84 +++++++ .../long_list_added_front.golden | 224 ++++++++++++++++++ .../long_list_removed_back.golden | 84 +++++++ .../long_list_removed_front.golden | 224 ++++++++++++++++++ .../one_added,_one_removed.golden | 63 +++++ 21 files changed, 2293 insertions(+) create mode 100644 pkg/tests/testdata/TestDetailedDiffList/list_attribute/long_list_added_back.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffList/list_attribute/long_list_added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffList/list_attribute/long_list_removed_back.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffList/list_attribute/long_list_removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffList/list_attribute/one_added,_one_removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/long_list_added_back.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/long_list_added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/long_list_removed_back.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/long_list_removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/one_added,_one_removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffList/list_block/long_list_added_back.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffList/list_block/long_list_added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffList/list_block/long_list_removed_back.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffList/list_block/long_list_removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffList/list_block/one_added,_one_removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/long_list_added_back.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/long_list_added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/long_list_removed_back.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/long_list_removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/one_added,_one_removed.golden diff --git a/pkg/tests/detailed_diff_list_test.go b/pkg/tests/detailed_diff_list_test.go index 166a9ad70..ded726a67 100644 --- a/pkg/tests/detailed_diff_list_test.go +++ b/pkg/tests/detailed_diff_list_test.go @@ -1,6 +1,7 @@ package tests import ( + "fmt" "testing" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -269,6 +270,14 @@ func TestDetailedDiffList(t *testing.T) { {"changed", ref([]string{"val1"}), ref([]string{"val2"})}, } + longList := &[]string{} + for i := 0; i < 20; i++ { + *longList = append(*longList, fmt.Sprintf("value%d", i)) + } + longListAddedBack := append([]string{}, *longList...) + longListAddedBack = append(longListAddedBack, "value20") + longListAddedFront := append([]string{"value20"}, *longList...) + multiElementScenarios := []struct { name string initialValue *[]string @@ -280,6 +289,12 @@ func TestDetailedDiffList(t *testing.T) { {"list element removed front", ref([]string{"val1", "val2", "val3"}), ref([]string{"val3", "val2"})}, {"list element removed middle", ref([]string{"val1", "val2", "val3"}), ref([]string{"val3", "val1"})}, {"list element removed end", ref([]string{"val1", "val2", "val3"}), ref([]string{"val2", "val1"})}, + {"one added, one removed", ref([]string{"val1", "val2", "val3"}), ref([]string{"val2", "val3", "val4"})}, + {"long list added back", longList, &longListAddedBack}, + // TODO[pulumi/pulumi-terraform-bridge#2239]: These cases present as multiple changes instead of just one + {"long list added front", longList, &longListAddedFront}, + {"long list removed front", &longListAddedFront, longList}, + {"long list removed back", &longListAddedBack, longList}, } scenarios := append(oneElementScenarios, multiElementScenarios...) diff --git a/pkg/tests/testdata/TestDetailedDiffList/list_attribute/long_list_added_back.golden b/pkg/tests/testdata/TestDetailedDiffList/list_attribute/long_list_added_back.golden new file mode 100644 index 000000000..e37dc03de --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/list_attribute/long_list_added_back.golden @@ -0,0 +1,81 @@ +tests.testOutput{ + initialValue: &[]string{ + "value0", + "value1", + "value2", + "value3", + "value4", + "value5", + "value6", + "value7", + "value8", + "value9", + "value10", + "value11", + "value12", + "value13", + "value14", + "value15", + "value16", + "value17", + "value18", + "value19", + }, + changeValue: &[]string{ + "value0", + "value1", + "value2", + "value3", + "value4", + "value5", + "value6", + "value7", + "value8", + "value9", + "value10", + "value11", + "value12", + "value13", + "value14", + "value15", + "value16", + "value17", + "value18", + "value19", + "value20", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "newid" + ~ list_attr = [ + # (19 unchanged elements hidden) + "value19", + + "value20", + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ listAttrs: [ + + [20]: "value20" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"listAttrs[20]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffList/list_attribute/long_list_added_front.golden b/pkg/tests/testdata/TestDetailedDiffList/list_attribute/long_list_added_front.golden new file mode 100644 index 000000000..ae61d269a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/list_attribute/long_list_added_front.golden @@ -0,0 +1,123 @@ +tests.testOutput{ + initialValue: &[]string{ + "value0", + "value1", + "value2", + "value3", + "value4", + "value5", + "value6", + "value7", + "value8", + "value9", + "value10", + "value11", + "value12", + "value13", + "value14", + "value15", + "value16", + "value17", + "value18", + "value19", + }, + changeValue: &[]string{ + "value20", + "value0", + "value1", + "value2", + "value3", + "value4", + "value5", + "value6", + "value7", + "value8", + "value9", + "value10", + "value11", + "value12", + "value13", + "value14", + "value15", + "value16", + "value17", + "value18", + "value19", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "newid" + ~ list_attr = [ + + "value20", + "value0", + # (19 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ listAttrs: [ + ~ [0]: "value0" => "value20" + ~ [1]: "value1" => "value0" + ~ [2]: "value2" => "value1" + ~ [3]: "value3" => "value2" + ~ [4]: "value4" => "value3" + ~ [5]: "value5" => "value4" + ~ [6]: "value6" => "value5" + ~ [7]: "value7" => "value6" + ~ [8]: "value8" => "value7" + ~ [9]: "value9" => "value8" + ~ [10]: "value10" => "value9" + ~ [11]: "value11" => "value10" + ~ [12]: "value12" => "value11" + ~ [13]: "value13" => "value12" + ~ [14]: "value14" => "value13" + ~ [15]: "value15" => "value14" + ~ [16]: "value16" => "value15" + ~ [17]: "value17" => "value16" + ~ [18]: "value18" => "value17" + ~ [19]: "value19" => "value18" + + [20]: "value19" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "listAttrs[0]": map[string]interface{}{"kind": "UPDATE"}, + "listAttrs[10]": map[string]interface{}{"kind": "UPDATE"}, + "listAttrs[11]": map[string]interface{}{"kind": "UPDATE"}, + "listAttrs[12]": map[string]interface{}{"kind": "UPDATE"}, + "listAttrs[13]": map[string]interface{}{"kind": "UPDATE"}, + "listAttrs[14]": map[string]interface{}{"kind": "UPDATE"}, + "listAttrs[15]": map[string]interface{}{"kind": "UPDATE"}, + "listAttrs[16]": map[string]interface{}{"kind": "UPDATE"}, + "listAttrs[17]": map[string]interface{}{"kind": "UPDATE"}, + "listAttrs[18]": map[string]interface{}{"kind": "UPDATE"}, + "listAttrs[19]": map[string]interface{}{"kind": "UPDATE"}, + "listAttrs[1]": map[string]interface{}{"kind": "UPDATE"}, + "listAttrs[20]": map[string]interface{}{}, + "listAttrs[2]": map[string]interface{}{"kind": "UPDATE"}, + "listAttrs[3]": map[string]interface{}{"kind": "UPDATE"}, + "listAttrs[4]": map[string]interface{}{"kind": "UPDATE"}, + "listAttrs[5]": map[string]interface{}{"kind": "UPDATE"}, + "listAttrs[6]": map[string]interface{}{"kind": "UPDATE"}, + "listAttrs[7]": map[string]interface{}{"kind": "UPDATE"}, + "listAttrs[8]": map[string]interface{}{"kind": "UPDATE"}, + "listAttrs[9]": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffList/list_attribute/long_list_removed_back.golden b/pkg/tests/testdata/TestDetailedDiffList/list_attribute/long_list_removed_back.golden new file mode 100644 index 000000000..13c73f95c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/list_attribute/long_list_removed_back.golden @@ -0,0 +1,81 @@ +tests.testOutput{ + initialValue: &[]string{ + "value0", + "value1", + "value2", + "value3", + "value4", + "value5", + "value6", + "value7", + "value8", + "value9", + "value10", + "value11", + "value12", + "value13", + "value14", + "value15", + "value16", + "value17", + "value18", + "value19", + "value20", + }, + changeValue: &[]string{ + "value0", + "value1", + "value2", + "value3", + "value4", + "value5", + "value6", + "value7", + "value8", + "value9", + "value10", + "value11", + "value12", + "value13", + "value14", + "value15", + "value16", + "value17", + "value18", + "value19", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "newid" + ~ list_attr = [ + # (19 unchanged elements hidden) + "value19", + - "value20", + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ listAttrs: [ + - [20]: "value20" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"listAttrs[20]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffList/list_attribute/long_list_removed_front.golden b/pkg/tests/testdata/TestDetailedDiffList/list_attribute/long_list_removed_front.golden new file mode 100644 index 000000000..79381a7c3 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/list_attribute/long_list_removed_front.golden @@ -0,0 +1,123 @@ +tests.testOutput{ + initialValue: &[]string{ + "value20", + "value0", + "value1", + "value2", + "value3", + "value4", + "value5", + "value6", + "value7", + "value8", + "value9", + "value10", + "value11", + "value12", + "value13", + "value14", + "value15", + "value16", + "value17", + "value18", + "value19", + }, + changeValue: &[]string{ + "value0", + "value1", + "value2", + "value3", + "value4", + "value5", + "value6", + "value7", + "value8", + "value9", + "value10", + "value11", + "value12", + "value13", + "value14", + "value15", + "value16", + "value17", + "value18", + "value19", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "newid" + ~ list_attr = [ + - "value20", + "value0", + # (19 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ listAttrs: [ + ~ [0]: "value20" => "value0" + ~ [1]: "value0" => "value1" + ~ [2]: "value1" => "value2" + ~ [3]: "value2" => "value3" + ~ [4]: "value3" => "value4" + ~ [5]: "value4" => "value5" + ~ [6]: "value5" => "value6" + ~ [7]: "value6" => "value7" + ~ [8]: "value7" => "value8" + ~ [9]: "value8" => "value9" + ~ [10]: "value9" => "value10" + ~ [11]: "value10" => "value11" + ~ [12]: "value11" => "value12" + ~ [13]: "value12" => "value13" + ~ [14]: "value13" => "value14" + ~ [15]: "value14" => "value15" + ~ [16]: "value15" => "value16" + ~ [17]: "value16" => "value17" + ~ [18]: "value17" => "value18" + ~ [19]: "value18" => "value19" + - [20]: "value19" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "listAttrs[0]": map[string]interface{}{"kind": "UPDATE"}, + "listAttrs[10]": map[string]interface{}{"kind": "UPDATE"}, + "listAttrs[11]": map[string]interface{}{"kind": "UPDATE"}, + "listAttrs[12]": map[string]interface{}{"kind": "UPDATE"}, + "listAttrs[13]": map[string]interface{}{"kind": "UPDATE"}, + "listAttrs[14]": map[string]interface{}{"kind": "UPDATE"}, + "listAttrs[15]": map[string]interface{}{"kind": "UPDATE"}, + "listAttrs[16]": map[string]interface{}{"kind": "UPDATE"}, + "listAttrs[17]": map[string]interface{}{"kind": "UPDATE"}, + "listAttrs[18]": map[string]interface{}{"kind": "UPDATE"}, + "listAttrs[19]": map[string]interface{}{"kind": "UPDATE"}, + "listAttrs[1]": map[string]interface{}{"kind": "UPDATE"}, + "listAttrs[20]": map[string]interface{}{"kind": "DELETE"}, + "listAttrs[2]": map[string]interface{}{"kind": "UPDATE"}, + "listAttrs[3]": map[string]interface{}{"kind": "UPDATE"}, + "listAttrs[4]": map[string]interface{}{"kind": "UPDATE"}, + "listAttrs[5]": map[string]interface{}{"kind": "UPDATE"}, + "listAttrs[6]": map[string]interface{}{"kind": "UPDATE"}, + "listAttrs[7]": map[string]interface{}{"kind": "UPDATE"}, + "listAttrs[8]": map[string]interface{}{"kind": "UPDATE"}, + "listAttrs[9]": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffList/list_attribute/one_added,_one_removed.golden b/pkg/tests/testdata/TestDetailedDiffList/list_attribute/one_added,_one_removed.golden new file mode 100644 index 000000000..088ca9367 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/list_attribute/one_added,_one_removed.golden @@ -0,0 +1,52 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + "val4", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "newid" + ~ list_attr = [ + ~ "val1" -> "val2", + ~ "val2" -> "val3", + ~ "val3" -> "val4", + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ listAttrs: [ + ~ [0]: "val1" => "val2" + ~ [1]: "val2" => "val3" + ~ [2]: "val3" => "val4" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "listAttrs[0]": map[string]interface{}{"kind": "UPDATE"}, + "listAttrs[1]": map[string]interface{}{"kind": "UPDATE"}, + "listAttrs[2]": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/long_list_added_back.golden b/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/long_list_added_back.golden new file mode 100644 index 000000000..429c0fe1b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/long_list_added_back.golden @@ -0,0 +1,81 @@ +tests.testOutput{ + initialValue: &[]string{ + "value0", + "value1", + "value2", + "value3", + "value4", + "value5", + "value6", + "value7", + "value8", + "value9", + "value10", + "value11", + "value12", + "value13", + "value14", + "value15", + "value16", + "value17", + "value18", + "value19", + }, + changeValue: &[]string{ + "value0", + "value1", + "value2", + "value3", + "value4", + "value5", + "value6", + "value7", + "value8", + "value9", + "value10", + "value11", + "value12", + "value13", + "value14", + "value15", + "value16", + "value17", + "value18", + "value19", + "value20", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "newid" -> (known after apply) + ~ list_attr = [ # forces replacement + # (19 unchanged elements hidden) + "value19", + + "value20", + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ listAttrs: [ + + [20]: "value20" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"listAttrs[20]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/long_list_added_front.golden b/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/long_list_added_front.golden new file mode 100644 index 000000000..2540d59c1 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/long_list_added_front.golden @@ -0,0 +1,123 @@ +tests.testOutput{ + initialValue: &[]string{ + "value0", + "value1", + "value2", + "value3", + "value4", + "value5", + "value6", + "value7", + "value8", + "value9", + "value10", + "value11", + "value12", + "value13", + "value14", + "value15", + "value16", + "value17", + "value18", + "value19", + }, + changeValue: &[]string{ + "value20", + "value0", + "value1", + "value2", + "value3", + "value4", + "value5", + "value6", + "value7", + "value8", + "value9", + "value10", + "value11", + "value12", + "value13", + "value14", + "value15", + "value16", + "value17", + "value18", + "value19", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "newid" -> (known after apply) + ~ list_attr = [ # forces replacement + + "value20", + "value0", + # (19 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ listAttrs: [ + ~ [0]: "value0" => "value20" + ~ [1]: "value1" => "value0" + ~ [2]: "value2" => "value1" + ~ [3]: "value3" => "value2" + ~ [4]: "value4" => "value3" + ~ [5]: "value5" => "value4" + ~ [6]: "value6" => "value5" + ~ [7]: "value7" => "value6" + ~ [8]: "value8" => "value7" + ~ [9]: "value9" => "value8" + ~ [10]: "value10" => "value9" + ~ [11]: "value11" => "value10" + ~ [12]: "value12" => "value11" + ~ [13]: "value13" => "value12" + ~ [14]: "value14" => "value13" + ~ [15]: "value15" => "value14" + ~ [16]: "value16" => "value15" + ~ [17]: "value17" => "value16" + ~ [18]: "value18" => "value17" + ~ [19]: "value19" => "value18" + + [20]: "value19" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "listAttrs[0]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "listAttrs[10]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "listAttrs[11]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "listAttrs[12]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "listAttrs[13]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "listAttrs[14]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "listAttrs[15]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "listAttrs[16]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "listAttrs[17]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "listAttrs[18]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "listAttrs[19]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "listAttrs[1]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "listAttrs[20]": map[string]interface{}{"kind": "ADD_REPLACE"}, + "listAttrs[2]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "listAttrs[3]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "listAttrs[4]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "listAttrs[5]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "listAttrs[6]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "listAttrs[7]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "listAttrs[8]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "listAttrs[9]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/long_list_removed_back.golden b/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/long_list_removed_back.golden new file mode 100644 index 000000000..a1a2b2405 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/long_list_removed_back.golden @@ -0,0 +1,81 @@ +tests.testOutput{ + initialValue: &[]string{ + "value0", + "value1", + "value2", + "value3", + "value4", + "value5", + "value6", + "value7", + "value8", + "value9", + "value10", + "value11", + "value12", + "value13", + "value14", + "value15", + "value16", + "value17", + "value18", + "value19", + "value20", + }, + changeValue: &[]string{ + "value0", + "value1", + "value2", + "value3", + "value4", + "value5", + "value6", + "value7", + "value8", + "value9", + "value10", + "value11", + "value12", + "value13", + "value14", + "value15", + "value16", + "value17", + "value18", + "value19", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "newid" -> (known after apply) + ~ list_attr = [ # forces replacement + # (19 unchanged elements hidden) + "value19", + - "value20", + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ listAttrs: [ + - [20]: "value20" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"listAttrs[20]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/long_list_removed_front.golden b/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/long_list_removed_front.golden new file mode 100644 index 000000000..026739cee --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/long_list_removed_front.golden @@ -0,0 +1,123 @@ +tests.testOutput{ + initialValue: &[]string{ + "value20", + "value0", + "value1", + "value2", + "value3", + "value4", + "value5", + "value6", + "value7", + "value8", + "value9", + "value10", + "value11", + "value12", + "value13", + "value14", + "value15", + "value16", + "value17", + "value18", + "value19", + }, + changeValue: &[]string{ + "value0", + "value1", + "value2", + "value3", + "value4", + "value5", + "value6", + "value7", + "value8", + "value9", + "value10", + "value11", + "value12", + "value13", + "value14", + "value15", + "value16", + "value17", + "value18", + "value19", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "newid" -> (known after apply) + ~ list_attr = [ # forces replacement + - "value20", + "value0", + # (19 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ listAttrs: [ + ~ [0]: "value20" => "value0" + ~ [1]: "value0" => "value1" + ~ [2]: "value1" => "value2" + ~ [3]: "value2" => "value3" + ~ [4]: "value3" => "value4" + ~ [5]: "value4" => "value5" + ~ [6]: "value5" => "value6" + ~ [7]: "value6" => "value7" + ~ [8]: "value7" => "value8" + ~ [9]: "value8" => "value9" + ~ [10]: "value9" => "value10" + ~ [11]: "value10" => "value11" + ~ [12]: "value11" => "value12" + ~ [13]: "value12" => "value13" + ~ [14]: "value13" => "value14" + ~ [15]: "value14" => "value15" + ~ [16]: "value15" => "value16" + ~ [17]: "value16" => "value17" + ~ [18]: "value17" => "value18" + ~ [19]: "value18" => "value19" + - [20]: "value19" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "listAttrs[0]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "listAttrs[10]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "listAttrs[11]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "listAttrs[12]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "listAttrs[13]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "listAttrs[14]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "listAttrs[15]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "listAttrs[16]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "listAttrs[17]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "listAttrs[18]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "listAttrs[19]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "listAttrs[1]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "listAttrs[20]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + "listAttrs[2]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "listAttrs[3]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "listAttrs[4]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "listAttrs[5]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "listAttrs[6]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "listAttrs[7]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "listAttrs[8]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "listAttrs[9]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/one_added,_one_removed.golden b/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/one_added,_one_removed.golden new file mode 100644 index 000000000..631a0ebb0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/list_attribute_force_new/one_added,_one_removed.golden @@ -0,0 +1,52 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + "val4", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "newid" -> (known after apply) + ~ list_attr = [ # forces replacement + ~ "val1" -> "val2", + ~ "val2" -> "val3", + ~ "val3" -> "val4", + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ listAttrs: [ + ~ [0]: "val1" => "val2" + ~ [1]: "val2" => "val3" + ~ [2]: "val3" => "val4" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "listAttrs[0]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "listAttrs[1]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "listAttrs[2]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffList/list_block/long_list_added_back.golden b/pkg/tests/testdata/TestDetailedDiffList/list_block/long_list_added_back.golden new file mode 100644 index 000000000..90b2551c9 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/list_block/long_list_added_back.golden @@ -0,0 +1,84 @@ +tests.testOutput{ + initialValue: &[]string{ + "value0", + "value1", + "value2", + "value3", + "value4", + "value5", + "value6", + "value7", + "value8", + "value9", + "value10", + "value11", + "value12", + "value13", + "value14", + "value15", + "value16", + "value17", + "value18", + "value19", + }, + changeValue: &[]string{ + "value0", + "value1", + "value2", + "value3", + "value4", + "value5", + "value6", + "value7", + "value8", + "value9", + "value10", + "value11", + "value12", + "value13", + "value14", + "value15", + "value16", + "value17", + "value18", + "value19", + "value20", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "newid" + + + list_block { + + prop = "value20" + } + + # (20 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ listBlocks: [ + + [20]: { + + prop : "value20" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"listBlocks[20]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffList/list_block/long_list_added_front.golden b/pkg/tests/testdata/TestDetailedDiffList/list_block/long_list_added_front.golden new file mode 100644 index 000000000..5ce2bf111 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/list_block/long_list_added_front.golden @@ -0,0 +1,224 @@ +tests.testOutput{ + initialValue: &[]string{ + "value0", + "value1", + "value2", + "value3", + "value4", + "value5", + "value6", + "value7", + "value8", + "value9", + "value10", + "value11", + "value12", + "value13", + "value14", + "value15", + "value16", + "value17", + "value18", + "value19", + }, + changeValue: &[]string{ + "value20", + "value0", + "value1", + "value2", + "value3", + "value4", + "value5", + "value6", + "value7", + "value8", + "value9", + "value10", + "value11", + "value12", + "value13", + "value14", + "value15", + "value16", + "value17", + "value18", + "value19", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "newid" + + ~ list_block { + ~ prop = "value0" -> "value20" + } + ~ list_block { + ~ prop = "value1" -> "value0" + } + ~ list_block { + ~ prop = "value2" -> "value1" + } + ~ list_block { + ~ prop = "value3" -> "value2" + } + ~ list_block { + ~ prop = "value4" -> "value3" + } + ~ list_block { + ~ prop = "value5" -> "value4" + } + ~ list_block { + ~ prop = "value6" -> "value5" + } + ~ list_block { + ~ prop = "value7" -> "value6" + } + ~ list_block { + ~ prop = "value8" -> "value7" + } + ~ list_block { + ~ prop = "value9" -> "value8" + } + ~ list_block { + ~ prop = "value10" -> "value9" + } + ~ list_block { + ~ prop = "value11" -> "value10" + } + ~ list_block { + ~ prop = "value12" -> "value11" + } + ~ list_block { + ~ prop = "value13" -> "value12" + } + ~ list_block { + ~ prop = "value14" -> "value13" + } + ~ list_block { + ~ prop = "value15" -> "value14" + } + ~ list_block { + ~ prop = "value16" -> "value15" + } + ~ list_block { + ~ prop = "value17" -> "value16" + } + ~ list_block { + ~ prop = "value18" -> "value17" + } + ~ list_block { + ~ prop = "value19" -> "value18" + } + + list_block { + + prop = "value19" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ listBlocks: [ + ~ [0]: { + ~ prop: "value0" => "value20" + } + ~ [1]: { + ~ prop: "value1" => "value0" + } + ~ [2]: { + ~ prop: "value2" => "value1" + } + ~ [3]: { + ~ prop: "value3" => "value2" + } + ~ [4]: { + ~ prop: "value4" => "value3" + } + ~ [5]: { + ~ prop: "value5" => "value4" + } + ~ [6]: { + ~ prop: "value6" => "value5" + } + ~ [7]: { + ~ prop: "value7" => "value6" + } + ~ [8]: { + ~ prop: "value8" => "value7" + } + ~ [9]: { + ~ prop: "value9" => "value8" + } + ~ [10]: { + ~ prop: "value10" => "value9" + } + ~ [11]: { + ~ prop: "value11" => "value10" + } + ~ [12]: { + ~ prop: "value12" => "value11" + } + ~ [13]: { + ~ prop: "value13" => "value12" + } + ~ [14]: { + ~ prop: "value14" => "value13" + } + ~ [15]: { + ~ prop: "value15" => "value14" + } + ~ [16]: { + ~ prop: "value16" => "value15" + } + ~ [17]: { + ~ prop: "value17" => "value16" + } + ~ [18]: { + ~ prop: "value18" => "value17" + } + ~ [19]: { + ~ prop: "value19" => "value18" + } + + [20]: { + + prop : "value19" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "listBlocks[0].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[10].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[11].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[12].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[13].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[14].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[15].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[16].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[17].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[18].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[19].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[1].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[20]": map[string]interface{}{}, + "listBlocks[2].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[3].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[4].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[5].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[6].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[7].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[8].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[9].prop": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffList/list_block/long_list_removed_back.golden b/pkg/tests/testdata/TestDetailedDiffList/list_block/long_list_removed_back.golden new file mode 100644 index 000000000..113f594bf --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/list_block/long_list_removed_back.golden @@ -0,0 +1,84 @@ +tests.testOutput{ + initialValue: &[]string{ + "value0", + "value1", + "value2", + "value3", + "value4", + "value5", + "value6", + "value7", + "value8", + "value9", + "value10", + "value11", + "value12", + "value13", + "value14", + "value15", + "value16", + "value17", + "value18", + "value19", + "value20", + }, + changeValue: &[]string{ + "value0", + "value1", + "value2", + "value3", + "value4", + "value5", + "value6", + "value7", + "value8", + "value9", + "value10", + "value11", + "value12", + "value13", + "value14", + "value15", + "value16", + "value17", + "value18", + "value19", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "newid" + + - list_block { + - prop = "value20" -> null + } + + # (20 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ listBlocks: [ + - [20]: { + - prop: "value20" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"listBlocks[20]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffList/list_block/long_list_removed_front.golden b/pkg/tests/testdata/TestDetailedDiffList/list_block/long_list_removed_front.golden new file mode 100644 index 000000000..86111f4fb --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/list_block/long_list_removed_front.golden @@ -0,0 +1,224 @@ +tests.testOutput{ + initialValue: &[]string{ + "value20", + "value0", + "value1", + "value2", + "value3", + "value4", + "value5", + "value6", + "value7", + "value8", + "value9", + "value10", + "value11", + "value12", + "value13", + "value14", + "value15", + "value16", + "value17", + "value18", + "value19", + }, + changeValue: &[]string{ + "value0", + "value1", + "value2", + "value3", + "value4", + "value5", + "value6", + "value7", + "value8", + "value9", + "value10", + "value11", + "value12", + "value13", + "value14", + "value15", + "value16", + "value17", + "value18", + "value19", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "newid" + + ~ list_block { + ~ prop = "value20" -> "value0" + } + ~ list_block { + ~ prop = "value0" -> "value1" + } + ~ list_block { + ~ prop = "value1" -> "value2" + } + ~ list_block { + ~ prop = "value2" -> "value3" + } + ~ list_block { + ~ prop = "value3" -> "value4" + } + ~ list_block { + ~ prop = "value4" -> "value5" + } + ~ list_block { + ~ prop = "value5" -> "value6" + } + ~ list_block { + ~ prop = "value6" -> "value7" + } + ~ list_block { + ~ prop = "value7" -> "value8" + } + ~ list_block { + ~ prop = "value8" -> "value9" + } + ~ list_block { + ~ prop = "value9" -> "value10" + } + ~ list_block { + ~ prop = "value10" -> "value11" + } + ~ list_block { + ~ prop = "value11" -> "value12" + } + ~ list_block { + ~ prop = "value12" -> "value13" + } + ~ list_block { + ~ prop = "value13" -> "value14" + } + ~ list_block { + ~ prop = "value14" -> "value15" + } + ~ list_block { + ~ prop = "value15" -> "value16" + } + ~ list_block { + ~ prop = "value16" -> "value17" + } + ~ list_block { + ~ prop = "value17" -> "value18" + } + ~ list_block { + ~ prop = "value18" -> "value19" + } + - list_block { + - prop = "value19" -> null + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ listBlocks: [ + ~ [0]: { + ~ prop: "value20" => "value0" + } + ~ [1]: { + ~ prop: "value0" => "value1" + } + ~ [2]: { + ~ prop: "value1" => "value2" + } + ~ [3]: { + ~ prop: "value2" => "value3" + } + ~ [4]: { + ~ prop: "value3" => "value4" + } + ~ [5]: { + ~ prop: "value4" => "value5" + } + ~ [6]: { + ~ prop: "value5" => "value6" + } + ~ [7]: { + ~ prop: "value6" => "value7" + } + ~ [8]: { + ~ prop: "value7" => "value8" + } + ~ [9]: { + ~ prop: "value8" => "value9" + } + ~ [10]: { + ~ prop: "value9" => "value10" + } + ~ [11]: { + ~ prop: "value10" => "value11" + } + ~ [12]: { + ~ prop: "value11" => "value12" + } + ~ [13]: { + ~ prop: "value12" => "value13" + } + ~ [14]: { + ~ prop: "value13" => "value14" + } + ~ [15]: { + ~ prop: "value14" => "value15" + } + ~ [16]: { + ~ prop: "value15" => "value16" + } + ~ [17]: { + ~ prop: "value16" => "value17" + } + ~ [18]: { + ~ prop: "value17" => "value18" + } + ~ [19]: { + ~ prop: "value18" => "value19" + } + - [20]: { + - prop: "value19" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "listBlocks[0].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[10].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[11].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[12].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[13].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[14].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[15].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[16].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[17].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[18].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[19].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[1].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[20]": map[string]interface{}{"kind": "DELETE"}, + "listBlocks[2].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[3].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[4].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[5].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[6].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[7].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[8].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[9].prop": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffList/list_block/one_added,_one_removed.golden b/pkg/tests/testdata/TestDetailedDiffList/list_block/one_added,_one_removed.golden new file mode 100644 index 000000000..5658a65a0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/list_block/one_added,_one_removed.golden @@ -0,0 +1,63 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + "val4", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "newid" + + ~ list_block { + ~ prop = "val1" -> "val2" + } + ~ list_block { + ~ prop = "val2" -> "val3" + } + ~ list_block { + ~ prop = "val3" -> "val4" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ listBlocks: [ + ~ [0]: { + ~ prop: "val1" => "val2" + } + ~ [1]: { + ~ prop: "val2" => "val3" + } + ~ [2]: { + ~ prop: "val3" => "val4" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "listBlocks[0].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[1].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[2].prop": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/long_list_added_back.golden b/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/long_list_added_back.golden new file mode 100644 index 000000000..f5a98ba62 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/long_list_added_back.golden @@ -0,0 +1,84 @@ +tests.testOutput{ + initialValue: &[]string{ + "value0", + "value1", + "value2", + "value3", + "value4", + "value5", + "value6", + "value7", + "value8", + "value9", + "value10", + "value11", + "value12", + "value13", + "value14", + "value15", + "value16", + "value17", + "value18", + "value19", + }, + changeValue: &[]string{ + "value0", + "value1", + "value2", + "value3", + "value4", + "value5", + "value6", + "value7", + "value8", + "value9", + "value10", + "value11", + "value12", + "value13", + "value14", + "value15", + "value16", + "value17", + "value18", + "value19", + "value20", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "newid" -> (known after apply) + + + list_block { # forces replacement + + prop = "value20" + } + + # (20 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ listBlocks: [ + + [20]: { + + prop : "value20" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"listBlocks[20]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/long_list_added_front.golden b/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/long_list_added_front.golden new file mode 100644 index 000000000..ce1f68dc3 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/long_list_added_front.golden @@ -0,0 +1,224 @@ +tests.testOutput{ + initialValue: &[]string{ + "value0", + "value1", + "value2", + "value3", + "value4", + "value5", + "value6", + "value7", + "value8", + "value9", + "value10", + "value11", + "value12", + "value13", + "value14", + "value15", + "value16", + "value17", + "value18", + "value19", + }, + changeValue: &[]string{ + "value20", + "value0", + "value1", + "value2", + "value3", + "value4", + "value5", + "value6", + "value7", + "value8", + "value9", + "value10", + "value11", + "value12", + "value13", + "value14", + "value15", + "value16", + "value17", + "value18", + "value19", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "newid" -> (known after apply) + + ~ list_block { # forces replacement + ~ prop = "value0" -> "value20" + } + ~ list_block { # forces replacement + ~ prop = "value1" -> "value0" + } + ~ list_block { # forces replacement + ~ prop = "value2" -> "value1" + } + ~ list_block { # forces replacement + ~ prop = "value3" -> "value2" + } + ~ list_block { # forces replacement + ~ prop = "value4" -> "value3" + } + ~ list_block { # forces replacement + ~ prop = "value5" -> "value4" + } + ~ list_block { # forces replacement + ~ prop = "value6" -> "value5" + } + ~ list_block { # forces replacement + ~ prop = "value7" -> "value6" + } + ~ list_block { # forces replacement + ~ prop = "value8" -> "value7" + } + ~ list_block { # forces replacement + ~ prop = "value9" -> "value8" + } + ~ list_block { # forces replacement + ~ prop = "value10" -> "value9" + } + ~ list_block { # forces replacement + ~ prop = "value11" -> "value10" + } + ~ list_block { # forces replacement + ~ prop = "value12" -> "value11" + } + ~ list_block { # forces replacement + ~ prop = "value13" -> "value12" + } + ~ list_block { # forces replacement + ~ prop = "value14" -> "value13" + } + ~ list_block { # forces replacement + ~ prop = "value15" -> "value14" + } + ~ list_block { # forces replacement + ~ prop = "value16" -> "value15" + } + ~ list_block { # forces replacement + ~ prop = "value17" -> "value16" + } + ~ list_block { # forces replacement + ~ prop = "value18" -> "value17" + } + ~ list_block { # forces replacement + ~ prop = "value19" -> "value18" + } + + list_block { # forces replacement + + prop = "value19" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ listBlocks: [ + ~ [0]: { + ~ prop: "value0" => "value20" + } + ~ [1]: { + ~ prop: "value1" => "value0" + } + ~ [2]: { + ~ prop: "value2" => "value1" + } + ~ [3]: { + ~ prop: "value3" => "value2" + } + ~ [4]: { + ~ prop: "value4" => "value3" + } + ~ [5]: { + ~ prop: "value5" => "value4" + } + ~ [6]: { + ~ prop: "value6" => "value5" + } + ~ [7]: { + ~ prop: "value7" => "value6" + } + ~ [8]: { + ~ prop: "value8" => "value7" + } + ~ [9]: { + ~ prop: "value9" => "value8" + } + ~ [10]: { + ~ prop: "value10" => "value9" + } + ~ [11]: { + ~ prop: "value11" => "value10" + } + ~ [12]: { + ~ prop: "value12" => "value11" + } + ~ [13]: { + ~ prop: "value13" => "value12" + } + ~ [14]: { + ~ prop: "value14" => "value13" + } + ~ [15]: { + ~ prop: "value15" => "value14" + } + ~ [16]: { + ~ prop: "value16" => "value15" + } + ~ [17]: { + ~ prop: "value17" => "value16" + } + ~ [18]: { + ~ prop: "value18" => "value17" + } + ~ [19]: { + ~ prop: "value19" => "value18" + } + + [20]: { + + prop : "value19" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "listBlocks[0].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[10].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[11].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[12].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[13].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[14].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[15].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[16].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[17].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[18].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[19].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[1].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[20]": map[string]interface{}{"kind": "ADD_REPLACE"}, + "listBlocks[2].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[3].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[4].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[5].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[6].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[7].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[8].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[9].prop": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/long_list_removed_back.golden b/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/long_list_removed_back.golden new file mode 100644 index 000000000..4117bc078 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/long_list_removed_back.golden @@ -0,0 +1,84 @@ +tests.testOutput{ + initialValue: &[]string{ + "value0", + "value1", + "value2", + "value3", + "value4", + "value5", + "value6", + "value7", + "value8", + "value9", + "value10", + "value11", + "value12", + "value13", + "value14", + "value15", + "value16", + "value17", + "value18", + "value19", + "value20", + }, + changeValue: &[]string{ + "value0", + "value1", + "value2", + "value3", + "value4", + "value5", + "value6", + "value7", + "value8", + "value9", + "value10", + "value11", + "value12", + "value13", + "value14", + "value15", + "value16", + "value17", + "value18", + "value19", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "newid" -> (known after apply) + + - list_block { # forces replacement + - prop = "value20" -> null + } + + # (20 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ listBlocks: [ + - [20]: { + - prop: "value20" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"listBlocks[20]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/long_list_removed_front.golden b/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/long_list_removed_front.golden new file mode 100644 index 000000000..e13e11347 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/long_list_removed_front.golden @@ -0,0 +1,224 @@ +tests.testOutput{ + initialValue: &[]string{ + "value20", + "value0", + "value1", + "value2", + "value3", + "value4", + "value5", + "value6", + "value7", + "value8", + "value9", + "value10", + "value11", + "value12", + "value13", + "value14", + "value15", + "value16", + "value17", + "value18", + "value19", + }, + changeValue: &[]string{ + "value0", + "value1", + "value2", + "value3", + "value4", + "value5", + "value6", + "value7", + "value8", + "value9", + "value10", + "value11", + "value12", + "value13", + "value14", + "value15", + "value16", + "value17", + "value18", + "value19", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "newid" -> (known after apply) + + ~ list_block { # forces replacement + ~ prop = "value20" -> "value0" + } + ~ list_block { # forces replacement + ~ prop = "value0" -> "value1" + } + ~ list_block { # forces replacement + ~ prop = "value1" -> "value2" + } + ~ list_block { # forces replacement + ~ prop = "value2" -> "value3" + } + ~ list_block { # forces replacement + ~ prop = "value3" -> "value4" + } + ~ list_block { # forces replacement + ~ prop = "value4" -> "value5" + } + ~ list_block { # forces replacement + ~ prop = "value5" -> "value6" + } + ~ list_block { # forces replacement + ~ prop = "value6" -> "value7" + } + ~ list_block { # forces replacement + ~ prop = "value7" -> "value8" + } + ~ list_block { # forces replacement + ~ prop = "value8" -> "value9" + } + ~ list_block { # forces replacement + ~ prop = "value9" -> "value10" + } + ~ list_block { # forces replacement + ~ prop = "value10" -> "value11" + } + ~ list_block { # forces replacement + ~ prop = "value11" -> "value12" + } + ~ list_block { # forces replacement + ~ prop = "value12" -> "value13" + } + ~ list_block { # forces replacement + ~ prop = "value13" -> "value14" + } + ~ list_block { # forces replacement + ~ prop = "value14" -> "value15" + } + ~ list_block { # forces replacement + ~ prop = "value15" -> "value16" + } + ~ list_block { # forces replacement + ~ prop = "value16" -> "value17" + } + ~ list_block { # forces replacement + ~ prop = "value17" -> "value18" + } + ~ list_block { # forces replacement + ~ prop = "value18" -> "value19" + } + - list_block { # forces replacement + - prop = "value19" -> null + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ listBlocks: [ + ~ [0]: { + ~ prop: "value20" => "value0" + } + ~ [1]: { + ~ prop: "value0" => "value1" + } + ~ [2]: { + ~ prop: "value1" => "value2" + } + ~ [3]: { + ~ prop: "value2" => "value3" + } + ~ [4]: { + ~ prop: "value3" => "value4" + } + ~ [5]: { + ~ prop: "value4" => "value5" + } + ~ [6]: { + ~ prop: "value5" => "value6" + } + ~ [7]: { + ~ prop: "value6" => "value7" + } + ~ [8]: { + ~ prop: "value7" => "value8" + } + ~ [9]: { + ~ prop: "value8" => "value9" + } + ~ [10]: { + ~ prop: "value9" => "value10" + } + ~ [11]: { + ~ prop: "value10" => "value11" + } + ~ [12]: { + ~ prop: "value11" => "value12" + } + ~ [13]: { + ~ prop: "value12" => "value13" + } + ~ [14]: { + ~ prop: "value13" => "value14" + } + ~ [15]: { + ~ prop: "value14" => "value15" + } + ~ [16]: { + ~ prop: "value15" => "value16" + } + ~ [17]: { + ~ prop: "value16" => "value17" + } + ~ [18]: { + ~ prop: "value17" => "value18" + } + ~ [19]: { + ~ prop: "value18" => "value19" + } + - [20]: { + - prop: "value19" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "listBlocks[0].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[10].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[11].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[12].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[13].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[14].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[15].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[16].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[17].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[18].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[19].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[1].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[20]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + "listBlocks[2].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[3].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[4].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[5].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[6].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[7].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[8].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[9].prop": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/one_added,_one_removed.golden b/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/one_added,_one_removed.golden new file mode 100644 index 000000000..5658a65a0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffList/list_block_force_new/one_added,_one_removed.golden @@ -0,0 +1,63 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + "val4", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "newid" + + ~ list_block { + ~ prop = "val1" -> "val2" + } + ~ list_block { + ~ prop = "val2" -> "val3" + } + ~ list_block { + ~ prop = "val3" -> "val4" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ listBlocks: [ + ~ [0]: { + ~ prop: "val1" => "val2" + } + ~ [1]: { + ~ prop: "val2" => "val3" + } + ~ [2]: { + ~ prop: "val3" => "val4" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "listBlocks[0].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[1].prop": map[string]interface{}{"kind": "UPDATE"}, + "listBlocks[2].prop": map[string]interface{}{"kind": "UPDATE"}, + }, +} From bd80587095b6e157987f0e7304978e74f3f83e4e Mon Sep 17 00:00:00 2001 From: Venelin Date: Thu, 12 Dec 2024 15:18:07 +0000 Subject: [PATCH 3/3] Add SDKv2 Detailed Diff tests for Computed properties in sets --- pkg/tests/detailed_diff_set_test.go | 366 +++++++++++++++++- .../added.golden | 40 ++ .../added_end.golden | 71 ++++ .../added_end_unordered.golden | 75 ++++ .../added_front.golden | 75 ++++ .../added_front_unordered.golden | 73 ++++ .../added_middle.golden | 73 ++++ .../added_middle_unordered.golden | 71 ++++ .../changed_empty_to_null.golden | 15 + .../changed_non-null.golden | 49 +++ .../changed_non-null_to_null.golden | 17 + .../changed_null_to_empty.golden | 15 + .../changed_null_to_non-null.golden | 41 ++ .../removed.golden | 18 + .../removed_end.golden | 72 ++++ .../removed_end_unordered.golden | 76 ++++ .../removed_front.golden | 76 ++++ .../removed_front_unordered.golden | 74 ++++ .../removed_middle.golden | 74 ++++ .../removed_middle_unordered.golden | 74 ++++ .../shuffled.golden | 24 ++ .../shuffled_added_end.golden | 71 ++++ .../shuffled_added_front.golden | 75 ++++ .../shuffled_added_middle.golden | 73 ++++ .../shuffled_removed_end.golden | 72 ++++ .../shuffled_removed_front.golden | 76 ++++ .../shuffled_removed_middle.golden | 74 ++++ .../shuffled_unordered.golden | 24 ++ .../shuffled_with_duplicates.golden | 25 ++ .../shuffled_with_duplicates_unordered.golden | 25 ++ .../two_added.golden | 80 ++++ .../two_removed.golden | 82 ++++ .../unchanged_empty.golden | 16 + .../unchanged_non-empty.golden | 18 + .../unchanged_null.golden | 11 + .../added.golden | 41 ++ .../added_end.golden | 50 +++ .../added_end_unordered.golden | 50 +++ .../added_front.golden | 50 +++ .../added_front_unordered.golden | 50 +++ .../added_middle.golden | 50 +++ .../added_middle_unordered.golden | 50 +++ .../changed_empty_to_null.golden | 15 + .../changed_non-null.golden | 50 +++ .../changed_non-null_to_null.golden | 17 + .../changed_null_to_empty.golden | 15 + .../changed_null_to_non-null.golden | 42 ++ .../removed.golden | 18 + .../removed_end.golden | 50 +++ .../removed_end_unordered.golden | 50 +++ .../removed_front.golden | 50 +++ .../removed_front_unordered.golden | 50 +++ .../removed_middle.golden | 50 +++ .../removed_middle_unordered.golden | 50 +++ .../shuffled.golden | 24 ++ .../shuffled_added_end.golden | 50 +++ .../shuffled_added_front.golden | 50 +++ .../shuffled_added_middle.golden | 50 +++ .../shuffled_removed_end.golden | 50 +++ .../shuffled_removed_front.golden | 50 +++ .../shuffled_removed_middle.golden | 50 +++ .../shuffled_unordered.golden | 24 ++ .../shuffled_with_duplicates.golden | 25 ++ .../shuffled_with_duplicates_unordered.golden | 25 ++ .../two_added.golden | 62 +++ .../two_removed.golden | 62 +++ .../unchanged_empty.golden | 16 + .../unchanged_non-empty.golden | 18 + .../unchanged_null.golden | 11 + .../added.golden | 40 ++ .../added_end.golden | 71 ++++ .../added_end_unordered.golden | 75 ++++ .../added_front.golden | 75 ++++ .../added_front_unordered.golden | 73 ++++ .../added_middle.golden | 73 ++++ .../added_middle_unordered.golden | 71 ++++ .../changed_empty_to_null.golden | 15 + .../changed_non-null.golden | 49 +++ .../changed_non-null_to_null.golden | 17 + .../changed_null_to_empty.golden | 15 + .../changed_null_to_non-null.golden | 41 ++ .../removed.golden | 18 + .../removed_end.golden | 72 ++++ .../removed_end_unordered.golden | 76 ++++ .../removed_front.golden | 76 ++++ .../removed_front_unordered.golden | 74 ++++ .../removed_middle.golden | 74 ++++ .../removed_middle_unordered.golden | 74 ++++ .../shuffled.golden | 24 ++ .../shuffled_added_end.golden | 71 ++++ .../shuffled_added_front.golden | 75 ++++ .../shuffled_added_middle.golden | 73 ++++ .../shuffled_removed_end.golden | 72 ++++ .../shuffled_removed_front.golden | 76 ++++ .../shuffled_removed_middle.golden | 74 ++++ .../shuffled_unordered.golden | 24 ++ .../shuffled_with_duplicates.golden | 25 ++ .../shuffled_with_duplicates_unordered.golden | 25 ++ .../two_added.golden | 80 ++++ .../two_removed.golden | 82 ++++ .../unchanged_empty.golden | 16 + .../unchanged_non-empty.golden | 18 + .../unchanged_null.golden | 11 + .../added.golden | 41 ++ .../added_end.golden | 50 +++ .../added_end_unordered.golden | 50 +++ .../added_front.golden | 50 +++ .../added_front_unordered.golden | 50 +++ .../added_middle.golden | 50 +++ .../added_middle_unordered.golden | 50 +++ .../changed_empty_to_null.golden | 15 + .../changed_non-null.golden | 50 +++ .../changed_non-null_to_null.golden | 17 + .../changed_null_to_empty.golden | 15 + .../changed_null_to_non-null.golden | 42 ++ .../removed.golden | 18 + .../removed_end.golden | 50 +++ .../removed_end_unordered.golden | 50 +++ .../removed_front.golden | 50 +++ .../removed_front_unordered.golden | 50 +++ .../removed_middle.golden | 50 +++ .../removed_middle_unordered.golden | 50 +++ .../shuffled.golden | 24 ++ .../shuffled_added_end.golden | 50 +++ .../shuffled_added_front.golden | 50 +++ .../shuffled_added_middle.golden | 50 +++ .../shuffled_removed_end.golden | 50 +++ .../shuffled_removed_front.golden | 50 +++ .../shuffled_removed_middle.golden | 50 +++ .../shuffled_unordered.golden | 24 ++ .../shuffled_with_duplicates.golden | 25 ++ .../shuffled_with_duplicates_unordered.golden | 25 ++ .../two_added.golden | 62 +++ .../two_removed.golden | 62 +++ .../unchanged_empty.golden | 16 + .../unchanged_non-empty.golden | 18 + .../unchanged_null.golden | 11 + .../added.golden | 40 ++ .../added_end.golden | 71 ++++ .../added_end_unordered.golden | 75 ++++ .../added_front.golden | 75 ++++ .../added_front_unordered.golden | 73 ++++ .../added_middle.golden | 73 ++++ .../added_middle_unordered.golden | 71 ++++ .../changed_empty_to_null.golden | 15 + .../changed_non-null.golden | 49 +++ .../changed_non-null_to_null.golden | 17 + .../changed_null_to_empty.golden | 15 + .../changed_null_to_non-null.golden | 41 ++ .../removed.golden | 18 + .../removed_end.golden | 72 ++++ .../removed_end_unordered.golden | 76 ++++ .../removed_front.golden | 76 ++++ .../removed_front_unordered.golden | 74 ++++ .../removed_middle.golden | 74 ++++ .../removed_middle_unordered.golden | 74 ++++ .../same_element_updated.golden | 79 ++++ .../same_element_updated_unordered.golden | 77 ++++ .../shuffled.golden | 24 ++ .../shuffled_added_end.golden | 71 ++++ .../shuffled_added_front.golden | 75 ++++ .../shuffled_added_middle.golden | 73 ++++ .../shuffled_removed_end.golden | 72 ++++ .../shuffled_removed_front.golden | 76 ++++ .../shuffled_removed_middle.golden | 74 ++++ .../shuffled_unordered.golden | 24 ++ .../shuffled_with_duplicates.golden | 25 ++ .../shuffled_with_duplicates_unordered.golden | 25 ++ .../two_added.golden | 80 ++++ .../two_added_and_two_removed.golden | 92 +++++ ...d_two_removed_shuffled,_no_overlaps.golden | 92 +++++ ..._two_removed_shuffled,_one_overlaps.golden | 92 +++++ ...o_removed_shuffled,_with_duplicates.golden | 94 +++++ .../two_removed.golden | 82 ++++ .../unchanged_empty.golden | 16 + .../unchanged_non-empty.golden | 18 + .../unchanged_null.golden | 11 + .../added.golden | 41 ++ .../added_end.golden | 50 +++ .../added_end_unordered.golden | 50 +++ .../added_front.golden | 50 +++ .../added_front_unordered.golden | 50 +++ .../added_middle.golden | 50 +++ .../added_middle_unordered.golden | 50 +++ .../changed_empty_to_null.golden | 15 + .../changed_non-null.golden | 50 +++ .../changed_non-null_to_null.golden | 17 + .../changed_null_to_empty.golden | 15 + .../changed_null_to_non-null.golden | 42 ++ .../removed.golden | 18 + .../removed_end.golden | 50 +++ .../removed_end_unordered.golden | 50 +++ .../removed_front.golden | 50 +++ .../removed_front_unordered.golden | 50 +++ .../removed_middle.golden | 50 +++ .../removed_middle_unordered.golden | 50 +++ .../same_element_updated.golden | 62 +++ .../same_element_updated_unordered.golden | 58 +++ .../shuffled.golden | 24 ++ .../shuffled_added_end.golden | 50 +++ .../shuffled_added_front.golden | 50 +++ .../shuffled_added_middle.golden | 50 +++ .../shuffled_removed_end.golden | 50 +++ .../shuffled_removed_front.golden | 50 +++ .../shuffled_removed_middle.golden | 50 +++ .../shuffled_unordered.golden | 24 ++ .../shuffled_with_duplicates.golden | 25 ++ .../shuffled_with_duplicates_unordered.golden | 25 ++ .../two_added.golden | 62 +++ .../two_added_and_two_removed.golden | 74 ++++ ...d_two_removed_shuffled,_no_overlaps.golden | 74 ++++ ..._two_removed_shuffled,_one_overlaps.golden | 74 ++++ ...o_removed_shuffled,_with_duplicates.golden | 76 ++++ .../two_removed.golden | 62 +++ .../unchanged_empty.golden | 16 + .../unchanged_non-empty.golden | 18 + .../unchanged_null.golden | 11 + .../added.golden | 40 ++ .../added_end.golden | 71 ++++ .../added_end_unordered.golden | 75 ++++ .../added_front.golden | 75 ++++ .../added_front_unordered.golden | 73 ++++ .../added_middle.golden | 73 ++++ .../added_middle_unordered.golden | 71 ++++ .../changed_empty_to_null.golden | 15 + .../changed_non-null.golden | 49 +++ .../changed_non-null_to_null.golden | 42 ++ .../changed_null_to_empty.golden | 15 + .../changed_null_to_non-null.golden | 41 ++ .../removed.golden | 43 ++ .../removed_end.golden | 72 ++++ .../removed_end_unordered.golden | 76 ++++ .../removed_front.golden | 76 ++++ .../removed_front_unordered.golden | 74 ++++ .../removed_middle.golden | 74 ++++ .../removed_middle_unordered.golden | 74 ++++ .../shuffled.golden | 24 ++ .../shuffled_added_end.golden | 71 ++++ .../shuffled_added_front.golden | 75 ++++ .../shuffled_added_middle.golden | 73 ++++ .../shuffled_removed_end.golden | 72 ++++ .../shuffled_removed_front.golden | 76 ++++ .../shuffled_removed_middle.golden | 74 ++++ .../shuffled_unordered.golden | 24 ++ .../shuffled_with_duplicates.golden | 25 ++ .../shuffled_with_duplicates_unordered.golden | 25 ++ .../two_added.golden | 80 ++++ .../two_removed.golden | 82 ++++ .../unchanged_empty.golden | 16 + .../unchanged_non-empty.golden | 18 + .../unchanged_null.golden | 11 + .../added.golden | 41 ++ .../added_end.golden | 50 +++ .../added_end_unordered.golden | 50 +++ .../added_front.golden | 50 +++ .../added_front_unordered.golden | 50 +++ .../added_middle.golden | 50 +++ .../added_middle_unordered.golden | 50 +++ .../changed_empty_to_null.golden | 15 + .../changed_non-null.golden | 50 +++ .../changed_non-null_to_null.golden | 42 ++ .../changed_null_to_empty.golden | 15 + .../changed_null_to_non-null.golden | 42 ++ .../removed.golden | 43 ++ .../removed_end.golden | 50 +++ .../removed_end_unordered.golden | 50 +++ .../removed_front.golden | 50 +++ .../removed_front_unordered.golden | 50 +++ .../removed_middle.golden | 50 +++ .../removed_middle_unordered.golden | 50 +++ .../shuffled.golden | 24 ++ .../shuffled_added_end.golden | 50 +++ .../shuffled_added_front.golden | 50 +++ .../shuffled_added_middle.golden | 50 +++ .../shuffled_removed_end.golden | 50 +++ .../shuffled_removed_front.golden | 50 +++ .../shuffled_removed_middle.golden | 50 +++ .../shuffled_unordered.golden | 24 ++ .../shuffled_with_duplicates.golden | 25 ++ .../shuffled_with_duplicates_unordered.golden | 25 ++ .../two_added.golden | 62 +++ .../two_removed.golden | 62 +++ .../unchanged_empty.golden | 16 + .../unchanged_non-empty.golden | 18 + .../unchanged_null.golden | 11 + .../added.golden | 40 ++ .../added_end.golden | 71 ++++ .../added_end_unordered.golden | 75 ++++ .../added_front.golden | 75 ++++ .../added_front_unordered.golden | 73 ++++ .../added_middle.golden | 73 ++++ .../added_middle_unordered.golden | 71 ++++ .../changed_empty_to_null.golden | 15 + .../changed_non-null.golden | 49 +++ .../changed_non-null_to_null.golden | 42 ++ .../changed_null_to_empty.golden | 15 + .../changed_null_to_non-null.golden | 41 ++ .../removed.golden | 43 ++ .../removed_end.golden | 72 ++++ .../removed_end_unordered.golden | 76 ++++ .../removed_front.golden | 76 ++++ .../removed_front_unordered.golden | 74 ++++ .../removed_middle.golden | 74 ++++ .../removed_middle_unordered.golden | 74 ++++ .../shuffled.golden | 24 ++ .../shuffled_added_end.golden | 71 ++++ .../shuffled_added_front.golden | 75 ++++ .../shuffled_added_middle.golden | 73 ++++ .../shuffled_removed_end.golden | 72 ++++ .../shuffled_removed_front.golden | 76 ++++ .../shuffled_removed_middle.golden | 74 ++++ .../shuffled_unordered.golden | 24 ++ .../shuffled_with_duplicates.golden | 25 ++ .../shuffled_with_duplicates_unordered.golden | 25 ++ .../two_added.golden | 80 ++++ .../two_removed.golden | 82 ++++ .../unchanged_empty.golden | 16 + .../unchanged_non-empty.golden | 18 + .../unchanged_null.golden | 11 + .../added.golden | 41 ++ .../added_end.golden | 50 +++ .../added_end_unordered.golden | 50 +++ .../added_front.golden | 50 +++ .../added_front_unordered.golden | 50 +++ .../added_middle.golden | 50 +++ .../added_middle_unordered.golden | 50 +++ .../changed_empty_to_null.golden | 15 + .../changed_non-null.golden | 50 +++ .../changed_non-null_to_null.golden | 42 ++ .../changed_null_to_empty.golden | 15 + .../changed_null_to_non-null.golden | 42 ++ .../removed.golden | 43 ++ .../removed_end.golden | 50 +++ .../removed_end_unordered.golden | 50 +++ .../removed_front.golden | 50 +++ .../removed_front_unordered.golden | 50 +++ .../removed_middle.golden | 50 +++ .../removed_middle_unordered.golden | 50 +++ .../shuffled.golden | 24 ++ .../shuffled_added_end.golden | 50 +++ .../shuffled_added_front.golden | 50 +++ .../shuffled_added_middle.golden | 50 +++ .../shuffled_removed_end.golden | 50 +++ .../shuffled_removed_front.golden | 50 +++ .../shuffled_removed_middle.golden | 50 +++ .../shuffled_unordered.golden | 24 ++ .../shuffled_with_duplicates.golden | 25 ++ .../shuffled_with_duplicates_unordered.golden | 25 ++ .../two_added.golden | 62 +++ .../two_removed.golden | 62 +++ .../unchanged_empty.golden | 16 + .../unchanged_non-empty.golden | 18 + .../unchanged_null.golden | 11 + .../added.golden | 40 ++ .../added_end.golden | 71 ++++ .../added_end_unordered.golden | 75 ++++ .../added_front.golden | 75 ++++ .../added_front_unordered.golden | 73 ++++ .../added_middle.golden | 73 ++++ .../added_middle_unordered.golden | 71 ++++ .../changed_empty_to_null.golden | 15 + .../changed_non-null.golden | 49 +++ .../changed_non-null_to_null.golden | 42 ++ .../changed_null_to_empty.golden | 15 + .../changed_null_to_non-null.golden | 41 ++ .../removed.golden | 43 ++ .../removed_end.golden | 72 ++++ .../removed_end_unordered.golden | 76 ++++ .../removed_front.golden | 76 ++++ .../removed_front_unordered.golden | 74 ++++ .../removed_middle.golden | 74 ++++ .../removed_middle_unordered.golden | 74 ++++ .../same_element_updated.golden | 79 ++++ .../same_element_updated_unordered.golden | 77 ++++ .../shuffled.golden | 24 ++ .../shuffled_added_end.golden | 71 ++++ .../shuffled_added_front.golden | 75 ++++ .../shuffled_added_middle.golden | 73 ++++ .../shuffled_removed_end.golden | 72 ++++ .../shuffled_removed_front.golden | 76 ++++ .../shuffled_removed_middle.golden | 74 ++++ .../shuffled_unordered.golden | 24 ++ .../shuffled_with_duplicates.golden | 25 ++ .../shuffled_with_duplicates_unordered.golden | 25 ++ .../two_added.golden | 80 ++++ .../two_added_and_two_removed.golden | 92 +++++ ...d_two_removed_shuffled,_no_overlaps.golden | 92 +++++ ..._two_removed_shuffled,_one_overlaps.golden | 92 +++++ ...o_removed_shuffled,_with_duplicates.golden | 94 +++++ .../two_removed.golden | 82 ++++ .../unchanged_empty.golden | 16 + .../unchanged_non-empty.golden | 18 + .../unchanged_null.golden | 11 + .../added.golden | 41 ++ .../added_end.golden | 50 +++ .../added_end_unordered.golden | 50 +++ .../added_front.golden | 50 +++ .../added_front_unordered.golden | 50 +++ .../added_middle.golden | 50 +++ .../added_middle_unordered.golden | 50 +++ .../changed_empty_to_null.golden | 15 + .../changed_non-null.golden | 50 +++ .../changed_non-null_to_null.golden | 42 ++ .../changed_null_to_empty.golden | 15 + .../changed_null_to_non-null.golden | 42 ++ .../removed.golden | 43 ++ .../removed_end.golden | 50 +++ .../removed_end_unordered.golden | 50 +++ .../removed_front.golden | 50 +++ .../removed_front_unordered.golden | 50 +++ .../removed_middle.golden | 50 +++ .../removed_middle_unordered.golden | 50 +++ .../same_element_updated.golden | 62 +++ .../same_element_updated_unordered.golden | 58 +++ .../shuffled.golden | 24 ++ .../shuffled_added_end.golden | 50 +++ .../shuffled_added_front.golden | 50 +++ .../shuffled_added_middle.golden | 50 +++ .../shuffled_removed_end.golden | 50 +++ .../shuffled_removed_front.golden | 50 +++ .../shuffled_removed_middle.golden | 50 +++ .../shuffled_unordered.golden | 24 ++ .../shuffled_with_duplicates.golden | 25 ++ .../shuffled_with_duplicates_unordered.golden | 25 ++ .../two_added.golden | 62 +++ .../two_added_and_two_removed.golden | 74 ++++ ...d_two_removed_shuffled,_no_overlaps.golden | 74 ++++ ..._two_removed_shuffled,_one_overlaps.golden | 74 ++++ ...o_removed_shuffled,_with_duplicates.golden | 76 ++++ .../two_removed.golden | 62 +++ .../unchanged_empty.golden | 16 + .../unchanged_non-empty.golden | 18 + .../unchanged_null.golden | 11 + .../computed_attribute_force_new/added.golden | 36 ++ .../added_end.golden | 44 +++ .../added_end_unordered.golden | 44 +++ .../added_front.golden | 44 +++ .../added_front_unordered.golden | 44 +++ .../added_middle.golden | 44 +++ .../added_middle_unordered.golden | 44 +++ .../changed_empty_to_null.golden | 15 + .../changed_non-null.golden | 39 ++ .../changed_non-null_to_null.golden | 17 + .../changed_null_to_empty.golden | 15 + .../changed_null_to_non-null.golden | 37 ++ .../removed.golden | 38 ++ .../removed_end.golden | 44 +++ .../removed_end_unordered.golden | 44 +++ .../removed_front.golden | 44 +++ .../removed_front_unordered.golden | 44 +++ .../removed_middle.golden | 44 +++ .../removed_middle_unordered.golden | 44 +++ .../shuffled.golden | 24 ++ .../shuffled_added_end.golden | 44 +++ .../shuffled_added_front.golden | 44 +++ .../shuffled_added_middle.golden | 44 +++ .../shuffled_removed_end.golden | 44 +++ .../shuffled_removed_front.golden | 44 +++ .../shuffled_removed_middle.golden | 44 +++ .../shuffled_unordered.golden | 24 ++ .../shuffled_with_duplicates.golden | 25 ++ .../shuffled_with_duplicates_unordered.golden | 25 ++ .../two_added.golden | 50 +++ .../two_removed.golden | 50 +++ .../unchanged_empty.golden | 16 + .../unchanged_non-empty.golden | 18 + .../unchanged_null.golden | 11 + .../added.golden | 37 ++ .../added_end.golden | 44 +++ .../added_end_unordered.golden | 44 +++ .../added_front.golden | 44 +++ .../added_front_unordered.golden | 44 +++ .../added_middle.golden | 44 +++ .../added_middle_unordered.golden | 44 +++ .../changed_empty_to_null.golden | 15 + .../changed_non-null.golden | 39 ++ .../changed_non-null_to_null.golden | 17 + .../changed_null_to_empty.golden | 35 ++ .../changed_null_to_non-null.golden | 38 ++ .../removed.golden | 38 ++ .../removed_end.golden | 44 +++ .../removed_end_unordered.golden | 44 +++ .../removed_front.golden | 44 +++ .../removed_front_unordered.golden | 44 +++ .../removed_middle.golden | 44 +++ .../removed_middle_unordered.golden | 44 +++ .../same_element_updated.golden | 50 +++ .../same_element_updated_unordered.golden | 46 +++ .../shuffled.golden | 24 ++ .../shuffled_added_end.golden | 44 +++ .../shuffled_added_front.golden | 44 +++ .../shuffled_added_middle.golden | 44 +++ .../shuffled_removed_end.golden | 44 +++ .../shuffled_removed_front.golden | 44 +++ .../shuffled_removed_middle.golden | 44 +++ .../shuffled_unordered.golden | 24 ++ .../shuffled_with_duplicates.golden | 25 ++ .../shuffled_with_duplicates_unordered.golden | 25 ++ .../two_added.golden | 50 +++ .../two_added_and_two_removed.golden | 54 +++ ...d_two_removed_shuffled,_no_overlaps.golden | 54 +++ ..._two_removed_shuffled,_one_overlaps.golden | 54 +++ ...o_removed_shuffled,_with_duplicates.golden | 56 +++ .../two_removed.golden | 50 +++ .../unchanged_empty.golden | 36 ++ .../unchanged_non-empty.golden | 18 + .../unchanged_null.golden | 11 + 507 files changed, 24495 insertions(+), 19 deletions(-) create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_empty_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_non-null_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_null_to_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_null_to_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_with_duplicates.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_with_duplicates_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/two_added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/two_removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/unchanged_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/unchanged_non-empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/unchanged_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_empty_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_non-null_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_null_to_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_null_to_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_with_duplicates.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_with_duplicates_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/two_added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/two_removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/unchanged_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/unchanged_non-empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/unchanged_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_empty_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_non-null_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_null_to_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_null_to_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_with_duplicates.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_with_duplicates_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/two_added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/two_removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/unchanged_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/unchanged_non-empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/unchanged_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_empty_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_non-null_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_null_to_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_null_to_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_with_duplicates.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_with_duplicates_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/two_added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/two_removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/unchanged_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/unchanged_non-empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/unchanged_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_empty_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_non-null_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_null_to_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_null_to_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/same_element_updated.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/same_element_updated_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_with_duplicates.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_with_duplicates_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added_and_two_removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added_and_two_removed_shuffled,_no_overlaps.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added_and_two_removed_shuffled,_one_overlaps.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added_and_two_removed_shuffled,_with_duplicates.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/unchanged_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/unchanged_non-empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/unchanged_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_empty_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_non-null_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_null_to_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_null_to_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/same_element_updated.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/same_element_updated_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_with_duplicates.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_with_duplicates_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added_and_two_removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_no_overlaps.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_one_overlaps.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_with_duplicates.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/unchanged_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/unchanged_non-empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/unchanged_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_empty_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_non-null_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_null_to_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_null_to_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_with_duplicates.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_with_duplicates_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/two_added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/two_removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/unchanged_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/unchanged_non-empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/unchanged_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_empty_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_non-null_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_null_to_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_null_to_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_with_duplicates.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_with_duplicates_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/two_added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/two_removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/unchanged_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/unchanged_non-empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/unchanged_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_empty_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_non-null_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_null_to_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_null_to_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_with_duplicates.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_with_duplicates_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/two_added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/two_removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/unchanged_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/unchanged_non-empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/unchanged_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_empty_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_non-null_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_null_to_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_null_to_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_with_duplicates.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_with_duplicates_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/two_added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/two_removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/unchanged_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/unchanged_non-empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/unchanged_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_empty_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_non-null_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_null_to_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_null_to_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/same_element_updated.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/same_element_updated_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_with_duplicates.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_with_duplicates_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added_and_two_removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added_and_two_removed_shuffled,_no_overlaps.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added_and_two_removed_shuffled,_one_overlaps.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added_and_two_removed_shuffled,_with_duplicates.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/unchanged_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/unchanged_non-empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/unchanged_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_empty_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_non-null_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_null_to_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_null_to_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/same_element_updated.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/same_element_updated_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_with_duplicates.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_with_duplicates_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added_and_two_removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_no_overlaps.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_one_overlaps.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_with_duplicates.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/unchanged_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/unchanged_non-empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/unchanged_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_empty_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_non-null_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_null_to_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_null_to_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_with_duplicates.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_with_duplicates_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/two_added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/two_removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/unchanged_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/unchanged_non-empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/unchanged_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_empty_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_non-null_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_null_to_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_null_to_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/same_element_updated.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/same_element_updated_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_with_duplicates.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_with_duplicates_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added_and_two_removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added_and_two_removed_shuffled,_no_overlaps.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added_and_two_removed_shuffled,_one_overlaps.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added_and_two_removed_shuffled,_with_duplicates.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/unchanged_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/unchanged_non-empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/unchanged_null.golden diff --git a/pkg/tests/detailed_diff_set_test.go b/pkg/tests/detailed_diff_set_test.go index 874d78208..f19b19de0 100644 --- a/pkg/tests/detailed_diff_set_test.go +++ b/pkg/tests/detailed_diff_set_test.go @@ -13,6 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hexops/autogold/v2" "github.com/pulumi/pulumi/sdk/v3/go/auto/optpreview" + "github.com/pulumi/pulumi/sdk/v3/go/common/util/contract" "github.com/stretchr/testify/require" "github.com/zclconf/go-cty/cty" @@ -858,6 +859,301 @@ func TestDetailedDiffSet(t *testing.T) { }, } + computedAttributeSchema := schema.Resource{ + Schema: map[string]*schema.Schema{ + "test": { + Type: schema.TypeSet, + Optional: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + CreateContext: func(ctx context.Context, d *schema.ResourceData, i interface{}) diag.Diagnostics { + d.SetId("id") + setHashFunc := d.Get("test").(*schema.Set).F + err := d.Set("test", schema.NewSet(setHashFunc, []interface{}{"computed"})) + contract.Assertf(err == nil, "failed to set attribute: %v", err) + return nil + }, + UpdateContext: func(ctx context.Context, d *schema.ResourceData, i interface{}) diag.Diagnostics { + if d.Get("test") == nil { + setHashFunc := d.Get("test").(*schema.Set).F + err := d.Set("test", schema.NewSet(setHashFunc, []interface{}{"computed"})) + contract.Assertf(err == nil, "failed to set attribute: %v", err) + } + return nil + }, + } + + computedAttributeSchemaForceNew := schema.Resource{ + Schema: map[string]*schema.Schema{ + "test": { + Type: schema.TypeSet, + Optional: true, + Computed: true, + ForceNew: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + CreateContext: func(ctx context.Context, d *schema.ResourceData, i interface{}) diag.Diagnostics { + d.SetId("id") + if d.Get("test") == nil { + err := d.Set("test", schema.NewSet(schema.HashString, []interface{}{"computed"})) + contract.Assertf(err == nil, "failed to set attribute: %v", err) + } + return nil + }, + UpdateContext: func(ctx context.Context, d *schema.ResourceData, i interface{}) diag.Diagnostics { + if d.Get("test") == nil { + err := d.Set("test", schema.NewSet(schema.HashString, []interface{}{"computed"})) + contract.Assertf(err == nil, "failed to set attribute: %v", err) + } + return nil + }, + } + + computedSetBlockAttributeFunc := func(_ context.Context, d *schema.ResourceData, _ interface{}) { + contract.Assertf(d.Get("test") != nil, "test attribute is nil") + testVals := d.Get("test").(*schema.Set).List() + for _, v := range testVals { + val := v.(map[string]interface{}) + if val["computed"] == nil { + compVal := "computed1" + if val["nested"] != nil { + compVal = val["nested"].(string) + } + val["computed"] = compVal + } + } + setHashFunc := d.Get("test").(*schema.Set).F + err := d.Set("test", schema.NewSet(setHashFunc, testVals)) + contract.Assertf(err == nil, "failed to set attribute: %v", err) + } + + computedSetBlockFunc := func(ctx context.Context, d *schema.ResourceData, i interface{}) { + if d.Get("test") == nil { + setHashFunc := d.Get("test").(*schema.Set).F + err := d.Set("test", schema.NewSet(setHashFunc, []interface{}{ + map[string]interface{}{ + "nested": "computed", + "computed": "computed1", + }, + })) + contract.Assertf(err == nil, "failed to set attribute: %v", err) + } else { + computedSetBlockAttributeFunc(ctx, d, i) + } + } + + blockSchemaComputed := schema.Resource{ + Schema: map[string]*schema.Schema{ + "test": { + Type: schema.TypeSet, + Optional: true, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "nested": { + Type: schema.TypeString, + Optional: true, + }, + "computed": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + }, + }, + }, + }, + CreateContext: func(ctx context.Context, d *schema.ResourceData, i interface{}) diag.Diagnostics { + d.SetId("id") + computedSetBlockFunc(ctx, d, i) + return nil + }, + UpdateContext: func(ctx context.Context, d *schema.ResourceData, i interface{}) diag.Diagnostics { + computedSetBlockFunc(ctx, d, i) + return nil + }, + } + + blockSchemaComputedForceNew := schema.Resource{ + Schema: map[string]*schema.Schema{ + "test": { + Type: schema.TypeSet, + Optional: true, + ForceNew: true, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "nested": { + Type: schema.TypeString, + Optional: true, + }, + "computed": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + }, + }, + }, + }, + CreateContext: func(ctx context.Context, d *schema.ResourceData, i interface{}) diag.Diagnostics { + d.SetId("id") + computedSetBlockFunc(ctx, d, i) + return nil + }, + UpdateContext: func(ctx context.Context, d *schema.ResourceData, i interface{}) diag.Diagnostics { + computedSetBlockFunc(ctx, d, i) + return nil + }, + } + + blockSchemaComputedNestedForceNew := schema.Resource{ + Schema: map[string]*schema.Schema{ + "test": { + Type: schema.TypeSet, + Optional: true, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "nested": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, + "computed": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + }, + }, + }, + }, + CreateContext: func(ctx context.Context, d *schema.ResourceData, i interface{}) diag.Diagnostics { + d.SetId("id") + computedSetBlockFunc(ctx, d, i) + return nil + }, + UpdateContext: func(ctx context.Context, d *schema.ResourceData, i interface{}) diag.Diagnostics { + computedSetBlockFunc(ctx, d, i) + return nil + }, + } + + blockSchemaNestedComputed := schema.Resource{ + Schema: map[string]*schema.Schema{ + "test": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "nested": { + Type: schema.TypeString, + Optional: true, + }, + "computed": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + }, + }, + }, + }, + CreateContext: func(ctx context.Context, d *schema.ResourceData, i interface{}) diag.Diagnostics { + d.SetId("id") + if d.Get("test") != nil { + computedSetBlockAttributeFunc(ctx, d, i) + } + return nil + }, + UpdateContext: func(ctx context.Context, d *schema.ResourceData, i interface{}) diag.Diagnostics { + if d.Get("test") != nil { + computedSetBlockAttributeFunc(ctx, d, i) + } + return nil + }, + } + + blockSchemaNestedComputedForceNew := schema.Resource{ + Schema: map[string]*schema.Schema{ + "test": { + Type: schema.TypeSet, + Optional: true, + ForceNew: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "nested": { + Type: schema.TypeString, + Optional: true, + }, + "computed": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + }, + }, + }, + }, + CreateContext: func(ctx context.Context, d *schema.ResourceData, i interface{}) diag.Diagnostics { + d.SetId("id") + if d.Get("test") != nil { + computedSetBlockAttributeFunc(ctx, d, i) + } + return nil + }, + UpdateContext: func(ctx context.Context, d *schema.ResourceData, i interface{}) diag.Diagnostics { + if d.Get("test") != nil { + computedSetBlockAttributeFunc(ctx, d, i) + } + return nil + }, + } + + blockSchemaNestedComputedNestedForceNew := schema.Resource{ + Schema: map[string]*schema.Schema{ + "test": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "nested": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, + "computed": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + }, + }, + }, + }, + CreateContext: func(ctx context.Context, d *schema.ResourceData, i interface{}) diag.Diagnostics { + d.SetId("id") + if d.Get("test") != nil { + computedSetBlockAttributeFunc(ctx, d, i) + } + return nil + }, + UpdateContext: func(ctx context.Context, d *schema.ResourceData, i interface{}) diag.Diagnostics { + if d.Get("test") != nil { + computedSetBlockAttributeFunc(ctx, d, i) + } + return nil + }, + } + attrList := func(arr *[]string) cty.Value { if arr == nil { return cty.NullVal(cty.DynamicPseudoType) @@ -890,30 +1186,67 @@ func TestDetailedDiffSet(t *testing.T) { return cty.ListVal(slice) } - noForceNewSchemaValueMakerPairs := []struct { + nestedAttrListWithComputedSpecified := func(arr *[]string) cty.Value { + if arr == nil { + return cty.NullVal(cty.DynamicPseudoType) + } + + slice := make([]cty.Value, len(*arr)) + for i, v := range *arr { + slice[i] = cty.ObjectVal( + map[string]cty.Value{ + "nested": cty.StringVal(v), + "computed": cty.StringVal("non-computed-" + v), + }, + ) + } + if len(slice) == 0 { + return cty.ListValEmpty(cty.Object(map[string]cty.Type{ + "nested": cty.String, + "computed": cty.String, + })) + } + return cty.ListVal(slice) + } + + type schemaValueMakerPair struct { name string res schema.Resource valueMaker func(*[]string) cty.Value - }{ + } + + type testScenario struct { + name string + initialValue *[]string + changeValue *[]string + } + + noForceNewSchemaValueMakerPairs := []schemaValueMakerPair{ {"attribute no force new", attributeSchema, attrList}, {"block no force new", blockSchema, nestedAttrList}, + {"computed attribute no force new", computedAttributeSchema, attrList}, + {"block with computed no replace", blockSchemaComputed, nestedAttrList}, + {"block with computed no replace computed specified in program", blockSchemaComputed, nestedAttrListWithComputedSpecified}, + {"block with nested computed no replace", blockSchemaNestedComputed, nestedAttrList}, + {"block with nested computed no replace computed specified in program", blockSchemaNestedComputed, nestedAttrListWithComputedSpecified}, } - forceNewSchemaValueMakerPairs := []struct { - name string - res schema.Resource - valueMaker func(*[]string) cty.Value - }{ + forceNewSchemaValueMakerPairs := []schemaValueMakerPair{ {"attribute force new", attributeSchemaForceNew, attrList}, {"block top level force new", blockSchemaForceNew, nestedAttrList}, {"block nested force new", blockSchemaNestedForceNew, nestedAttrList}, + {"computed attribute force new", computedAttributeSchemaForceNew, attrList}, + {"block with computed force new", blockSchemaComputedForceNew, nestedAttrList}, + {"block with computed force new computed specified in program", blockSchemaComputedForceNew, nestedAttrListWithComputedSpecified}, + {"block with computed and nested force new", blockSchemaComputedNestedForceNew, nestedAttrList}, + {"block with computed and nested force new computed specified in program", blockSchemaComputedNestedForceNew, nestedAttrListWithComputedSpecified}, + {"block with nested computed and force new", blockSchemaNestedComputedForceNew, nestedAttrList}, + {"block with nested computed and force new computed specified in program", blockSchemaNestedComputedForceNew, nestedAttrListWithComputedSpecified}, + {"block with nested computed and nested force new", blockSchemaNestedComputedNestedForceNew, nestedAttrList}, + {"block with nested computed and nested force new computed specified in program", blockSchemaNestedComputedNestedForceNew, nestedAttrListWithComputedSpecified}, } - scenarios := []struct { - name string - initialValue *[]string - changeValue *[]string - }{ + scenarios := []testScenario{ {"unchanged non-empty", &[]string{"value"}, &[]string{"value"}}, {"unchanged empty", &[]string{}, &[]string{}}, {"unchanged null", nil, nil}, @@ -941,8 +1274,6 @@ func TestDetailedDiffSet(t *testing.T) { {"added end", &[]string{"val1", "val2"}, &[]string{"val1", "val2", "val3"}}, {"added end unordered", &[]string{"val2", "val3"}, &[]string{"val2", "val3", "val1"}}, - {"same element updated", &[]string{"val1", "val2", "val3"}, &[]string{"val1", "val4", "val3"}}, - {"shuffled", &[]string{"val1", "val2", "val3"}, &[]string{"val3", "val1", "val2"}}, {"shuffled unordered", &[]string{"val2", "val3", "val1"}, &[]string{"val3", "val1", "val2"}}, {"shuffled with duplicates", &[]string{"val1", "val2", "val3"}, &[]string{"val3", "val1", "val2", "val3"}}, @@ -962,11 +1293,8 @@ func TestDetailedDiffSet(t *testing.T) { // TODO[pulumi/pulumi-terraform-bridge#2726]: These tests fail to produce the correct replacement plan // for the force new shcemas - extraScenarios := []struct { - name string - initialValue *[]string - changeValue *[]string - }{ + extraScenarios := []testScenario{ + {"same element updated", &[]string{"val1", "val2", "val3"}, &[]string{"val1", "val4", "val3"}}, {"same element updated unordered", &[]string{"val2", "val3", "val1"}, &[]string{"val2", "val4", "val1"}}, {"two added and two removed", &[]string{"val1", "val2", "val3", "val4"}, &[]string{"val1", "val2", "val5", "val6"}}, {"two added and two removed shuffled, one overlaps", &[]string{"val1", "val2", "val3", "val4"}, &[]string{"val1", "val5", "val6", "val2"}}, diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added.golden new file mode 100644 index 000000000..94f5561c4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added.golden @@ -0,0 +1,40 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{"value"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = (known after apply) + + nested = "value" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_end.golden new file mode 100644 index 000000000..61e7023f4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_end.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_end_unordered.golden new file mode 100644 index 000000000..39107993f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_end_unordered.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val2" + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_front.golden new file mode 100644 index 000000000..3a2d9fcbb --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_front.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val1" + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_front_unordered.golden new file mode 100644 index 000000000..4f04f29e8 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_front_unordered.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_middle.golden new file mode 100644 index 000000000..d91143690 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_middle.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_middle_unordered.golden new file mode 100644 index 000000000..bdac10688 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_middle_unordered.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_empty_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_empty_to_null.golden new file mode 100644 index 000000000..7bae19762 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_empty_to_null.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_non-null.golden new file mode 100644 index 000000000..3c61d1ead --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_non-null.golden @@ -0,0 +1,49 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value1"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "value" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "value1" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "value" => "value1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_non-null_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_non-null_to_null.golden new file mode 100644 index 000000000..eff89843a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_non-null_to_null.golden @@ -0,0 +1,17 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_null_to_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_null_to_empty.golden new file mode 100644 index 000000000..9589fbdf0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_null_to_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_null_to_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_null_to_non-null.golden new file mode 100644 index 000000000..7e7fdd2f0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_null_to_non-null.golden @@ -0,0 +1,41 @@ +tests.testOutput{ + changeValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = (known after apply) + + nested = "value" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed.golden new file mode 100644 index 000000000..b67f5c3e1 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_end.golden new file mode 100644 index 000000000..49a453315 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_end.golden @@ -0,0 +1,72 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_end_unordered.golden new file mode 100644 index 000000000..11c25ea19 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_end_unordered.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val2" + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_front.golden new file mode 100644 index 000000000..7e9debb9f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_front.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val2" + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_front_unordered.golden new file mode 100644 index 000000000..b60d9fea3 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_front_unordered.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_middle.golden new file mode 100644 index 000000000..9c5e259b8 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_middle.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_middle_unordered.golden new file mode 100644 index 000000000..41194735b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_middle_unordered.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + "val2", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled.golden new file mode 100644 index 000000000..b22444299 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_added_end.golden new file mode 100644 index 000000000..f4a3a017d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_added_end.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val2", + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_added_front.golden new file mode 100644 index 000000000..220ae1848 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_added_front.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val1" + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_added_middle.golden new file mode 100644 index 000000000..371fbf7e5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_added_middle.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_removed_end.golden new file mode 100644 index 000000000..8bc2fbdd1 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_removed_end.golden @@ -0,0 +1,72 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_removed_front.golden new file mode 100644 index 000000000..5fc7ca733 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_removed_front.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val3" + } + ~ [1]: { + ~ nested : "val2" => "val2" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_removed_middle.golden new file mode 100644 index 000000000..a9a784238 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_removed_middle.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_unordered.golden new file mode 100644 index 000000000..d98c38179 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_unordered.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_with_duplicates.golden new file mode 100644 index 000000000..09d74fe9c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_with_duplicates.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_with_duplicates_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_with_duplicates_unordered.golden new file mode 100644 index 000000000..1011e92c5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_with_duplicates_unordered.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/two_added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/two_added.golden new file mode 100644 index 000000000..127e90847 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/two_added.golden @@ -0,0 +1,80 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val4" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + + [3]: { + + nested : "val4" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/two_removed.golden new file mode 100644 index 000000000..b6f28b466 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/two_removed.golden @@ -0,0 +1,82 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val4" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + - [3]: { + - computed: "" + - nested : "val4" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/unchanged_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/unchanged_empty.golden new file mode 100644 index 000000000..7d07227be --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/unchanged_non-empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/unchanged_non-empty.golden new file mode 100644 index 000000000..a87f03643 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/unchanged_non-empty.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value"}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/unchanged_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/unchanged_null.golden new file mode 100644 index 000000000..a53fac34d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/unchanged_null.golden @@ -0,0 +1,11 @@ +tests.testOutput{tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added.golden new file mode 100644 index 000000000..1de9875a9 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added.golden @@ -0,0 +1,41 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{"value"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-value" + + nested = "value" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + computed : "non-computed-value" + + nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_end.golden new file mode 100644 index 000000000..9c1af455d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_end_unordered.golden new file mode 100644 index 000000000..5ab2ae62b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_end_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_front.golden new file mode 100644 index 000000000..24ebf3720 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_front_unordered.golden new file mode 100644 index 000000000..46e0f566a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_front_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_middle.golden new file mode 100644 index 000000000..cb91ff477 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_middle_unordered.golden new file mode 100644 index 000000000..b773be160 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_middle_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_empty_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_empty_to_null.golden new file mode 100644 index 000000000..7bae19762 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_empty_to_null.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_non-null.golden new file mode 100644 index 000000000..3d40302c3 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_non-null.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value1"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-value" -> null + - nested = "value" -> null + } + + test { # forces replacement + + computed = "non-computed-value1" + + nested = "value1" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ computed: "non-computed-value" => "non-computed-value1" + ~ nested : "value" => "value1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_non-null_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_non-null_to_null.golden new file mode 100644 index 000000000..eff89843a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_non-null_to_null.golden @@ -0,0 +1,17 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_null_to_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_null_to_empty.golden new file mode 100644 index 000000000..9589fbdf0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_null_to_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_null_to_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_null_to_non-null.golden new file mode 100644 index 000000000..e2326c566 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_null_to_non-null.golden @@ -0,0 +1,42 @@ +tests.testOutput{ + changeValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-value" + + nested = "value" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + computed : "non-computed-value" + + nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed.golden new file mode 100644 index 000000000..b67f5c3e1 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_end.golden new file mode 100644 index 000000000..27b631a62 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_end_unordered.golden new file mode 100644 index 000000000..87c9ced14 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_end_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_front.golden new file mode 100644 index 000000000..74c0f7468 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_front_unordered.golden new file mode 100644 index 000000000..d83c330b0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_front_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_middle.golden new file mode 100644 index 000000000..7b3e9ce15 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_middle_unordered.golden new file mode 100644 index 000000000..8e95109d1 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_middle_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + "val2", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled.golden new file mode 100644 index 000000000..b22444299 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_end.golden new file mode 100644 index 000000000..cf125372c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val2", + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_front.golden new file mode 100644 index 000000000..c8d7a3a0f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_middle.golden new file mode 100644 index 000000000..373c6cff9 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_end.golden new file mode 100644 index 000000000..9ec766ae5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_front.golden new file mode 100644 index 000000000..1a4103a07 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_middle.golden new file mode 100644 index 000000000..40b9ff67a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_unordered.golden new file mode 100644 index 000000000..d98c38179 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_unordered.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_with_duplicates.golden new file mode 100644 index 000000000..09d74fe9c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_with_duplicates.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_with_duplicates_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_with_duplicates_unordered.golden new file mode 100644 index 000000000..1011e92c5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_with_duplicates_unordered.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/two_added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/two_added.golden new file mode 100644 index 000000000..353e54999 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/two_added.golden @@ -0,0 +1,62 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val3" + + nested = "val3" + } + + test { # forces replacement + + computed = "non-computed-val4" + + nested = "val4" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + + [3]: { + + computed : "non-computed-val4" + + nested : "val4" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/two_removed.golden new file mode 100644 index 000000000..fa8851ce6 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/two_removed.golden @@ -0,0 +1,62 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + - test { # forces replacement + - computed = "non-computed-val4" -> null + - nested = "val4" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + - [3]: { + - computed: "non-computed-val4" + - nested : "val4" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/unchanged_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/unchanged_empty.golden new file mode 100644 index 000000000..7d07227be --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/unchanged_non-empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/unchanged_non-empty.golden new file mode 100644 index 000000000..a87f03643 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/unchanged_non-empty.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value"}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/unchanged_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/unchanged_null.golden new file mode 100644 index 000000000..a53fac34d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/unchanged_null.golden @@ -0,0 +1,11 @@ +tests.testOutput{tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added.golden new file mode 100644 index 000000000..94f5561c4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added.golden @@ -0,0 +1,40 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{"value"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = (known after apply) + + nested = "value" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_end.golden new file mode 100644 index 000000000..61e7023f4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_end.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_end_unordered.golden new file mode 100644 index 000000000..4a6c7975f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_end_unordered.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val2" + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_front.golden new file mode 100644 index 000000000..6c3c3e039 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_front.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val1" + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_front_unordered.golden new file mode 100644 index 000000000..a2a38aeba --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_front_unordered.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_middle.golden new file mode 100644 index 000000000..23cedb220 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_middle.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_middle_unordered.golden new file mode 100644 index 000000000..bdac10688 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_middle_unordered.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_empty_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_empty_to_null.golden new file mode 100644 index 000000000..7bae19762 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_empty_to_null.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_non-null.golden new file mode 100644 index 000000000..0170773e4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_non-null.golden @@ -0,0 +1,49 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value1"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "value" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "value1" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "value" => "value1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_non-null_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_non-null_to_null.golden new file mode 100644 index 000000000..eff89843a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_non-null_to_null.golden @@ -0,0 +1,17 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_null_to_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_null_to_empty.golden new file mode 100644 index 000000000..9589fbdf0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_null_to_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_null_to_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_null_to_non-null.golden new file mode 100644 index 000000000..7e7fdd2f0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_null_to_non-null.golden @@ -0,0 +1,41 @@ +tests.testOutput{ + changeValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = (known after apply) + + nested = "value" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed.golden new file mode 100644 index 000000000..b67f5c3e1 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_end.golden new file mode 100644 index 000000000..49a453315 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_end.golden @@ -0,0 +1,72 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_end_unordered.golden new file mode 100644 index 000000000..27a71d3d4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_end_unordered.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val2" + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_front.golden new file mode 100644 index 000000000..f90856167 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_front.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val2" + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_front_unordered.golden new file mode 100644 index 000000000..57799de1f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_front_unordered.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_middle.golden new file mode 100644 index 000000000..648c2e19c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_middle.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_middle_unordered.golden new file mode 100644 index 000000000..f89fa4b2b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_middle_unordered.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + "val2", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled.golden new file mode 100644 index 000000000..b22444299 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_added_end.golden new file mode 100644 index 000000000..f4a3a017d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_added_end.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val2", + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_added_front.golden new file mode 100644 index 000000000..b93394a26 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_added_front.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val1" + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_added_middle.golden new file mode 100644 index 000000000..0f251e5b6 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_added_middle.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_removed_end.golden new file mode 100644 index 000000000..8bc2fbdd1 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_removed_end.golden @@ -0,0 +1,72 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_removed_front.golden new file mode 100644 index 000000000..1930e4f5c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_removed_front.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val3" + } + ~ [1]: { + ~ nested : "val2" => "val2" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_removed_middle.golden new file mode 100644 index 000000000..0f33d25b0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_removed_middle.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_unordered.golden new file mode 100644 index 000000000..d98c38179 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_unordered.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_with_duplicates.golden new file mode 100644 index 000000000..09d74fe9c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_with_duplicates.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_with_duplicates_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_with_duplicates_unordered.golden new file mode 100644 index 000000000..1011e92c5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_with_duplicates_unordered.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/two_added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/two_added.golden new file mode 100644 index 000000000..127e90847 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/two_added.golden @@ -0,0 +1,80 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val4" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + + [3]: { + + nested : "val4" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/two_removed.golden new file mode 100644 index 000000000..b6f28b466 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/two_removed.golden @@ -0,0 +1,82 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val4" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + - [3]: { + - computed: "" + - nested : "val4" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/unchanged_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/unchanged_empty.golden new file mode 100644 index 000000000..7d07227be --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/unchanged_non-empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/unchanged_non-empty.golden new file mode 100644 index 000000000..a87f03643 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/unchanged_non-empty.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value"}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/unchanged_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/unchanged_null.golden new file mode 100644 index 000000000..a53fac34d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/unchanged_null.golden @@ -0,0 +1,11 @@ +tests.testOutput{tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added.golden new file mode 100644 index 000000000..1de9875a9 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added.golden @@ -0,0 +1,41 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{"value"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-value" + + nested = "value" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + computed : "non-computed-value" + + nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_end.golden new file mode 100644 index 000000000..9c1af455d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_end_unordered.golden new file mode 100644 index 000000000..5ab2ae62b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_end_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_front.golden new file mode 100644 index 000000000..24ebf3720 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_front_unordered.golden new file mode 100644 index 000000000..46e0f566a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_front_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_middle.golden new file mode 100644 index 000000000..cb91ff477 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_middle_unordered.golden new file mode 100644 index 000000000..b773be160 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_middle_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_empty_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_empty_to_null.golden new file mode 100644 index 000000000..7bae19762 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_empty_to_null.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_non-null.golden new file mode 100644 index 000000000..89c888348 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_non-null.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value1"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-value" -> null + - nested = "value" -> null + } + + test { + + computed = "non-computed-value1" + + nested = "value1" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ computed: "non-computed-value" => "non-computed-value1" + ~ nested : "value" => "value1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_non-null_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_non-null_to_null.golden new file mode 100644 index 000000000..eff89843a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_non-null_to_null.golden @@ -0,0 +1,17 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_null_to_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_null_to_empty.golden new file mode 100644 index 000000000..9589fbdf0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_null_to_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_null_to_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_null_to_non-null.golden new file mode 100644 index 000000000..e2326c566 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_null_to_non-null.golden @@ -0,0 +1,42 @@ +tests.testOutput{ + changeValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-value" + + nested = "value" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + computed : "non-computed-value" + + nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed.golden new file mode 100644 index 000000000..b67f5c3e1 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_end.golden new file mode 100644 index 000000000..27b631a62 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_end_unordered.golden new file mode 100644 index 000000000..87c9ced14 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_end_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_front.golden new file mode 100644 index 000000000..74c0f7468 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_front_unordered.golden new file mode 100644 index 000000000..d83c330b0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_front_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_middle.golden new file mode 100644 index 000000000..7b3e9ce15 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_middle_unordered.golden new file mode 100644 index 000000000..8e95109d1 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_middle_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + "val2", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled.golden new file mode 100644 index 000000000..b22444299 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_added_end.golden new file mode 100644 index 000000000..cf125372c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_added_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val2", + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_added_front.golden new file mode 100644 index 000000000..c8d7a3a0f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_added_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_added_middle.golden new file mode 100644 index 000000000..373c6cff9 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_added_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_removed_end.golden new file mode 100644 index 000000000..9ec766ae5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_removed_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_removed_front.golden new file mode 100644 index 000000000..1a4103a07 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_removed_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_removed_middle.golden new file mode 100644 index 000000000..40b9ff67a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_removed_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_unordered.golden new file mode 100644 index 000000000..d98c38179 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_unordered.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_with_duplicates.golden new file mode 100644 index 000000000..09d74fe9c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_with_duplicates.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_with_duplicates_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_with_duplicates_unordered.golden new file mode 100644 index 000000000..1011e92c5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_with_duplicates_unordered.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/two_added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/two_added.golden new file mode 100644 index 000000000..353e54999 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/two_added.golden @@ -0,0 +1,62 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val3" + + nested = "val3" + } + + test { # forces replacement + + computed = "non-computed-val4" + + nested = "val4" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + + [3]: { + + computed : "non-computed-val4" + + nested : "val4" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/two_removed.golden new file mode 100644 index 000000000..fa8851ce6 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/two_removed.golden @@ -0,0 +1,62 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + - test { # forces replacement + - computed = "non-computed-val4" -> null + - nested = "val4" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + - [3]: { + - computed: "non-computed-val4" + - nested : "val4" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/unchanged_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/unchanged_empty.golden new file mode 100644 index 000000000..7d07227be --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/unchanged_non-empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/unchanged_non-empty.golden new file mode 100644 index 000000000..a87f03643 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/unchanged_non-empty.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value"}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/unchanged_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/unchanged_null.golden new file mode 100644 index 000000000..a53fac34d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/unchanged_null.golden @@ -0,0 +1,11 @@ +tests.testOutput{tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added.golden new file mode 100644 index 000000000..8a0de2272 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added.golden @@ -0,0 +1,40 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{"value"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = (known after apply) + + nested = "value" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + nested : "value" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_end.golden new file mode 100644 index 000000000..f16128f51 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_end.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_end_unordered.golden new file mode 100644 index 000000000..9eee2d69d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_end_unordered.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val2" + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_front.golden new file mode 100644 index 000000000..1ee158309 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_front.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val1" + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_front_unordered.golden new file mode 100644 index 000000000..a81fe2957 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_front_unordered.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_middle.golden new file mode 100644 index 000000000..be8c5fc65 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_middle.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_middle_unordered.golden new file mode 100644 index 000000000..e18bd28d0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_middle_unordered.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_empty_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_empty_to_null.golden new file mode 100644 index 000000000..7bae19762 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_empty_to_null.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_non-null.golden new file mode 100644 index 000000000..0170773e4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_non-null.golden @@ -0,0 +1,49 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value1"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "value" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "value1" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "value" => "value1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_non-null_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_non-null_to_null.golden new file mode 100644 index 000000000..eff89843a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_non-null_to_null.golden @@ -0,0 +1,17 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_null_to_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_null_to_empty.golden new file mode 100644 index 000000000..9589fbdf0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_null_to_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_null_to_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_null_to_non-null.golden new file mode 100644 index 000000000..2672c4e43 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_null_to_non-null.golden @@ -0,0 +1,41 @@ +tests.testOutput{ + changeValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = (known after apply) + + nested = "value" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + nested : "value" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed.golden new file mode 100644 index 000000000..b67f5c3e1 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_end.golden new file mode 100644 index 000000000..cb5cf4ece --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_end.golden @@ -0,0 +1,72 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_end_unordered.golden new file mode 100644 index 000000000..899c8114b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_end_unordered.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val2" + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_front.golden new file mode 100644 index 000000000..f3b02f42d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_front.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val2" + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_front_unordered.golden new file mode 100644 index 000000000..16a35f8b6 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_front_unordered.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_middle.golden new file mode 100644 index 000000000..d799448f4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_middle.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_middle_unordered.golden new file mode 100644 index 000000000..dabc5aebc --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_middle_unordered.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + "val2", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/same_element_updated.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/same_element_updated.golden new file mode 100644 index 000000000..9b8aa8b52 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/same_element_updated.golden @@ -0,0 +1,79 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val4", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + + test { + + computed = (known after apply) + + nested = "val4" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val4" + } + ~ [2]: { + ~ nested : "val3" => "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/same_element_updated_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/same_element_updated_unordered.golden new file mode 100644 index 000000000..be19e29c7 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/same_element_updated_unordered.golden @@ -0,0 +1,77 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val4", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val4" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + ~ [2]: { + ~ nested : "val3" => "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled.golden new file mode 100644 index 000000000..b22444299 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_added_end.golden new file mode 100644 index 000000000..83564177f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_added_end.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val2", + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_added_front.golden new file mode 100644 index 000000000..8b796bce2 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_added_front.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val1" + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_added_middle.golden new file mode 100644 index 000000000..43f337249 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_added_middle.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_removed_end.golden new file mode 100644 index 000000000..39a220517 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_removed_end.golden @@ -0,0 +1,72 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_removed_front.golden new file mode 100644 index 000000000..acb278d4c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_removed_front.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val3" + } + ~ [1]: { + ~ nested : "val2" => "val2" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_removed_middle.golden new file mode 100644 index 000000000..323e01ff9 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_removed_middle.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_unordered.golden new file mode 100644 index 000000000..d98c38179 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_unordered.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_with_duplicates.golden new file mode 100644 index 000000000..09d74fe9c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_with_duplicates.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_with_duplicates_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_with_duplicates_unordered.golden new file mode 100644 index 000000000..1011e92c5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_with_duplicates_unordered.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added.golden new file mode 100644 index 000000000..1637ef233 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added.golden @@ -0,0 +1,80 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + + test { + + computed = (known after apply) + + nested = "val4" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + + [3]: { + + nested : "val4" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + "tests[3]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added_and_two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added_and_two_removed.golden new file mode 100644 index 000000000..78e89cb3f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added_and_two_removed.golden @@ -0,0 +1,92 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + "val5", + "val6", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val4" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val5" + } + + test { + + computed = (known after apply) + + nested = "val6" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + ~ [2]: { + ~ nested : "val3" => "val5" + } + ~ [3]: { + ~ nested : "val4" => "val6" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added_and_two_removed_shuffled,_no_overlaps.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added_and_two_removed_shuffled,_no_overlaps.golden new file mode 100644 index 000000000..9f1fdbf0b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added_and_two_removed_shuffled,_no_overlaps.golden @@ -0,0 +1,92 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val5", + "val6", + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val4" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val5" + } + + test { + + computed = (known after apply) + + nested = "val6" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + ~ [2]: { + ~ nested : "val3" => "val1" + } + ~ [3]: { + ~ nested : "val4" => "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added_and_two_removed_shuffled,_one_overlaps.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added_and_two_removed_shuffled,_one_overlaps.golden new file mode 100644 index 000000000..09c91c9a5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added_and_two_removed_shuffled,_one_overlaps.golden @@ -0,0 +1,92 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val5", + "val6", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val4" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val5" + } + + test { + + computed = (known after apply) + + nested = "val6" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + ~ [2]: { + ~ nested : "val3" => "val6" + } + ~ [3]: { + ~ nested : "val4" => "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added_and_two_removed_shuffled,_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added_and_two_removed_shuffled,_with_duplicates.golden new file mode 100644 index 000000000..03a4d2a37 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added_and_two_removed_shuffled,_with_duplicates.golden @@ -0,0 +1,94 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val5", + "val6", + "val2", + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val4" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val5" + } + + test { + + computed = (known after apply) + + nested = "val6" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + ~ [2]: { + ~ nested : "val3" => "val6" + } + ~ [3]: { + ~ nested : "val4" => "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_removed.golden new file mode 100644 index 000000000..6677548c8 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_removed.golden @@ -0,0 +1,82 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val4" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + - [3]: { + - computed: "" + - nested : "val4" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + "tests[3]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/unchanged_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/unchanged_empty.golden new file mode 100644 index 000000000..7d07227be --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/unchanged_non-empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/unchanged_non-empty.golden new file mode 100644 index 000000000..a87f03643 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/unchanged_non-empty.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value"}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/unchanged_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/unchanged_null.golden new file mode 100644 index 000000000..a53fac34d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/unchanged_null.golden @@ -0,0 +1,11 @@ +tests.testOutput{tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added.golden new file mode 100644 index 000000000..9c107c39e --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added.golden @@ -0,0 +1,41 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{"value"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-value" + + nested = "value" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + computed : "non-computed-value" + + nested : "value" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_end.golden new file mode 100644 index 000000000..66fbc1c2d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_end_unordered.golden new file mode 100644 index 000000000..b1236f090 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_end_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_front.golden new file mode 100644 index 000000000..9a8683764 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_front_unordered.golden new file mode 100644 index 000000000..33112977a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_front_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_middle.golden new file mode 100644 index 000000000..3fa147fc4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_middle_unordered.golden new file mode 100644 index 000000000..bb02e047a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_middle_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_empty_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_empty_to_null.golden new file mode 100644 index 000000000..7bae19762 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_empty_to_null.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_non-null.golden new file mode 100644 index 000000000..89c888348 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_non-null.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value1"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-value" -> null + - nested = "value" -> null + } + + test { + + computed = "non-computed-value1" + + nested = "value1" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ computed: "non-computed-value" => "non-computed-value1" + ~ nested : "value" => "value1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_non-null_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_non-null_to_null.golden new file mode 100644 index 000000000..eff89843a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_non-null_to_null.golden @@ -0,0 +1,17 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_null_to_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_null_to_empty.golden new file mode 100644 index 000000000..9589fbdf0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_null_to_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_null_to_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_null_to_non-null.golden new file mode 100644 index 000000000..238c8dba3 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_null_to_non-null.golden @@ -0,0 +1,42 @@ +tests.testOutput{ + changeValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-value" + + nested = "value" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + computed : "non-computed-value" + + nested : "value" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed.golden new file mode 100644 index 000000000..b67f5c3e1 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_end.golden new file mode 100644 index 000000000..101d829f4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_end_unordered.golden new file mode 100644 index 000000000..d3921213c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_end_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_front.golden new file mode 100644 index 000000000..95cec62f9 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_front_unordered.golden new file mode 100644 index 000000000..4ce1bb1bb --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_front_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_middle.golden new file mode 100644 index 000000000..e27759e65 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_middle_unordered.golden new file mode 100644 index 000000000..71aca2ff6 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_middle_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + "val2", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/same_element_updated.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/same_element_updated.golden new file mode 100644 index 000000000..096344412 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/same_element_updated.golden @@ -0,0 +1,62 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val4", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + test { + + computed = "non-computed-val4" + + nested = "val4" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[1]": map[string]interface{}{"kind": "DELETE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/same_element_updated_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/same_element_updated_unordered.golden new file mode 100644 index 000000000..855997ff7 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/same_element_updated_unordered.golden @@ -0,0 +1,58 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val4", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + + test { + + computed = "non-computed-val4" + + nested = "val4" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [2]: { + ~ computed: "non-computed-val3" => "non-computed-val1" + ~ nested : "val3" => "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled.golden new file mode 100644 index 000000000..b22444299 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_added_end.golden new file mode 100644 index 000000000..ae58b0bcc --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_added_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val2", + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_added_front.golden new file mode 100644 index 000000000..c73db179d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_added_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_added_middle.golden new file mode 100644 index 000000000..ccd82694b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_added_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_removed_end.golden new file mode 100644 index 000000000..8741a83c6 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_removed_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_removed_front.golden new file mode 100644 index 000000000..e0d9d13c4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_removed_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_removed_middle.golden new file mode 100644 index 000000000..19dd48fb4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_removed_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_unordered.golden new file mode 100644 index 000000000..d98c38179 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_unordered.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_with_duplicates.golden new file mode 100644 index 000000000..09d74fe9c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_with_duplicates.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_with_duplicates_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_with_duplicates_unordered.golden new file mode 100644 index 000000000..1011e92c5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_with_duplicates_unordered.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added.golden new file mode 100644 index 000000000..e43424e12 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added.golden @@ -0,0 +1,62 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val3" + + nested = "val3" + } + + test { + + computed = "non-computed-val4" + + nested = "val4" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + + [3]: { + + computed : "non-computed-val4" + + nested : "val4" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{}, + "tests[3]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added_and_two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added_and_two_removed.golden new file mode 100644 index 000000000..fc533b2c3 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added_and_two_removed.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + "val5", + "val6", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + - test { + - computed = "non-computed-val4" -> null + - nested = "val4" -> null + } + + test { + + computed = "non-computed-val5" + + nested = "val5" + } + + test { + + computed = "non-computed-val6" + + nested = "val6" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [2]: { + ~ computed: "non-computed-val3" => "non-computed-val5" + ~ nested : "val3" => "val5" + } + ~ [3]: { + ~ computed: "non-computed-val4" => "non-computed-val6" + ~ nested : "val4" => "val6" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_no_overlaps.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_no_overlaps.golden new file mode 100644 index 000000000..91b3776e3 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_no_overlaps.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val5", + "val6", + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + - test { + - computed = "non-computed-val4" -> null + - nested = "val4" -> null + } + + test { + + computed = "non-computed-val5" + + nested = "val5" + } + + test { + + computed = "non-computed-val6" + + nested = "val6" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [2]: { + ~ computed: "non-computed-val3" => "non-computed-val1" + ~ nested : "val3" => "val1" + } + ~ [3]: { + ~ computed: "non-computed-val4" => "non-computed-val2" + ~ nested : "val4" => "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_one_overlaps.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_one_overlaps.golden new file mode 100644 index 000000000..872a2178d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_one_overlaps.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val5", + "val6", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + - test { + - computed = "non-computed-val4" -> null + - nested = "val4" -> null + } + + test { + + computed = "non-computed-val5" + + nested = "val5" + } + + test { + + computed = "non-computed-val6" + + nested = "val6" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [2]: { + ~ computed: "non-computed-val3" => "non-computed-val6" + ~ nested : "val3" => "val6" + } + ~ [3]: { + ~ computed: "non-computed-val4" => "non-computed-val2" + ~ nested : "val4" => "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_with_duplicates.golden new file mode 100644 index 000000000..82ff7cf7c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_with_duplicates.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val5", + "val6", + "val2", + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + - test { + - computed = "non-computed-val4" -> null + - nested = "val4" -> null + } + + test { + + computed = "non-computed-val5" + + nested = "val5" + } + + test { + + computed = "non-computed-val6" + + nested = "val6" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [2]: { + ~ computed: "non-computed-val3" => "non-computed-val6" + ~ nested : "val3" => "val6" + } + ~ [3]: { + ~ computed: "non-computed-val4" => "non-computed-val2" + ~ nested : "val4" => "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_removed.golden new file mode 100644 index 000000000..b811014c9 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_removed.golden @@ -0,0 +1,62 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + - test { + - computed = "non-computed-val4" -> null + - nested = "val4" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + - [3]: { + - computed: "non-computed-val4" + - nested : "val4" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + "tests[3]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/unchanged_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/unchanged_empty.golden new file mode 100644 index 000000000..7d07227be --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/unchanged_non-empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/unchanged_non-empty.golden new file mode 100644 index 000000000..a87f03643 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/unchanged_non-empty.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value"}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/unchanged_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/unchanged_null.golden new file mode 100644 index 000000000..a53fac34d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/unchanged_null.golden @@ -0,0 +1,11 @@ +tests.testOutput{tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added.golden new file mode 100644 index 000000000..94f5561c4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added.golden @@ -0,0 +1,40 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{"value"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = (known after apply) + + nested = "value" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_end.golden new file mode 100644 index 000000000..61e7023f4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_end.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_end_unordered.golden new file mode 100644 index 000000000..4a6c7975f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_end_unordered.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val2" + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_front.golden new file mode 100644 index 000000000..6c3c3e039 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_front.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val1" + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_front_unordered.golden new file mode 100644 index 000000000..a2a38aeba --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_front_unordered.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_middle.golden new file mode 100644 index 000000000..23cedb220 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_middle.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_middle_unordered.golden new file mode 100644 index 000000000..bdac10688 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_middle_unordered.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_empty_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_empty_to_null.golden new file mode 100644 index 000000000..7bae19762 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_empty_to_null.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_non-null.golden new file mode 100644 index 000000000..0170773e4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_non-null.golden @@ -0,0 +1,49 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value1"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "value" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "value1" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "value" => "value1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_non-null_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_non-null_to_null.golden new file mode 100644 index 000000000..5164e9405 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_non-null_to_null.golden @@ -0,0 +1,42 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "value" -> null + # (1 unchanged attribute hidden) + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - tests: [ + - [0]: { + - computed: "" + - nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_null_to_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_null_to_empty.golden new file mode 100644 index 000000000..9589fbdf0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_null_to_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_null_to_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_null_to_non-null.golden new file mode 100644 index 000000000..7e7fdd2f0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_null_to_non-null.golden @@ -0,0 +1,41 @@ +tests.testOutput{ + changeValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = (known after apply) + + nested = "value" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed.golden new file mode 100644 index 000000000..be31441b2 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed.golden @@ -0,0 +1,43 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "value" -> null + # (1 unchanged attribute hidden) + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - tests: [ + - [0]: { + - computed: "" + - nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_end.golden new file mode 100644 index 000000000..49a453315 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_end.golden @@ -0,0 +1,72 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_end_unordered.golden new file mode 100644 index 000000000..27a71d3d4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_end_unordered.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val2" + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_front.golden new file mode 100644 index 000000000..f90856167 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_front.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val2" + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_front_unordered.golden new file mode 100644 index 000000000..57799de1f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_front_unordered.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_middle.golden new file mode 100644 index 000000000..648c2e19c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_middle.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_middle_unordered.golden new file mode 100644 index 000000000..f89fa4b2b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_middle_unordered.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + "val2", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled.golden new file mode 100644 index 000000000..b22444299 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_added_end.golden new file mode 100644 index 000000000..f4a3a017d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_added_end.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val2", + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_added_front.golden new file mode 100644 index 000000000..b93394a26 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_added_front.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val1" + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_added_middle.golden new file mode 100644 index 000000000..0f251e5b6 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_added_middle.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_removed_end.golden new file mode 100644 index 000000000..8bc2fbdd1 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_removed_end.golden @@ -0,0 +1,72 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_removed_front.golden new file mode 100644 index 000000000..1930e4f5c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_removed_front.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val3" + } + ~ [1]: { + ~ nested : "val2" => "val2" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_removed_middle.golden new file mode 100644 index 000000000..0f33d25b0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_removed_middle.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_unordered.golden new file mode 100644 index 000000000..d98c38179 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_unordered.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_with_duplicates.golden new file mode 100644 index 000000000..09d74fe9c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_with_duplicates.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_with_duplicates_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_with_duplicates_unordered.golden new file mode 100644 index 000000000..1011e92c5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_with_duplicates_unordered.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/two_added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/two_added.golden new file mode 100644 index 000000000..127e90847 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/two_added.golden @@ -0,0 +1,80 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val4" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + + [3]: { + + nested : "val4" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/two_removed.golden new file mode 100644 index 000000000..b6f28b466 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/two_removed.golden @@ -0,0 +1,82 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val4" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + - [3]: { + - computed: "" + - nested : "val4" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/unchanged_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/unchanged_empty.golden new file mode 100644 index 000000000..7d07227be --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/unchanged_non-empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/unchanged_non-empty.golden new file mode 100644 index 000000000..a87f03643 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/unchanged_non-empty.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value"}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/unchanged_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/unchanged_null.golden new file mode 100644 index 000000000..a53fac34d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/unchanged_null.golden @@ -0,0 +1,11 @@ +tests.testOutput{tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added.golden new file mode 100644 index 000000000..1de9875a9 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added.golden @@ -0,0 +1,41 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{"value"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-value" + + nested = "value" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + computed : "non-computed-value" + + nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_end.golden new file mode 100644 index 000000000..9c1af455d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_end_unordered.golden new file mode 100644 index 000000000..5ab2ae62b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_end_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_front.golden new file mode 100644 index 000000000..24ebf3720 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_front_unordered.golden new file mode 100644 index 000000000..46e0f566a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_front_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_middle.golden new file mode 100644 index 000000000..cb91ff477 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_middle_unordered.golden new file mode 100644 index 000000000..b773be160 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_middle_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_empty_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_empty_to_null.golden new file mode 100644 index 000000000..7bae19762 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_empty_to_null.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_non-null.golden new file mode 100644 index 000000000..89c888348 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_non-null.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value1"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-value" -> null + - nested = "value" -> null + } + + test { + + computed = "non-computed-value1" + + nested = "value1" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ computed: "non-computed-value" => "non-computed-value1" + ~ nested : "value" => "value1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_non-null_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_non-null_to_null.golden new file mode 100644 index 000000000..e1cbce612 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_non-null_to_null.golden @@ -0,0 +1,42 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-value" -> null + - nested = "value" -> null + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - tests: [ + - [0]: { + - computed: "non-computed-value" + - nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_null_to_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_null_to_empty.golden new file mode 100644 index 000000000..9589fbdf0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_null_to_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_null_to_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_null_to_non-null.golden new file mode 100644 index 000000000..e2326c566 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_null_to_non-null.golden @@ -0,0 +1,42 @@ +tests.testOutput{ + changeValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-value" + + nested = "value" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + computed : "non-computed-value" + + nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed.golden new file mode 100644 index 000000000..ea57b6068 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed.golden @@ -0,0 +1,43 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-value" -> null + - nested = "value" -> null + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - tests: [ + - [0]: { + - computed: "non-computed-value" + - nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_end.golden new file mode 100644 index 000000000..27b631a62 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_end_unordered.golden new file mode 100644 index 000000000..87c9ced14 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_end_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_front.golden new file mode 100644 index 000000000..74c0f7468 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_front_unordered.golden new file mode 100644 index 000000000..d83c330b0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_front_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_middle.golden new file mode 100644 index 000000000..7b3e9ce15 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_middle_unordered.golden new file mode 100644 index 000000000..8e95109d1 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_middle_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + "val2", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled.golden new file mode 100644 index 000000000..b22444299 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_added_end.golden new file mode 100644 index 000000000..cf125372c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_added_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val2", + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_added_front.golden new file mode 100644 index 000000000..c8d7a3a0f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_added_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_added_middle.golden new file mode 100644 index 000000000..373c6cff9 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_added_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_removed_end.golden new file mode 100644 index 000000000..9ec766ae5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_removed_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_removed_front.golden new file mode 100644 index 000000000..1a4103a07 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_removed_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_removed_middle.golden new file mode 100644 index 000000000..40b9ff67a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_removed_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_unordered.golden new file mode 100644 index 000000000..d98c38179 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_unordered.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_with_duplicates.golden new file mode 100644 index 000000000..09d74fe9c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_with_duplicates.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_with_duplicates_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_with_duplicates_unordered.golden new file mode 100644 index 000000000..1011e92c5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_with_duplicates_unordered.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/two_added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/two_added.golden new file mode 100644 index 000000000..353e54999 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/two_added.golden @@ -0,0 +1,62 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val3" + + nested = "val3" + } + + test { # forces replacement + + computed = "non-computed-val4" + + nested = "val4" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + + [3]: { + + computed : "non-computed-val4" + + nested : "val4" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/two_removed.golden new file mode 100644 index 000000000..fa8851ce6 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/two_removed.golden @@ -0,0 +1,62 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + - test { # forces replacement + - computed = "non-computed-val4" -> null + - nested = "val4" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + - [3]: { + - computed: "non-computed-val4" + - nested : "val4" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/unchanged_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/unchanged_empty.golden new file mode 100644 index 000000000..7d07227be --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/unchanged_non-empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/unchanged_non-empty.golden new file mode 100644 index 000000000..a87f03643 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/unchanged_non-empty.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value"}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/unchanged_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/unchanged_null.golden new file mode 100644 index 000000000..a53fac34d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/unchanged_null.golden @@ -0,0 +1,11 @@ +tests.testOutput{tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added.golden new file mode 100644 index 000000000..94f5561c4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added.golden @@ -0,0 +1,40 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{"value"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = (known after apply) + + nested = "value" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_end.golden new file mode 100644 index 000000000..61e7023f4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_end.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_end_unordered.golden new file mode 100644 index 000000000..39107993f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_end_unordered.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val2" + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_front.golden new file mode 100644 index 000000000..3a2d9fcbb --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_front.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val1" + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_front_unordered.golden new file mode 100644 index 000000000..4f04f29e8 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_front_unordered.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_middle.golden new file mode 100644 index 000000000..d91143690 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_middle.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_middle_unordered.golden new file mode 100644 index 000000000..bdac10688 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_middle_unordered.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_empty_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_empty_to_null.golden new file mode 100644 index 000000000..7bae19762 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_empty_to_null.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_non-null.golden new file mode 100644 index 000000000..3c61d1ead --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_non-null.golden @@ -0,0 +1,49 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value1"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "value" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "value1" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "value" => "value1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_non-null_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_non-null_to_null.golden new file mode 100644 index 000000000..5164e9405 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_non-null_to_null.golden @@ -0,0 +1,42 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "value" -> null + # (1 unchanged attribute hidden) + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - tests: [ + - [0]: { + - computed: "" + - nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_null_to_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_null_to_empty.golden new file mode 100644 index 000000000..9589fbdf0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_null_to_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_null_to_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_null_to_non-null.golden new file mode 100644 index 000000000..7e7fdd2f0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_null_to_non-null.golden @@ -0,0 +1,41 @@ +tests.testOutput{ + changeValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = (known after apply) + + nested = "value" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed.golden new file mode 100644 index 000000000..be31441b2 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed.golden @@ -0,0 +1,43 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "value" -> null + # (1 unchanged attribute hidden) + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - tests: [ + - [0]: { + - computed: "" + - nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_end.golden new file mode 100644 index 000000000..49a453315 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_end.golden @@ -0,0 +1,72 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_end_unordered.golden new file mode 100644 index 000000000..11c25ea19 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_end_unordered.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val2" + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_front.golden new file mode 100644 index 000000000..7e9debb9f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_front.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val2" + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_front_unordered.golden new file mode 100644 index 000000000..b60d9fea3 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_front_unordered.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_middle.golden new file mode 100644 index 000000000..9c5e259b8 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_middle.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_middle_unordered.golden new file mode 100644 index 000000000..41194735b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_middle_unordered.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + "val2", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled.golden new file mode 100644 index 000000000..b22444299 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_added_end.golden new file mode 100644 index 000000000..f4a3a017d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_added_end.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val2", + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_added_front.golden new file mode 100644 index 000000000..220ae1848 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_added_front.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val1" + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_added_middle.golden new file mode 100644 index 000000000..371fbf7e5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_added_middle.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_removed_end.golden new file mode 100644 index 000000000..8bc2fbdd1 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_removed_end.golden @@ -0,0 +1,72 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_removed_front.golden new file mode 100644 index 000000000..5fc7ca733 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_removed_front.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val3" + } + ~ [1]: { + ~ nested : "val2" => "val2" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_removed_middle.golden new file mode 100644 index 000000000..a9a784238 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_removed_middle.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_unordered.golden new file mode 100644 index 000000000..d98c38179 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_unordered.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_with_duplicates.golden new file mode 100644 index 000000000..09d74fe9c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_with_duplicates.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_with_duplicates_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_with_duplicates_unordered.golden new file mode 100644 index 000000000..1011e92c5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_with_duplicates_unordered.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/two_added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/two_added.golden new file mode 100644 index 000000000..127e90847 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/two_added.golden @@ -0,0 +1,80 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val4" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + + [3]: { + + nested : "val4" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/two_removed.golden new file mode 100644 index 000000000..b6f28b466 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/two_removed.golden @@ -0,0 +1,82 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val4" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + - [3]: { + - computed: "" + - nested : "val4" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/unchanged_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/unchanged_empty.golden new file mode 100644 index 000000000..7d07227be --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/unchanged_non-empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/unchanged_non-empty.golden new file mode 100644 index 000000000..a87f03643 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/unchanged_non-empty.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value"}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/unchanged_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/unchanged_null.golden new file mode 100644 index 000000000..a53fac34d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/unchanged_null.golden @@ -0,0 +1,11 @@ +tests.testOutput{tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added.golden new file mode 100644 index 000000000..1de9875a9 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added.golden @@ -0,0 +1,41 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{"value"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-value" + + nested = "value" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + computed : "non-computed-value" + + nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_end.golden new file mode 100644 index 000000000..9c1af455d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_end_unordered.golden new file mode 100644 index 000000000..5ab2ae62b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_end_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_front.golden new file mode 100644 index 000000000..24ebf3720 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_front_unordered.golden new file mode 100644 index 000000000..46e0f566a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_front_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_middle.golden new file mode 100644 index 000000000..cb91ff477 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_middle_unordered.golden new file mode 100644 index 000000000..b773be160 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_middle_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_empty_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_empty_to_null.golden new file mode 100644 index 000000000..7bae19762 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_empty_to_null.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_non-null.golden new file mode 100644 index 000000000..3d40302c3 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_non-null.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value1"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-value" -> null + - nested = "value" -> null + } + + test { # forces replacement + + computed = "non-computed-value1" + + nested = "value1" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ computed: "non-computed-value" => "non-computed-value1" + ~ nested : "value" => "value1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_non-null_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_non-null_to_null.golden new file mode 100644 index 000000000..e1cbce612 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_non-null_to_null.golden @@ -0,0 +1,42 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-value" -> null + - nested = "value" -> null + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - tests: [ + - [0]: { + - computed: "non-computed-value" + - nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_null_to_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_null_to_empty.golden new file mode 100644 index 000000000..9589fbdf0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_null_to_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_null_to_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_null_to_non-null.golden new file mode 100644 index 000000000..e2326c566 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_null_to_non-null.golden @@ -0,0 +1,42 @@ +tests.testOutput{ + changeValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-value" + + nested = "value" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + computed : "non-computed-value" + + nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed.golden new file mode 100644 index 000000000..ea57b6068 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed.golden @@ -0,0 +1,43 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-value" -> null + - nested = "value" -> null + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - tests: [ + - [0]: { + - computed: "non-computed-value" + - nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_end.golden new file mode 100644 index 000000000..27b631a62 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_end_unordered.golden new file mode 100644 index 000000000..87c9ced14 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_end_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_front.golden new file mode 100644 index 000000000..74c0f7468 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_front_unordered.golden new file mode 100644 index 000000000..d83c330b0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_front_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_middle.golden new file mode 100644 index 000000000..7b3e9ce15 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_middle_unordered.golden new file mode 100644 index 000000000..8e95109d1 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_middle_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + "val2", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled.golden new file mode 100644 index 000000000..b22444299 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_end.golden new file mode 100644 index 000000000..cf125372c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val2", + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_front.golden new file mode 100644 index 000000000..c8d7a3a0f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_middle.golden new file mode 100644 index 000000000..373c6cff9 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_end.golden new file mode 100644 index 000000000..9ec766ae5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_front.golden new file mode 100644 index 000000000..1a4103a07 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_middle.golden new file mode 100644 index 000000000..40b9ff67a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_unordered.golden new file mode 100644 index 000000000..d98c38179 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_unordered.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_with_duplicates.golden new file mode 100644 index 000000000..09d74fe9c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_with_duplicates.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_with_duplicates_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_with_duplicates_unordered.golden new file mode 100644 index 000000000..1011e92c5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_with_duplicates_unordered.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/two_added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/two_added.golden new file mode 100644 index 000000000..353e54999 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/two_added.golden @@ -0,0 +1,62 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val3" + + nested = "val3" + } + + test { # forces replacement + + computed = "non-computed-val4" + + nested = "val4" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + + [3]: { + + computed : "non-computed-val4" + + nested : "val4" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/two_removed.golden new file mode 100644 index 000000000..fa8851ce6 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/two_removed.golden @@ -0,0 +1,62 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + - test { # forces replacement + - computed = "non-computed-val4" -> null + - nested = "val4" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + - [3]: { + - computed: "non-computed-val4" + - nested : "val4" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/unchanged_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/unchanged_empty.golden new file mode 100644 index 000000000..7d07227be --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/unchanged_non-empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/unchanged_non-empty.golden new file mode 100644 index 000000000..a87f03643 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/unchanged_non-empty.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value"}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/unchanged_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/unchanged_null.golden new file mode 100644 index 000000000..a53fac34d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/unchanged_null.golden @@ -0,0 +1,11 @@ +tests.testOutput{tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added.golden new file mode 100644 index 000000000..8a0de2272 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added.golden @@ -0,0 +1,40 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{"value"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = (known after apply) + + nested = "value" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + nested : "value" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_end.golden new file mode 100644 index 000000000..f16128f51 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_end.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_end_unordered.golden new file mode 100644 index 000000000..9eee2d69d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_end_unordered.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val2" + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_front.golden new file mode 100644 index 000000000..1ee158309 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_front.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val1" + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_front_unordered.golden new file mode 100644 index 000000000..a81fe2957 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_front_unordered.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_middle.golden new file mode 100644 index 000000000..be8c5fc65 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_middle.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_middle_unordered.golden new file mode 100644 index 000000000..e18bd28d0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_middle_unordered.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_empty_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_empty_to_null.golden new file mode 100644 index 000000000..7bae19762 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_empty_to_null.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_non-null.golden new file mode 100644 index 000000000..0170773e4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_non-null.golden @@ -0,0 +1,49 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value1"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "value" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "value1" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "value" => "value1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_non-null_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_non-null_to_null.golden new file mode 100644 index 000000000..07629a3e3 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_non-null_to_null.golden @@ -0,0 +1,42 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "value" -> null + # (1 unchanged attribute hidden) + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - tests: [ + - [0]: { + - computed: "" + - nested : "value" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_null_to_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_null_to_empty.golden new file mode 100644 index 000000000..9589fbdf0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_null_to_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_null_to_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_null_to_non-null.golden new file mode 100644 index 000000000..2672c4e43 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_null_to_non-null.golden @@ -0,0 +1,41 @@ +tests.testOutput{ + changeValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = (known after apply) + + nested = "value" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + nested : "value" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed.golden new file mode 100644 index 000000000..9d2c980b9 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed.golden @@ -0,0 +1,43 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "value" -> null + # (1 unchanged attribute hidden) + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - tests: [ + - [0]: { + - computed: "" + - nested : "value" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_end.golden new file mode 100644 index 000000000..cb5cf4ece --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_end.golden @@ -0,0 +1,72 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_end_unordered.golden new file mode 100644 index 000000000..899c8114b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_end_unordered.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val2" + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_front.golden new file mode 100644 index 000000000..f3b02f42d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_front.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val2" + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_front_unordered.golden new file mode 100644 index 000000000..16a35f8b6 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_front_unordered.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_middle.golden new file mode 100644 index 000000000..d799448f4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_middle.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_middle_unordered.golden new file mode 100644 index 000000000..dabc5aebc --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_middle_unordered.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + "val2", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/same_element_updated.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/same_element_updated.golden new file mode 100644 index 000000000..9b8aa8b52 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/same_element_updated.golden @@ -0,0 +1,79 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val4", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + + test { + + computed = (known after apply) + + nested = "val4" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val4" + } + ~ [2]: { + ~ nested : "val3" => "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/same_element_updated_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/same_element_updated_unordered.golden new file mode 100644 index 000000000..be19e29c7 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/same_element_updated_unordered.golden @@ -0,0 +1,77 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val4", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val4" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + ~ [2]: { + ~ nested : "val3" => "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled.golden new file mode 100644 index 000000000..b22444299 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_added_end.golden new file mode 100644 index 000000000..83564177f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_added_end.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val2", + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_added_front.golden new file mode 100644 index 000000000..8b796bce2 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_added_front.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val1" + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_added_middle.golden new file mode 100644 index 000000000..43f337249 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_added_middle.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_removed_end.golden new file mode 100644 index 000000000..39a220517 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_removed_end.golden @@ -0,0 +1,72 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_removed_front.golden new file mode 100644 index 000000000..acb278d4c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_removed_front.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val3" + } + ~ [1]: { + ~ nested : "val2" => "val2" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_removed_middle.golden new file mode 100644 index 000000000..323e01ff9 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_removed_middle.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_unordered.golden new file mode 100644 index 000000000..d98c38179 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_unordered.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_with_duplicates.golden new file mode 100644 index 000000000..09d74fe9c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_with_duplicates.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_with_duplicates_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_with_duplicates_unordered.golden new file mode 100644 index 000000000..1011e92c5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_with_duplicates_unordered.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added.golden new file mode 100644 index 000000000..1637ef233 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added.golden @@ -0,0 +1,80 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + + test { + + computed = (known after apply) + + nested = "val4" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + + [3]: { + + nested : "val4" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + "tests[3]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added_and_two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added_and_two_removed.golden new file mode 100644 index 000000000..78e89cb3f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added_and_two_removed.golden @@ -0,0 +1,92 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + "val5", + "val6", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val4" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val5" + } + + test { + + computed = (known after apply) + + nested = "val6" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + ~ [2]: { + ~ nested : "val3" => "val5" + } + ~ [3]: { + ~ nested : "val4" => "val6" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added_and_two_removed_shuffled,_no_overlaps.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added_and_two_removed_shuffled,_no_overlaps.golden new file mode 100644 index 000000000..9f1fdbf0b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added_and_two_removed_shuffled,_no_overlaps.golden @@ -0,0 +1,92 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val5", + "val6", + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val4" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val5" + } + + test { + + computed = (known after apply) + + nested = "val6" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + ~ [2]: { + ~ nested : "val3" => "val1" + } + ~ [3]: { + ~ nested : "val4" => "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added_and_two_removed_shuffled,_one_overlaps.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added_and_two_removed_shuffled,_one_overlaps.golden new file mode 100644 index 000000000..09c91c9a5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added_and_two_removed_shuffled,_one_overlaps.golden @@ -0,0 +1,92 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val5", + "val6", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val4" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val5" + } + + test { + + computed = (known after apply) + + nested = "val6" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + ~ [2]: { + ~ nested : "val3" => "val6" + } + ~ [3]: { + ~ nested : "val4" => "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added_and_two_removed_shuffled,_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added_and_two_removed_shuffled,_with_duplicates.golden new file mode 100644 index 000000000..03a4d2a37 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added_and_two_removed_shuffled,_with_duplicates.golden @@ -0,0 +1,94 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val5", + "val6", + "val2", + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val4" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val5" + } + + test { + + computed = (known after apply) + + nested = "val6" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + ~ [2]: { + ~ nested : "val3" => "val6" + } + ~ [3]: { + ~ nested : "val4" => "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_removed.golden new file mode 100644 index 000000000..6677548c8 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_removed.golden @@ -0,0 +1,82 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val4" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + - [3]: { + - computed: "" + - nested : "val4" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + "tests[3]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/unchanged_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/unchanged_empty.golden new file mode 100644 index 000000000..7d07227be --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/unchanged_non-empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/unchanged_non-empty.golden new file mode 100644 index 000000000..a87f03643 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/unchanged_non-empty.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value"}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/unchanged_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/unchanged_null.golden new file mode 100644 index 000000000..a53fac34d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/unchanged_null.golden @@ -0,0 +1,11 @@ +tests.testOutput{tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added.golden new file mode 100644 index 000000000..9c107c39e --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added.golden @@ -0,0 +1,41 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{"value"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-value" + + nested = "value" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + computed : "non-computed-value" + + nested : "value" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_end.golden new file mode 100644 index 000000000..66fbc1c2d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_end_unordered.golden new file mode 100644 index 000000000..b1236f090 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_end_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_front.golden new file mode 100644 index 000000000..9a8683764 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_front_unordered.golden new file mode 100644 index 000000000..33112977a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_front_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_middle.golden new file mode 100644 index 000000000..3fa147fc4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_middle_unordered.golden new file mode 100644 index 000000000..bb02e047a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_middle_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_empty_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_empty_to_null.golden new file mode 100644 index 000000000..7bae19762 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_empty_to_null.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_non-null.golden new file mode 100644 index 000000000..89c888348 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_non-null.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value1"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-value" -> null + - nested = "value" -> null + } + + test { + + computed = "non-computed-value1" + + nested = "value1" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ computed: "non-computed-value" => "non-computed-value1" + ~ nested : "value" => "value1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_non-null_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_non-null_to_null.golden new file mode 100644 index 000000000..6d83e6015 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_non-null_to_null.golden @@ -0,0 +1,42 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-value" -> null + - nested = "value" -> null + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - tests: [ + - [0]: { + - computed: "non-computed-value" + - nested : "value" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_null_to_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_null_to_empty.golden new file mode 100644 index 000000000..9589fbdf0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_null_to_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_null_to_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_null_to_non-null.golden new file mode 100644 index 000000000..238c8dba3 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_null_to_non-null.golden @@ -0,0 +1,42 @@ +tests.testOutput{ + changeValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-value" + + nested = "value" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + computed : "non-computed-value" + + nested : "value" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed.golden new file mode 100644 index 000000000..5246ebfdc --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed.golden @@ -0,0 +1,43 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-value" -> null + - nested = "value" -> null + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - tests: [ + - [0]: { + - computed: "non-computed-value" + - nested : "value" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_end.golden new file mode 100644 index 000000000..101d829f4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_end_unordered.golden new file mode 100644 index 000000000..d3921213c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_end_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_front.golden new file mode 100644 index 000000000..95cec62f9 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_front_unordered.golden new file mode 100644 index 000000000..4ce1bb1bb --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_front_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_middle.golden new file mode 100644 index 000000000..e27759e65 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_middle_unordered.golden new file mode 100644 index 000000000..71aca2ff6 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_middle_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + "val2", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/same_element_updated.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/same_element_updated.golden new file mode 100644 index 000000000..096344412 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/same_element_updated.golden @@ -0,0 +1,62 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val4", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + test { + + computed = "non-computed-val4" + + nested = "val4" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[1]": map[string]interface{}{"kind": "DELETE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/same_element_updated_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/same_element_updated_unordered.golden new file mode 100644 index 000000000..855997ff7 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/same_element_updated_unordered.golden @@ -0,0 +1,58 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val4", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + + test { + + computed = "non-computed-val4" + + nested = "val4" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [2]: { + ~ computed: "non-computed-val3" => "non-computed-val1" + ~ nested : "val3" => "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled.golden new file mode 100644 index 000000000..b22444299 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_added_end.golden new file mode 100644 index 000000000..ae58b0bcc --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_added_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val2", + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_added_front.golden new file mode 100644 index 000000000..c73db179d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_added_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_added_middle.golden new file mode 100644 index 000000000..ccd82694b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_added_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_removed_end.golden new file mode 100644 index 000000000..8741a83c6 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_removed_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_removed_front.golden new file mode 100644 index 000000000..e0d9d13c4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_removed_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_removed_middle.golden new file mode 100644 index 000000000..19dd48fb4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_removed_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_unordered.golden new file mode 100644 index 000000000..d98c38179 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_unordered.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_with_duplicates.golden new file mode 100644 index 000000000..09d74fe9c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_with_duplicates.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_with_duplicates_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_with_duplicates_unordered.golden new file mode 100644 index 000000000..1011e92c5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_with_duplicates_unordered.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added.golden new file mode 100644 index 000000000..e43424e12 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added.golden @@ -0,0 +1,62 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val3" + + nested = "val3" + } + + test { + + computed = "non-computed-val4" + + nested = "val4" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + + [3]: { + + computed : "non-computed-val4" + + nested : "val4" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{}, + "tests[3]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added_and_two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added_and_two_removed.golden new file mode 100644 index 000000000..fc533b2c3 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added_and_two_removed.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + "val5", + "val6", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + - test { + - computed = "non-computed-val4" -> null + - nested = "val4" -> null + } + + test { + + computed = "non-computed-val5" + + nested = "val5" + } + + test { + + computed = "non-computed-val6" + + nested = "val6" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [2]: { + ~ computed: "non-computed-val3" => "non-computed-val5" + ~ nested : "val3" => "val5" + } + ~ [3]: { + ~ computed: "non-computed-val4" => "non-computed-val6" + ~ nested : "val4" => "val6" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_no_overlaps.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_no_overlaps.golden new file mode 100644 index 000000000..91b3776e3 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_no_overlaps.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val5", + "val6", + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + - test { + - computed = "non-computed-val4" -> null + - nested = "val4" -> null + } + + test { + + computed = "non-computed-val5" + + nested = "val5" + } + + test { + + computed = "non-computed-val6" + + nested = "val6" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [2]: { + ~ computed: "non-computed-val3" => "non-computed-val1" + ~ nested : "val3" => "val1" + } + ~ [3]: { + ~ computed: "non-computed-val4" => "non-computed-val2" + ~ nested : "val4" => "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_one_overlaps.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_one_overlaps.golden new file mode 100644 index 000000000..872a2178d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_one_overlaps.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val5", + "val6", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + - test { + - computed = "non-computed-val4" -> null + - nested = "val4" -> null + } + + test { + + computed = "non-computed-val5" + + nested = "val5" + } + + test { + + computed = "non-computed-val6" + + nested = "val6" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [2]: { + ~ computed: "non-computed-val3" => "non-computed-val6" + ~ nested : "val3" => "val6" + } + ~ [3]: { + ~ computed: "non-computed-val4" => "non-computed-val2" + ~ nested : "val4" => "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_with_duplicates.golden new file mode 100644 index 000000000..82ff7cf7c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_with_duplicates.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val5", + "val6", + "val2", + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + - test { + - computed = "non-computed-val4" -> null + - nested = "val4" -> null + } + + test { + + computed = "non-computed-val5" + + nested = "val5" + } + + test { + + computed = "non-computed-val6" + + nested = "val6" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [2]: { + ~ computed: "non-computed-val3" => "non-computed-val6" + ~ nested : "val3" => "val6" + } + ~ [3]: { + ~ computed: "non-computed-val4" => "non-computed-val2" + ~ nested : "val4" => "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_removed.golden new file mode 100644 index 000000000..b811014c9 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_removed.golden @@ -0,0 +1,62 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + - test { + - computed = "non-computed-val4" -> null + - nested = "val4" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + - [3]: { + - computed: "non-computed-val4" + - nested : "val4" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + "tests[3]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/unchanged_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/unchanged_empty.golden new file mode 100644 index 000000000..7d07227be --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/unchanged_non-empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/unchanged_non-empty.golden new file mode 100644 index 000000000..a87f03643 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/unchanged_non-empty.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value"}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/unchanged_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/unchanged_null.golden new file mode 100644 index 000000000..a53fac34d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/unchanged_null.golden @@ -0,0 +1,11 @@ +tests.testOutput{tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added.golden new file mode 100644 index 000000000..954d6936d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added.golden @@ -0,0 +1,36 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{"value"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + + "value", + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: "value" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_end.golden new file mode 100644 index 000000000..efb765e14 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_end.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + + "val3", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: "val3" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_end_unordered.golden new file mode 100644 index 000000000..36f6efad1 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_end_unordered.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + + "val1", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: "val2" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_front.golden new file mode 100644 index 000000000..31e792da5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_front.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + + "val1", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: "val1" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_front_unordered.golden new file mode 100644 index 000000000..67b2a3799 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_front_unordered.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + + "val2", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: "val3" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_middle.golden new file mode 100644 index 000000000..fcbd5e43e --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_middle.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + + "val2", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: "val2" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_middle_unordered.golden new file mode 100644 index 000000000..1cbc9a54b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_middle_unordered.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + + "val3", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: "val1" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_empty_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_empty_to_null.golden new file mode 100644 index 000000000..7bae19762 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_empty_to_null.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_non-null.golden new file mode 100644 index 000000000..697e4c5c9 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_non-null.golden @@ -0,0 +1,39 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value1"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + - "value", + + "value1", + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: "value" => "value1" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "UPDATE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_non-null_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_non-null_to_null.golden new file mode 100644 index 000000000..eff89843a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_non-null_to_null.golden @@ -0,0 +1,17 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_null_to_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_null_to_empty.golden new file mode 100644 index 000000000..9589fbdf0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_null_to_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_null_to_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_null_to_non-null.golden new file mode 100644 index 000000000..e16ea5c7e --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_null_to_non-null.golden @@ -0,0 +1,37 @@ +tests.testOutput{ + changeValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + + "value", + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: "value" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed.golden new file mode 100644 index 000000000..60aaba5dd --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed.golden @@ -0,0 +1,38 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ + - "value", + ] -> (known after apply) # forces replacement + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - tests: [ + - [0]: "value" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_end.golden new file mode 100644 index 000000000..778429a10 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_end.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + - "val3", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: "val3" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_end_unordered.golden new file mode 100644 index 000000000..ba2e33837 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_end_unordered.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + - "val1", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: "val1" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_front.golden new file mode 100644 index 000000000..559e88f3c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_front.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + - "val1", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: "val1" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_front_unordered.golden new file mode 100644 index 000000000..66fb90e78 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_front_unordered.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + - "val2", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: "val2" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_middle.golden new file mode 100644 index 000000000..89b2548c5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_middle.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + - "val2", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: "val2" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_middle_unordered.golden new file mode 100644 index 000000000..a34fe9f43 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_middle_unordered.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + "val2", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + - "val2", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: "val2" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled.golden new file mode 100644 index 000000000..b22444299 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_added_end.golden new file mode 100644 index 000000000..83c54b25e --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_added_end.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val2", + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + + "val3", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: "val3" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_added_front.golden new file mode 100644 index 000000000..062d80a9d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_added_front.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + + "val1", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: "val1" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_added_middle.golden new file mode 100644 index 000000000..4ba476ddf --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_added_middle.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + + "val2", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: "val2" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_removed_end.golden new file mode 100644 index 000000000..65bf2f44a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_removed_end.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + - "val3", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: "val3" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_removed_front.golden new file mode 100644 index 000000000..73f5630f4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_removed_front.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + - "val1", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: "val1" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_removed_middle.golden new file mode 100644 index 000000000..adb70ea2c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_removed_middle.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + - "val2", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: "val2" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_unordered.golden new file mode 100644 index 000000000..d98c38179 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_unordered.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_with_duplicates.golden new file mode 100644 index 000000000..09d74fe9c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_with_duplicates.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_with_duplicates_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_with_duplicates_unordered.golden new file mode 100644 index 000000000..1011e92c5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_with_duplicates_unordered.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/two_added.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/two_added.golden new file mode 100644 index 000000000..fd567fa7b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/two_added.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + + "val3", + + "val4", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: "val3" + + [3]: "val4" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/two_removed.golden new file mode 100644 index 000000000..c52a70c37 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/two_removed.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + - "val3", + - "val4", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: "val3" + - [3]: "val4" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/unchanged_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/unchanged_empty.golden new file mode 100644 index 000000000..7d07227be --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/unchanged_non-empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/unchanged_non-empty.golden new file mode 100644 index 000000000..a87f03643 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/unchanged_non-empty.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value"}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/unchanged_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/unchanged_null.golden new file mode 100644 index 000000000..a53fac34d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/unchanged_null.golden @@ -0,0 +1,11 @@ +tests.testOutput{tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added.golden new file mode 100644 index 000000000..3ca3626f8 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added.golden @@ -0,0 +1,37 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{"value"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "computed", + + "value", + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: "computed" => "value" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_end.golden new file mode 100644 index 000000000..7ee2106a7 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_end.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + + "val3", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: "val3" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_end_unordered.golden new file mode 100644 index 000000000..3f7bc6224 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_end_unordered.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + + "val1", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: "val2" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_front.golden new file mode 100644 index 000000000..8895df583 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_front.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + + "val1", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: "val1" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_front_unordered.golden new file mode 100644 index 000000000..45a210728 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_front_unordered.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + + "val2", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: "val3" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_middle.golden new file mode 100644 index 000000000..39cae1691 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_middle.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + + "val2", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: "val2" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_middle_unordered.golden new file mode 100644 index 000000000..dd82a0186 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_middle_unordered.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + + "val3", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: "val1" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_empty_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_empty_to_null.golden new file mode 100644 index 000000000..7bae19762 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_empty_to_null.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_non-null.golden new file mode 100644 index 000000000..123294b6b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_non-null.golden @@ -0,0 +1,39 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value1"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "value", + + "value1", + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: "value" => "value1" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_non-null_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_non-null_to_null.golden new file mode 100644 index 000000000..eff89843a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_non-null_to_null.golden @@ -0,0 +1,17 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_null_to_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_null_to_empty.golden new file mode 100644 index 000000000..30ad73965 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_null_to_empty.golden @@ -0,0 +1,35 @@ +tests.testOutput{ + changeValue: &[]string{}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "computed", + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - tests: [ + - [0]: "computed" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_null_to_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_null_to_non-null.golden new file mode 100644 index 000000000..3fed7515a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_null_to_non-null.golden @@ -0,0 +1,38 @@ +tests.testOutput{ + changeValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "computed", + + "value", + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: "computed" => "value" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed.golden new file mode 100644 index 000000000..f19c6593e --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed.golden @@ -0,0 +1,38 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "value", + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - tests: [ + - [0]: "value" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_end.golden new file mode 100644 index 000000000..853195eb7 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_end.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "val3", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: "val3" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_end_unordered.golden new file mode 100644 index 000000000..c542534f7 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_end_unordered.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "val1", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: "val1" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_front.golden new file mode 100644 index 000000000..451cac3b8 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_front.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "val1", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: "val1" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_front_unordered.golden new file mode 100644 index 000000000..da0f3d3ce --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_front_unordered.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "val2", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: "val2" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_middle.golden new file mode 100644 index 000000000..9af564bb3 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_middle.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "val2", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: "val2" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_middle_unordered.golden new file mode 100644 index 000000000..28fd761cf --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_middle_unordered.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + "val2", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "val2", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: "val2" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/same_element_updated.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/same_element_updated.golden new file mode 100644 index 000000000..cafa789cc --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/same_element_updated.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val4", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "val2", + + "val4", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: "val2" + + [2]: "val3" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[1]": map[string]interface{}{"kind": "DELETE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/same_element_updated_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/same_element_updated_unordered.golden new file mode 100644 index 000000000..57fafddd9 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/same_element_updated_unordered.golden @@ -0,0 +1,46 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val4", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "val3", + + "val4", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [2]: "val3" => "val1" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled.golden new file mode 100644 index 000000000..b22444299 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_added_end.golden new file mode 100644 index 000000000..40c2fe45c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_added_end.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val2", + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + + "val3", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: "val3" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_added_front.golden new file mode 100644 index 000000000..9827f1c99 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_added_front.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + + "val1", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: "val1" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_added_middle.golden new file mode 100644 index 000000000..249ad9570 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_added_middle.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + + "val2", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: "val2" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_removed_end.golden new file mode 100644 index 000000000..a7b63e504 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_removed_end.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "val3", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: "val3" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_removed_front.golden new file mode 100644 index 000000000..6ca7784ef --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_removed_front.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "val1", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: "val1" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_removed_middle.golden new file mode 100644 index 000000000..f55f66baa --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_removed_middle.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "val2", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: "val2" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_unordered.golden new file mode 100644 index 000000000..d98c38179 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_unordered.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_with_duplicates.golden new file mode 100644 index 000000000..09d74fe9c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_with_duplicates.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_with_duplicates_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_with_duplicates_unordered.golden new file mode 100644 index 000000000..1011e92c5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_with_duplicates_unordered.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added.golden new file mode 100644 index 000000000..e79983b61 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + + "val3", + + "val4", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: "val3" + + [3]: "val4" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{}, + "tests[3]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added_and_two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added_and_two_removed.golden new file mode 100644 index 000000000..c0e323986 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added_and_two_removed.golden @@ -0,0 +1,54 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + "val5", + "val6", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "val3", + - "val4", + + "val5", + + "val6", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [2]: "val3" => "val5" + ~ [3]: "val4" => "val6" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "UPDATE"}, + "tests[3]": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added_and_two_removed_shuffled,_no_overlaps.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added_and_two_removed_shuffled,_no_overlaps.golden new file mode 100644 index 000000000..09ef55654 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added_and_two_removed_shuffled,_no_overlaps.golden @@ -0,0 +1,54 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val5", + "val6", + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "val3", + - "val4", + + "val5", + + "val6", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [2]: "val3" => "val1" + ~ [3]: "val4" => "val2" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "UPDATE"}, + "tests[3]": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added_and_two_removed_shuffled,_one_overlaps.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added_and_two_removed_shuffled,_one_overlaps.golden new file mode 100644 index 000000000..d54850499 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added_and_two_removed_shuffled,_one_overlaps.golden @@ -0,0 +1,54 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val5", + "val6", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "val3", + - "val4", + + "val5", + + "val6", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [2]: "val3" => "val6" + ~ [3]: "val4" => "val2" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "UPDATE"}, + "tests[3]": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added_and_two_removed_shuffled,_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added_and_two_removed_shuffled,_with_duplicates.golden new file mode 100644 index 000000000..dae33ce78 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added_and_two_removed_shuffled,_with_duplicates.golden @@ -0,0 +1,56 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val5", + "val6", + "val2", + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "val3", + - "val4", + + "val5", + + "val6", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [2]: "val3" => "val6" + ~ [3]: "val4" => "val2" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "UPDATE"}, + "tests[3]": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_removed.golden new file mode 100644 index 000000000..f97ddf92d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_removed.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "val3", + - "val4", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: "val3" + - [3]: "val4" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + "tests[3]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/unchanged_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/unchanged_empty.golden new file mode 100644 index 000000000..ee393acc7 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/unchanged_empty.golden @@ -0,0 +1,36 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "computed", + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - tests: [ + - [0]: "computed" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/unchanged_non-empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/unchanged_non-empty.golden new file mode 100644 index 000000000..a87f03643 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/unchanged_non-empty.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value"}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/unchanged_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/unchanged_null.golden new file mode 100644 index 000000000..a53fac34d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/unchanged_null.golden @@ -0,0 +1,11 @@ +tests.testOutput{tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`}