diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_top_level_force_new/same_element_updated_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_top_level_force_new/same_element_updated_unordered.golden index 24a6cb727..877874c48 100644 --- a/pkg/tests/testdata/TestDetailedDiffSet/block_top_level_force_new/same_element_updated_unordered.golden +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_top_level_force_new/same_element_updated_unordered.golden @@ -36,7 +36,7 @@ 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: (replace) + ~ crossprovider:index/testRes:TestRes: (update) [id=newid] [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] ~ tests: [ @@ -48,11 +48,11 @@ Plan: 0 to add, 1 to change, 0 to destroy. } ] Resources: - +-1 to replace + ~ 1 to update 1 unchanged `, detailedDiff: map[string]interface{}{ - "tests[1]": map[string]interface{}{"kind": "ADD_REPLACE"}, - "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + "tests[1]": map[string]interface{}{}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, }, } diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_top_level_force_new/two_added_and_two_removed_shuffled,_no_overlaps.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_top_level_force_new/two_added_and_two_removed_shuffled,_no_overlaps.golden index f14f7acf2..a2d950d91 100644 --- a/pkg/tests/testdata/TestDetailedDiffSet/block_top_level_force_new/two_added_and_two_removed_shuffled,_no_overlaps.golden +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_top_level_force_new/two_added_and_two_removed_shuffled,_no_overlaps.golden @@ -44,7 +44,7 @@ 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: (replace) + ~ crossprovider:index/testRes:TestRes: (update) [id=newid] [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] ~ tests: [ @@ -62,13 +62,13 @@ Plan: 0 to add, 1 to change, 0 to destroy. } ] Resources: - +-1 to replace + ~ 1 to update 1 unchanged `, detailedDiff: map[string]interface{}{ - "tests[0]": map[string]interface{}{"kind": "ADD_REPLACE"}, - "tests[1]": map[string]interface{}{"kind": "ADD_REPLACE"}, - "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, - "tests[3]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + "tests[0]": map[string]interface{}{}, + "tests[1]": 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_top_level_force_new/two_added_and_two_removed_shuffled,_one_overlaps.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_top_level_force_new/two_added_and_two_removed_shuffled,_one_overlaps.golden index 01e7fd027..174d501cf 100644 --- a/pkg/tests/testdata/TestDetailedDiffSet/block_top_level_force_new/two_added_and_two_removed_shuffled,_one_overlaps.golden +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_top_level_force_new/two_added_and_two_removed_shuffled,_one_overlaps.golden @@ -44,7 +44,7 @@ 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: (replace) + ~ crossprovider:index/testRes:TestRes: (update) [id=newid] [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] ~ tests: [ @@ -59,12 +59,12 @@ Plan: 0 to add, 1 to change, 0 to destroy. } ] Resources: - +-1 to replace + ~ 1 to update 1 unchanged `, detailedDiff: map[string]interface{}{ - "tests[1]": map[string]interface{}{"kind": "ADD_REPLACE"}, + "tests[1]": map[string]interface{}{}, "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, - "tests[3]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "DELETE"}, }, } diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_top_level_force_new/two_added_and_two_removed_shuffled,_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_top_level_force_new/two_added_and_two_removed_shuffled,_with_duplicates.golden index 214c2f28b..893609195 100644 --- a/pkg/tests/testdata/TestDetailedDiffSet/block_top_level_force_new/two_added_and_two_removed_shuffled,_with_duplicates.golden +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_top_level_force_new/two_added_and_two_removed_shuffled,_with_duplicates.golden @@ -46,7 +46,7 @@ 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: (replace) + ~ crossprovider:index/testRes:TestRes: (update) [id=newid] [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] ~ tests: [ @@ -61,12 +61,12 @@ Plan: 0 to add, 1 to change, 0 to destroy. } ] Resources: - +-1 to replace + ~ 1 to update 1 unchanged `, detailedDiff: map[string]interface{}{ - "tests[1]": map[string]interface{}{"kind": "ADD_REPLACE"}, + "tests[1]": map[string]interface{}{}, "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, - "tests[3]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "DELETE"}, }, } diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/same_element_updated.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/same_element_updated.golden new file mode 100644 index 000000000..1b1820d1c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/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: ++/- 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" + } + + 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]: { + ~ nested : "val2" => "val4" + } + ~ [2]: { + ~ nested : "val3" => "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].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/same_element_updated_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/same_element_updated_unordered.golden new file mode 100644 index 000000000..2e13aa932 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/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: ++/- 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" + } + + 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" => "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].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/two_added_and_two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/two_added_and_two_removed.golden new file mode 100644 index 000000000..888c08999 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/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: ++/- 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" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val5" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val6" + } + } + +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" => "val5" + } + ~ [3]: { + ~ nested : "val4" => "val6" + } + ] +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].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/two_added_and_two_removed_shuffled,_no_overlaps.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/two_added_and_two_removed_shuffled,_no_overlaps.golden new file mode 100644 index 000000000..8722b0977 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/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: ++/- 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" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val5" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val6" + } + } + +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" => "val1" + } + ~ [3]: { + ~ nested : "val4" => "val2" + } + ] +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].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/two_added_and_two_removed_shuffled,_one_overlaps.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/two_added_and_two_removed_shuffled,_one_overlaps.golden new file mode 100644 index 000000000..aadee6514 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/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: ++/- 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" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val5" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val6" + } + } + +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" => "val6" + } + ~ [3]: { + ~ nested : "val4" => "val2" + } + ] +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].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/two_added_and_two_removed_shuffled,_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/two_added_and_two_removed_shuffled,_with_duplicates.golden new file mode 100644 index 000000000..62387c4ff --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/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: ++/- 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" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val5" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val6" + } + } + +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" => "val6" + } + ~ [3]: { + ~ nested : "val4" => "val2" + } + ] +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].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].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/same_element_updated.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/same_element_updated.golden new file mode 100644 index 000000000..f24a12614 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_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: ++/- 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 + } + + 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: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + "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/same_element_updated_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/same_element_updated_unordered.golden new file mode 100644 index 000000000..4366e01bd --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_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: ++/- 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" + + 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" => "non-computed-val1" + ~ nested : "val3" => "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].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/two_added_and_two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/two_added_and_two_removed.golden new file mode 100644 index 000000000..d4593e7f3 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_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: ++/- 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 + } + + test { # forces replacement + + computed = "non-computed-val5" + + nested = "val5" + } + + test { # forces replacement + + computed = "non-computed-val6" + + nested = "val6" + } + + # (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" => "non-computed-val5" + ~ nested : "val3" => "val5" + } + ~ [3]: { + ~ computed: "non-computed-val4" => "non-computed-val6" + ~ nested : "val4" => "val6" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].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/two_added_and_two_removed_shuffled,_no_overlaps.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/two_added_and_two_removed_shuffled,_no_overlaps.golden new file mode 100644 index 000000000..5e918ae90 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_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: ++/- 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 + } + + test { # forces replacement + + computed = "non-computed-val5" + + nested = "val5" + } + + test { # forces replacement + + computed = "non-computed-val6" + + nested = "val6" + } + + # (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" => "non-computed-val1" + ~ nested : "val3" => "val1" + } + ~ [3]: { + ~ computed: "non-computed-val4" => "non-computed-val2" + ~ nested : "val4" => "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].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/two_added_and_two_removed_shuffled,_one_overlaps.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/two_added_and_two_removed_shuffled,_one_overlaps.golden new file mode 100644 index 000000000..c3d8b5fbe --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_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: ++/- 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 + } + + test { # forces replacement + + computed = "non-computed-val5" + + nested = "val5" + } + + test { # forces replacement + + computed = "non-computed-val6" + + nested = "val6" + } + + # (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" => "non-computed-val6" + ~ nested : "val3" => "val6" + } + ~ [3]: { + ~ computed: "non-computed-val4" => "non-computed-val2" + ~ nested : "val4" => "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].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/two_added_and_two_removed_shuffled,_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/two_added_and_two_removed_shuffled,_with_duplicates.golden new file mode 100644 index 000000000..54d8167cc --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_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: ++/- 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 + } + + test { # forces replacement + + computed = "non-computed-val5" + + nested = "val5" + } + + test { # forces replacement + + computed = "non-computed-val6" + + nested = "val6" + } + + # (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" => "non-computed-val6" + ~ nested : "val3" => "val6" + } + ~ [3]: { + ~ computed: "non-computed-val4" => "non-computed-val2" + ~ nested : "val4" => "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/same_element_updated.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/same_element_updated.golden new file mode 100644 index 000000000..9b8aa8b52 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/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_force_new/same_element_updated_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/same_element_updated_unordered.golden new file mode 100644 index 000000000..be19e29c7 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/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_force_new/two_added_and_two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/two_added_and_two_removed.golden new file mode 100644 index 000000000..78e89cb3f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/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_force_new/two_added_and_two_removed_shuffled,_no_overlaps.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/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_force_new/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_force_new/two_added_and_two_removed_shuffled,_one_overlaps.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/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_force_new/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_force_new/two_added_and_two_removed_shuffled,_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/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_force_new/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_force_new_computed_specified_in_program/same_element_updated.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_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_force_new_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_force_new_computed_specified_in_program/same_element_updated_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_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_force_new_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_force_new_computed_specified_in_program/two_added_and_two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_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_force_new_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_force_new_computed_specified_in_program/two_added_and_two_removed_shuffled,_no_overlaps.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_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_force_new_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_force_new_computed_specified_in_program/two_added_and_two_removed_shuffled,_one_overlaps.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_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_force_new_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_force_new_computed_specified_in_program/two_added_and_two_removed_shuffled,_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_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_force_new_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_and_force_new/same_element_updated.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/same_element_updated.golden new file mode 100644 index 000000000..9b8aa8b52 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/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_and_force_new/same_element_updated_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/same_element_updated_unordered.golden new file mode 100644 index 000000000..be19e29c7 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/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_and_force_new/two_added_and_two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/two_added_and_two_removed.golden new file mode 100644 index 000000000..78e89cb3f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/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_and_force_new/two_added_and_two_removed_shuffled,_no_overlaps.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/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_and_force_new/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_and_force_new/two_added_and_two_removed_shuffled,_one_overlaps.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/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_and_force_new/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_and_force_new/two_added_and_two_removed_shuffled,_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/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_and_force_new/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_and_force_new_computed_specified_in_program/same_element_updated.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_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_and_force_new_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_and_force_new_computed_specified_in_program/same_element_updated_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_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_and_force_new_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_and_force_new_computed_specified_in_program/two_added_and_two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_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_and_force_new_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_and_force_new_computed_specified_in_program/two_added_and_two_removed_shuffled,_no_overlaps.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_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_and_force_new_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_and_force_new_computed_specified_in_program/two_added_and_two_removed_shuffled,_one_overlaps.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_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_and_force_new_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_and_force_new_computed_specified_in_program/two_added_and_two_removed_shuffled,_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_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_and_force_new_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_and_nested_force_new/same_element_updated.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/same_element_updated.golden new file mode 100644 index 000000000..1b1820d1c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/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: ++/- 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" + } + + 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]: { + ~ nested : "val2" => "val4" + } + ~ [2]: { + ~ nested : "val3" => "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].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/same_element_updated_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/same_element_updated_unordered.golden new file mode 100644 index 000000000..2e13aa932 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/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: ++/- 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" + } + + 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" => "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].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/two_added_and_two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/two_added_and_two_removed.golden new file mode 100644 index 000000000..888c08999 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/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: ++/- 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" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val5" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val6" + } + } + +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" => "val5" + } + ~ [3]: { + ~ nested : "val4" => "val6" + } + ] +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].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/two_added_and_two_removed_shuffled,_no_overlaps.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/two_added_and_two_removed_shuffled,_no_overlaps.golden new file mode 100644 index 000000000..8722b0977 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/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: ++/- 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" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val5" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val6" + } + } + +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" => "val1" + } + ~ [3]: { + ~ nested : "val4" => "val2" + } + ] +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].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/two_added_and_two_removed_shuffled,_one_overlaps.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/two_added_and_two_removed_shuffled,_one_overlaps.golden new file mode 100644 index 000000000..aadee6514 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/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: ++/- 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" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val5" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val6" + } + } + +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" => "val6" + } + ~ [3]: { + ~ nested : "val4" => "val2" + } + ] +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].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/two_added_and_two_removed_shuffled,_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/two_added_and_two_removed_shuffled,_with_duplicates.golden new file mode 100644 index 000000000..62387c4ff --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/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: ++/- 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" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val5" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val6" + } + } + +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" => "val6" + } + ~ [3]: { + ~ nested : "val4" => "val2" + } + ] +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].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].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/same_element_updated.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/same_element_updated.golden new file mode 100644 index 000000000..f24a12614 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_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: ++/- 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 + } + + 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: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + "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/same_element_updated_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/same_element_updated_unordered.golden new file mode 100644 index 000000000..4366e01bd --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_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: ++/- 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" + + 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" => "non-computed-val1" + ~ nested : "val3" => "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].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/two_added_and_two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/two_added_and_two_removed.golden new file mode 100644 index 000000000..d4593e7f3 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_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: ++/- 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 + } + + test { # forces replacement + + computed = "non-computed-val5" + + nested = "val5" + } + + test { # forces replacement + + computed = "non-computed-val6" + + nested = "val6" + } + + # (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" => "non-computed-val5" + ~ nested : "val3" => "val5" + } + ~ [3]: { + ~ computed: "non-computed-val4" => "non-computed-val6" + ~ nested : "val4" => "val6" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].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/two_added_and_two_removed_shuffled,_no_overlaps.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/two_added_and_two_removed_shuffled,_no_overlaps.golden new file mode 100644 index 000000000..5e918ae90 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_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: ++/- 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 + } + + test { # forces replacement + + computed = "non-computed-val5" + + nested = "val5" + } + + test { # forces replacement + + computed = "non-computed-val6" + + nested = "val6" + } + + # (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" => "non-computed-val1" + ~ nested : "val3" => "val1" + } + ~ [3]: { + ~ computed: "non-computed-val4" => "non-computed-val2" + ~ nested : "val4" => "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].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/two_added_and_two_removed_shuffled,_one_overlaps.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/two_added_and_two_removed_shuffled,_one_overlaps.golden new file mode 100644 index 000000000..c3d8b5fbe --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_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: ++/- 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 + } + + test { # forces replacement + + computed = "non-computed-val5" + + nested = "val5" + } + + test { # forces replacement + + computed = "non-computed-val6" + + nested = "val6" + } + + # (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" => "non-computed-val6" + ~ nested : "val3" => "val6" + } + ~ [3]: { + ~ computed: "non-computed-val4" => "non-computed-val2" + ~ nested : "val4" => "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].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/two_added_and_two_removed_shuffled,_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/two_added_and_two_removed_shuffled,_with_duplicates.golden new file mode 100644 index 000000000..54d8167cc --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_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: ++/- 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 + } + + test { # forces replacement + + computed = "non-computed-val5" + + nested = "val5" + } + + test { # forces replacement + + computed = "non-computed-val6" + + nested = "val6" + } + + # (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" => "non-computed-val6" + ~ nested : "val3" => "val6" + } + ~ [3]: { + ~ computed: "non-computed-val4" => "non-computed-val2" + ~ nested : "val4" => "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/same_element_updated.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/same_element_updated.golden new file mode 100644 index 000000000..cdab4d53b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_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: ++/- 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", + + "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: [ + - [1]: "val2" + + [2]: "val3" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/same_element_updated_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/same_element_updated_unordered.golden new file mode 100644 index 000000000..ab03c080a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_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: ++/- 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" => "val1" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "UPDATE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/two_added_and_two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/two_added_and_two_removed.golden new file mode 100644 index 000000000..e79aff8fd --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_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: ++/- 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", + + "val5", + + "val6", + # (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" => "val5" + ~ [3]: "val4" => "val6" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/two_added_and_two_removed_shuffled,_no_overlaps.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/two_added_and_two_removed_shuffled,_no_overlaps.golden new file mode 100644 index 000000000..bbcf56005 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_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: ++/- 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", + + "val5", + + "val6", + # (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" => "val1" + ~ [3]: "val4" => "val2" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/two_added_and_two_removed_shuffled,_one_overlaps.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/two_added_and_two_removed_shuffled,_one_overlaps.golden new file mode 100644 index 000000000..0e1fb53c1 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_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: ++/- 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", + + "val5", + + "val6", + # (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" => "val6" + ~ [3]: "val4" => "val2" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/two_added_and_two_removed_shuffled,_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/two_added_and_two_removed_shuffled,_with_duplicates.golden new file mode 100644 index 000000000..cdf6f3998 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_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: ++/- 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", + + "val5", + + "val6", + # (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" => "val6" + ~ [3]: "val4" => "val2" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + }, +}