From d8b1526fac49709e5bb3d265463a95af2941b55b Mon Sep 17 00:00:00 2001 From: Venelin Date: Thu, 12 Dec 2024 15:18:07 +0000 Subject: [PATCH] Add SDKv2 Detailed Diff tests for Computed properties in sets --- pkg/tests/detailed_diff_set_test.go | 366 +++++++++++++++++- .../added.golden | 40 ++ .../added_end.golden | 71 ++++ .../added_end_unordered.golden | 75 ++++ .../added_front.golden | 75 ++++ .../added_front_unordered.golden | 73 ++++ .../added_middle.golden | 73 ++++ .../added_middle_unordered.golden | 71 ++++ .../changed_empty_to_null.golden | 15 + .../changed_non-null.golden | 49 +++ .../changed_non-null_to_null.golden | 17 + .../changed_null_to_empty.golden | 15 + .../changed_null_to_non-null.golden | 41 ++ .../removed.golden | 18 + .../removed_end.golden | 72 ++++ .../removed_end_unordered.golden | 76 ++++ .../removed_front.golden | 76 ++++ .../removed_front_unordered.golden | 74 ++++ .../removed_middle.golden | 74 ++++ .../removed_middle_unordered.golden | 74 ++++ .../shuffled.golden | 24 ++ .../shuffled_added_end.golden | 71 ++++ .../shuffled_added_front.golden | 75 ++++ .../shuffled_added_middle.golden | 73 ++++ .../shuffled_removed_end.golden | 72 ++++ .../shuffled_removed_front.golden | 76 ++++ .../shuffled_removed_middle.golden | 74 ++++ .../shuffled_unordered.golden | 24 ++ .../shuffled_with_duplicates.golden | 25 ++ .../shuffled_with_duplicates_unordered.golden | 25 ++ .../two_added.golden | 80 ++++ .../two_removed.golden | 82 ++++ .../unchanged_empty.golden | 16 + .../unchanged_non-empty.golden | 18 + .../unchanged_null.golden | 11 + .../added.golden | 41 ++ .../added_end.golden | 50 +++ .../added_end_unordered.golden | 50 +++ .../added_front.golden | 50 +++ .../added_front_unordered.golden | 50 +++ .../added_middle.golden | 50 +++ .../added_middle_unordered.golden | 50 +++ .../changed_empty_to_null.golden | 15 + .../changed_non-null.golden | 50 +++ .../changed_non-null_to_null.golden | 17 + .../changed_null_to_empty.golden | 15 + .../changed_null_to_non-null.golden | 42 ++ .../removed.golden | 18 + .../removed_end.golden | 50 +++ .../removed_end_unordered.golden | 50 +++ .../removed_front.golden | 50 +++ .../removed_front_unordered.golden | 50 +++ .../removed_middle.golden | 50 +++ .../removed_middle_unordered.golden | 50 +++ .../shuffled.golden | 24 ++ .../shuffled_added_end.golden | 50 +++ .../shuffled_added_front.golden | 50 +++ .../shuffled_added_middle.golden | 50 +++ .../shuffled_removed_end.golden | 50 +++ .../shuffled_removed_front.golden | 50 +++ .../shuffled_removed_middle.golden | 50 +++ .../shuffled_unordered.golden | 24 ++ .../shuffled_with_duplicates.golden | 25 ++ .../shuffled_with_duplicates_unordered.golden | 25 ++ .../two_added.golden | 62 +++ .../two_removed.golden | 62 +++ .../unchanged_empty.golden | 16 + .../unchanged_non-empty.golden | 18 + .../unchanged_null.golden | 11 + .../added.golden | 40 ++ .../added_end.golden | 71 ++++ .../added_end_unordered.golden | 75 ++++ .../added_front.golden | 75 ++++ .../added_front_unordered.golden | 73 ++++ .../added_middle.golden | 73 ++++ .../added_middle_unordered.golden | 71 ++++ .../changed_empty_to_null.golden | 15 + .../changed_non-null.golden | 49 +++ .../changed_non-null_to_null.golden | 17 + .../changed_null_to_empty.golden | 15 + .../changed_null_to_non-null.golden | 41 ++ .../removed.golden | 18 + .../removed_end.golden | 72 ++++ .../removed_end_unordered.golden | 76 ++++ .../removed_front.golden | 76 ++++ .../removed_front_unordered.golden | 74 ++++ .../removed_middle.golden | 74 ++++ .../removed_middle_unordered.golden | 74 ++++ .../shuffled.golden | 24 ++ .../shuffled_added_end.golden | 71 ++++ .../shuffled_added_front.golden | 75 ++++ .../shuffled_added_middle.golden | 73 ++++ .../shuffled_removed_end.golden | 72 ++++ .../shuffled_removed_front.golden | 76 ++++ .../shuffled_removed_middle.golden | 74 ++++ .../shuffled_unordered.golden | 24 ++ .../shuffled_with_duplicates.golden | 25 ++ .../shuffled_with_duplicates_unordered.golden | 25 ++ .../two_added.golden | 80 ++++ .../two_removed.golden | 82 ++++ .../unchanged_empty.golden | 16 + .../unchanged_non-empty.golden | 18 + .../unchanged_null.golden | 11 + .../added.golden | 41 ++ .../added_end.golden | 50 +++ .../added_end_unordered.golden | 50 +++ .../added_front.golden | 50 +++ .../added_front_unordered.golden | 50 +++ .../added_middle.golden | 50 +++ .../added_middle_unordered.golden | 50 +++ .../changed_empty_to_null.golden | 15 + .../changed_non-null.golden | 50 +++ .../changed_non-null_to_null.golden | 17 + .../changed_null_to_empty.golden | 15 + .../changed_null_to_non-null.golden | 42 ++ .../removed.golden | 18 + .../removed_end.golden | 50 +++ .../removed_end_unordered.golden | 50 +++ .../removed_front.golden | 50 +++ .../removed_front_unordered.golden | 50 +++ .../removed_middle.golden | 50 +++ .../removed_middle_unordered.golden | 50 +++ .../shuffled.golden | 24 ++ .../shuffled_added_end.golden | 50 +++ .../shuffled_added_front.golden | 50 +++ .../shuffled_added_middle.golden | 50 +++ .../shuffled_removed_end.golden | 50 +++ .../shuffled_removed_front.golden | 50 +++ .../shuffled_removed_middle.golden | 50 +++ .../shuffled_unordered.golden | 24 ++ .../shuffled_with_duplicates.golden | 25 ++ .../shuffled_with_duplicates_unordered.golden | 25 ++ .../two_added.golden | 62 +++ .../two_removed.golden | 62 +++ .../unchanged_empty.golden | 16 + .../unchanged_non-empty.golden | 18 + .../unchanged_null.golden | 11 + .../added.golden | 40 ++ .../added_end.golden | 71 ++++ .../added_end_unordered.golden | 75 ++++ .../added_front.golden | 75 ++++ .../added_front_unordered.golden | 73 ++++ .../added_middle.golden | 73 ++++ .../added_middle_unordered.golden | 71 ++++ .../changed_empty_to_null.golden | 15 + .../changed_non-null.golden | 49 +++ .../changed_non-null_to_null.golden | 17 + .../changed_null_to_empty.golden | 15 + .../changed_null_to_non-null.golden | 41 ++ .../removed.golden | 18 + .../removed_end.golden | 72 ++++ .../removed_end_unordered.golden | 76 ++++ .../removed_front.golden | 76 ++++ .../removed_front_unordered.golden | 74 ++++ .../removed_middle.golden | 74 ++++ .../removed_middle_unordered.golden | 74 ++++ .../same_element_updated.golden | 79 ++++ .../same_element_updated_unordered.golden | 77 ++++ .../shuffled.golden | 24 ++ .../shuffled_added_end.golden | 71 ++++ .../shuffled_added_front.golden | 75 ++++ .../shuffled_added_middle.golden | 73 ++++ .../shuffled_removed_end.golden | 72 ++++ .../shuffled_removed_front.golden | 76 ++++ .../shuffled_removed_middle.golden | 74 ++++ .../shuffled_unordered.golden | 24 ++ .../shuffled_with_duplicates.golden | 25 ++ .../shuffled_with_duplicates_unordered.golden | 25 ++ .../two_added.golden | 80 ++++ .../two_added_and_two_removed.golden | 92 +++++ ...d_two_removed_shuffled,_no_overlaps.golden | 92 +++++ ..._two_removed_shuffled,_one_overlaps.golden | 92 +++++ ...o_removed_shuffled,_with_duplicates.golden | 94 +++++ .../two_removed.golden | 82 ++++ .../unchanged_empty.golden | 16 + .../unchanged_non-empty.golden | 18 + .../unchanged_null.golden | 11 + .../added.golden | 41 ++ .../added_end.golden | 50 +++ .../added_end_unordered.golden | 50 +++ .../added_front.golden | 50 +++ .../added_front_unordered.golden | 50 +++ .../added_middle.golden | 50 +++ .../added_middle_unordered.golden | 50 +++ .../changed_empty_to_null.golden | 15 + .../changed_non-null.golden | 50 +++ .../changed_non-null_to_null.golden | 17 + .../changed_null_to_empty.golden | 15 + .../changed_null_to_non-null.golden | 42 ++ .../removed.golden | 18 + .../removed_end.golden | 50 +++ .../removed_end_unordered.golden | 50 +++ .../removed_front.golden | 50 +++ .../removed_front_unordered.golden | 50 +++ .../removed_middle.golden | 50 +++ .../removed_middle_unordered.golden | 50 +++ .../same_element_updated.golden | 62 +++ .../same_element_updated_unordered.golden | 58 +++ .../shuffled.golden | 24 ++ .../shuffled_added_end.golden | 50 +++ .../shuffled_added_front.golden | 50 +++ .../shuffled_added_middle.golden | 50 +++ .../shuffled_removed_end.golden | 50 +++ .../shuffled_removed_front.golden | 50 +++ .../shuffled_removed_middle.golden | 50 +++ .../shuffled_unordered.golden | 24 ++ .../shuffled_with_duplicates.golden | 25 ++ .../shuffled_with_duplicates_unordered.golden | 25 ++ .../two_added.golden | 62 +++ .../two_added_and_two_removed.golden | 74 ++++ ...d_two_removed_shuffled,_no_overlaps.golden | 74 ++++ ..._two_removed_shuffled,_one_overlaps.golden | 74 ++++ ...o_removed_shuffled,_with_duplicates.golden | 76 ++++ .../two_removed.golden | 62 +++ .../unchanged_empty.golden | 16 + .../unchanged_non-empty.golden | 18 + .../unchanged_null.golden | 11 + .../added.golden | 40 ++ .../added_end.golden | 71 ++++ .../added_end_unordered.golden | 75 ++++ .../added_front.golden | 75 ++++ .../added_front_unordered.golden | 73 ++++ .../added_middle.golden | 73 ++++ .../added_middle_unordered.golden | 71 ++++ .../changed_empty_to_null.golden | 15 + .../changed_non-null.golden | 49 +++ .../changed_non-null_to_null.golden | 42 ++ .../changed_null_to_empty.golden | 15 + .../changed_null_to_non-null.golden | 41 ++ .../removed.golden | 43 ++ .../removed_end.golden | 72 ++++ .../removed_end_unordered.golden | 76 ++++ .../removed_front.golden | 76 ++++ .../removed_front_unordered.golden | 74 ++++ .../removed_middle.golden | 74 ++++ .../removed_middle_unordered.golden | 74 ++++ .../shuffled.golden | 24 ++ .../shuffled_added_end.golden | 71 ++++ .../shuffled_added_front.golden | 75 ++++ .../shuffled_added_middle.golden | 73 ++++ .../shuffled_removed_end.golden | 72 ++++ .../shuffled_removed_front.golden | 76 ++++ .../shuffled_removed_middle.golden | 74 ++++ .../shuffled_unordered.golden | 24 ++ .../shuffled_with_duplicates.golden | 25 ++ .../shuffled_with_duplicates_unordered.golden | 25 ++ .../two_added.golden | 80 ++++ .../two_removed.golden | 82 ++++ .../unchanged_empty.golden | 16 + .../unchanged_non-empty.golden | 18 + .../unchanged_null.golden | 11 + .../added.golden | 41 ++ .../added_end.golden | 50 +++ .../added_end_unordered.golden | 50 +++ .../added_front.golden | 50 +++ .../added_front_unordered.golden | 50 +++ .../added_middle.golden | 50 +++ .../added_middle_unordered.golden | 50 +++ .../changed_empty_to_null.golden | 15 + .../changed_non-null.golden | 50 +++ .../changed_non-null_to_null.golden | 42 ++ .../changed_null_to_empty.golden | 15 + .../changed_null_to_non-null.golden | 42 ++ .../removed.golden | 43 ++ .../removed_end.golden | 50 +++ .../removed_end_unordered.golden | 50 +++ .../removed_front.golden | 50 +++ .../removed_front_unordered.golden | 50 +++ .../removed_middle.golden | 50 +++ .../removed_middle_unordered.golden | 50 +++ .../shuffled.golden | 24 ++ .../shuffled_added_end.golden | 50 +++ .../shuffled_added_front.golden | 50 +++ .../shuffled_added_middle.golden | 50 +++ .../shuffled_removed_end.golden | 50 +++ .../shuffled_removed_front.golden | 50 +++ .../shuffled_removed_middle.golden | 50 +++ .../shuffled_unordered.golden | 24 ++ .../shuffled_with_duplicates.golden | 25 ++ .../shuffled_with_duplicates_unordered.golden | 25 ++ .../two_added.golden | 62 +++ .../two_removed.golden | 62 +++ .../unchanged_empty.golden | 16 + .../unchanged_non-empty.golden | 18 + .../unchanged_null.golden | 11 + .../added.golden | 40 ++ .../added_end.golden | 71 ++++ .../added_end_unordered.golden | 75 ++++ .../added_front.golden | 75 ++++ .../added_front_unordered.golden | 73 ++++ .../added_middle.golden | 73 ++++ .../added_middle_unordered.golden | 71 ++++ .../changed_empty_to_null.golden | 15 + .../changed_non-null.golden | 49 +++ .../changed_non-null_to_null.golden | 42 ++ .../changed_null_to_empty.golden | 15 + .../changed_null_to_non-null.golden | 41 ++ .../removed.golden | 43 ++ .../removed_end.golden | 72 ++++ .../removed_end_unordered.golden | 76 ++++ .../removed_front.golden | 76 ++++ .../removed_front_unordered.golden | 74 ++++ .../removed_middle.golden | 74 ++++ .../removed_middle_unordered.golden | 74 ++++ .../shuffled.golden | 24 ++ .../shuffled_added_end.golden | 71 ++++ .../shuffled_added_front.golden | 75 ++++ .../shuffled_added_middle.golden | 73 ++++ .../shuffled_removed_end.golden | 72 ++++ .../shuffled_removed_front.golden | 76 ++++ .../shuffled_removed_middle.golden | 74 ++++ .../shuffled_unordered.golden | 24 ++ .../shuffled_with_duplicates.golden | 25 ++ .../shuffled_with_duplicates_unordered.golden | 25 ++ .../two_added.golden | 80 ++++ .../two_removed.golden | 82 ++++ .../unchanged_empty.golden | 16 + .../unchanged_non-empty.golden | 18 + .../unchanged_null.golden | 11 + .../added.golden | 41 ++ .../added_end.golden | 50 +++ .../added_end_unordered.golden | 50 +++ .../added_front.golden | 50 +++ .../added_front_unordered.golden | 50 +++ .../added_middle.golden | 50 +++ .../added_middle_unordered.golden | 50 +++ .../changed_empty_to_null.golden | 15 + .../changed_non-null.golden | 50 +++ .../changed_non-null_to_null.golden | 42 ++ .../changed_null_to_empty.golden | 15 + .../changed_null_to_non-null.golden | 42 ++ .../removed.golden | 43 ++ .../removed_end.golden | 50 +++ .../removed_end_unordered.golden | 50 +++ .../removed_front.golden | 50 +++ .../removed_front_unordered.golden | 50 +++ .../removed_middle.golden | 50 +++ .../removed_middle_unordered.golden | 50 +++ .../shuffled.golden | 24 ++ .../shuffled_added_end.golden | 50 +++ .../shuffled_added_front.golden | 50 +++ .../shuffled_added_middle.golden | 50 +++ .../shuffled_removed_end.golden | 50 +++ .../shuffled_removed_front.golden | 50 +++ .../shuffled_removed_middle.golden | 50 +++ .../shuffled_unordered.golden | 24 ++ .../shuffled_with_duplicates.golden | 25 ++ .../shuffled_with_duplicates_unordered.golden | 25 ++ .../two_added.golden | 62 +++ .../two_removed.golden | 62 +++ .../unchanged_empty.golden | 16 + .../unchanged_non-empty.golden | 18 + .../unchanged_null.golden | 11 + .../added.golden | 40 ++ .../added_end.golden | 71 ++++ .../added_end_unordered.golden | 75 ++++ .../added_front.golden | 75 ++++ .../added_front_unordered.golden | 73 ++++ .../added_middle.golden | 73 ++++ .../added_middle_unordered.golden | 71 ++++ .../changed_empty_to_null.golden | 15 + .../changed_non-null.golden | 49 +++ .../changed_non-null_to_null.golden | 42 ++ .../changed_null_to_empty.golden | 15 + .../changed_null_to_non-null.golden | 41 ++ .../removed.golden | 43 ++ .../removed_end.golden | 72 ++++ .../removed_end_unordered.golden | 76 ++++ .../removed_front.golden | 76 ++++ .../removed_front_unordered.golden | 74 ++++ .../removed_middle.golden | 74 ++++ .../removed_middle_unordered.golden | 74 ++++ .../same_element_updated.golden | 79 ++++ .../same_element_updated_unordered.golden | 77 ++++ .../shuffled.golden | 24 ++ .../shuffled_added_end.golden | 71 ++++ .../shuffled_added_front.golden | 75 ++++ .../shuffled_added_middle.golden | 73 ++++ .../shuffled_removed_end.golden | 72 ++++ .../shuffled_removed_front.golden | 76 ++++ .../shuffled_removed_middle.golden | 74 ++++ .../shuffled_unordered.golden | 24 ++ .../shuffled_with_duplicates.golden | 25 ++ .../shuffled_with_duplicates_unordered.golden | 25 ++ .../two_added.golden | 80 ++++ .../two_added_and_two_removed.golden | 92 +++++ ...d_two_removed_shuffled,_no_overlaps.golden | 92 +++++ ..._two_removed_shuffled,_one_overlaps.golden | 92 +++++ ...o_removed_shuffled,_with_duplicates.golden | 94 +++++ .../two_removed.golden | 82 ++++ .../unchanged_empty.golden | 16 + .../unchanged_non-empty.golden | 18 + .../unchanged_null.golden | 11 + .../added.golden | 41 ++ .../added_end.golden | 50 +++ .../added_end_unordered.golden | 50 +++ .../added_front.golden | 50 +++ .../added_front_unordered.golden | 50 +++ .../added_middle.golden | 50 +++ .../added_middle_unordered.golden | 50 +++ .../changed_empty_to_null.golden | 15 + .../changed_non-null.golden | 50 +++ .../changed_non-null_to_null.golden | 42 ++ .../changed_null_to_empty.golden | 15 + .../changed_null_to_non-null.golden | 42 ++ .../removed.golden | 43 ++ .../removed_end.golden | 50 +++ .../removed_end_unordered.golden | 50 +++ .../removed_front.golden | 50 +++ .../removed_front_unordered.golden | 50 +++ .../removed_middle.golden | 50 +++ .../removed_middle_unordered.golden | 50 +++ .../same_element_updated.golden | 62 +++ .../same_element_updated_unordered.golden | 58 +++ .../shuffled.golden | 24 ++ .../shuffled_added_end.golden | 50 +++ .../shuffled_added_front.golden | 50 +++ .../shuffled_added_middle.golden | 50 +++ .../shuffled_removed_end.golden | 50 +++ .../shuffled_removed_front.golden | 50 +++ .../shuffled_removed_middle.golden | 50 +++ .../shuffled_unordered.golden | 24 ++ .../shuffled_with_duplicates.golden | 25 ++ .../shuffled_with_duplicates_unordered.golden | 25 ++ .../two_added.golden | 62 +++ .../two_added_and_two_removed.golden | 74 ++++ ...d_two_removed_shuffled,_no_overlaps.golden | 74 ++++ ..._two_removed_shuffled,_one_overlaps.golden | 74 ++++ ...o_removed_shuffled,_with_duplicates.golden | 76 ++++ .../two_removed.golden | 62 +++ .../unchanged_empty.golden | 16 + .../unchanged_non-empty.golden | 18 + .../unchanged_null.golden | 11 + .../computed_attribute_force_new/added.golden | 36 ++ .../added_end.golden | 44 +++ .../added_end_unordered.golden | 44 +++ .../added_front.golden | 44 +++ .../added_front_unordered.golden | 44 +++ .../added_middle.golden | 44 +++ .../added_middle_unordered.golden | 44 +++ .../changed_empty_to_null.golden | 15 + .../changed_non-null.golden | 39 ++ .../changed_non-null_to_null.golden | 17 + .../changed_null_to_empty.golden | 15 + .../changed_null_to_non-null.golden | 37 ++ .../removed.golden | 38 ++ .../removed_end.golden | 44 +++ .../removed_end_unordered.golden | 44 +++ .../removed_front.golden | 44 +++ .../removed_front_unordered.golden | 44 +++ .../removed_middle.golden | 44 +++ .../removed_middle_unordered.golden | 44 +++ .../shuffled.golden | 24 ++ .../shuffled_added_end.golden | 44 +++ .../shuffled_added_front.golden | 44 +++ .../shuffled_added_middle.golden | 44 +++ .../shuffled_removed_end.golden | 44 +++ .../shuffled_removed_front.golden | 44 +++ .../shuffled_removed_middle.golden | 44 +++ .../shuffled_unordered.golden | 24 ++ .../shuffled_with_duplicates.golden | 25 ++ .../shuffled_with_duplicates_unordered.golden | 25 ++ .../two_added.golden | 50 +++ .../two_removed.golden | 50 +++ .../unchanged_empty.golden | 16 + .../unchanged_non-empty.golden | 18 + .../unchanged_null.golden | 11 + .../added.golden | 37 ++ .../added_end.golden | 44 +++ .../added_end_unordered.golden | 44 +++ .../added_front.golden | 44 +++ .../added_front_unordered.golden | 44 +++ .../added_middle.golden | 44 +++ .../added_middle_unordered.golden | 44 +++ .../changed_empty_to_null.golden | 15 + .../changed_non-null.golden | 39 ++ .../changed_non-null_to_null.golden | 17 + .../changed_null_to_empty.golden | 35 ++ .../changed_null_to_non-null.golden | 38 ++ .../removed.golden | 38 ++ .../removed_end.golden | 44 +++ .../removed_end_unordered.golden | 44 +++ .../removed_front.golden | 44 +++ .../removed_front_unordered.golden | 44 +++ .../removed_middle.golden | 44 +++ .../removed_middle_unordered.golden | 44 +++ .../same_element_updated.golden | 50 +++ .../same_element_updated_unordered.golden | 46 +++ .../shuffled.golden | 24 ++ .../shuffled_added_end.golden | 44 +++ .../shuffled_added_front.golden | 44 +++ .../shuffled_added_middle.golden | 44 +++ .../shuffled_removed_end.golden | 44 +++ .../shuffled_removed_front.golden | 44 +++ .../shuffled_removed_middle.golden | 44 +++ .../shuffled_unordered.golden | 24 ++ .../shuffled_with_duplicates.golden | 25 ++ .../shuffled_with_duplicates_unordered.golden | 25 ++ .../two_added.golden | 50 +++ .../two_added_and_two_removed.golden | 54 +++ ...d_two_removed_shuffled,_no_overlaps.golden | 54 +++ ..._two_removed_shuffled,_one_overlaps.golden | 54 +++ ...o_removed_shuffled,_with_duplicates.golden | 56 +++ .../two_removed.golden | 50 +++ .../unchanged_empty.golden | 36 ++ .../unchanged_non-empty.golden | 18 + .../unchanged_null.golden | 11 + 507 files changed, 24495 insertions(+), 19 deletions(-) create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_empty_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_non-null_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_null_to_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_null_to_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_with_duplicates.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_with_duplicates_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/two_added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/two_removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/unchanged_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/unchanged_non-empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/unchanged_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_empty_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_non-null_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_null_to_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_null_to_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_with_duplicates.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_with_duplicates_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/two_added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/two_removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/unchanged_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/unchanged_non-empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/unchanged_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_empty_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_non-null_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_null_to_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_null_to_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_with_duplicates.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_with_duplicates_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/two_added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/two_removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/unchanged_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/unchanged_non-empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/unchanged_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_empty_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_non-null_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_null_to_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_null_to_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_with_duplicates.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_with_duplicates_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/two_added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/two_removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/unchanged_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/unchanged_non-empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/unchanged_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_empty_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_non-null_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_null_to_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_null_to_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/same_element_updated.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/same_element_updated_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_with_duplicates.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_with_duplicates_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added_and_two_removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added_and_two_removed_shuffled,_no_overlaps.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added_and_two_removed_shuffled,_one_overlaps.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added_and_two_removed_shuffled,_with_duplicates.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/unchanged_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/unchanged_non-empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/unchanged_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_empty_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_non-null_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_null_to_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_null_to_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/same_element_updated.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/same_element_updated_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_with_duplicates.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_with_duplicates_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added_and_two_removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_no_overlaps.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_one_overlaps.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_with_duplicates.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/unchanged_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/unchanged_non-empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/unchanged_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_empty_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_non-null_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_null_to_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_null_to_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_with_duplicates.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_with_duplicates_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/two_added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/two_removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/unchanged_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/unchanged_non-empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/unchanged_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_empty_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_non-null_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_null_to_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_null_to_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_with_duplicates.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_with_duplicates_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/two_added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/two_removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/unchanged_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/unchanged_non-empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/unchanged_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_empty_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_non-null_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_null_to_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_null_to_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_with_duplicates.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_with_duplicates_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/two_added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/two_removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/unchanged_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/unchanged_non-empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/unchanged_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_empty_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_non-null_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_null_to_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_null_to_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_with_duplicates.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_with_duplicates_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/two_added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/two_removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/unchanged_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/unchanged_non-empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/unchanged_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_empty_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_non-null_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_null_to_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_null_to_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/same_element_updated.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/same_element_updated_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_with_duplicates.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_with_duplicates_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added_and_two_removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added_and_two_removed_shuffled,_no_overlaps.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added_and_two_removed_shuffled,_one_overlaps.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added_and_two_removed_shuffled,_with_duplicates.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/unchanged_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/unchanged_non-empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/unchanged_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_empty_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_non-null_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_null_to_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_null_to_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/same_element_updated.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/same_element_updated_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_with_duplicates.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_with_duplicates_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added_and_two_removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_no_overlaps.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_one_overlaps.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_with_duplicates.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/unchanged_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/unchanged_non-empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/unchanged_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_empty_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_non-null_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_null_to_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_null_to_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_with_duplicates.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_with_duplicates_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/two_added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/two_removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/unchanged_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/unchanged_non-empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/unchanged_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_empty_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_non-null_to_null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_null_to_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_null_to_non-null.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_end_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_front_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_middle_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/same_element_updated.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/same_element_updated_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_added_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_added_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_added_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_removed_end.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_removed_front.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_removed_middle.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_with_duplicates.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_with_duplicates_unordered.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added_and_two_removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added_and_two_removed_shuffled,_no_overlaps.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added_and_two_removed_shuffled,_one_overlaps.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added_and_two_removed_shuffled,_with_duplicates.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_removed.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/unchanged_empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/unchanged_non-empty.golden create mode 100644 pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/unchanged_null.golden diff --git a/pkg/tests/detailed_diff_set_test.go b/pkg/tests/detailed_diff_set_test.go index 874d78208e..f19b19de05 100644 --- a/pkg/tests/detailed_diff_set_test.go +++ b/pkg/tests/detailed_diff_set_test.go @@ -13,6 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hexops/autogold/v2" "github.com/pulumi/pulumi/sdk/v3/go/auto/optpreview" + "github.com/pulumi/pulumi/sdk/v3/go/common/util/contract" "github.com/stretchr/testify/require" "github.com/zclconf/go-cty/cty" @@ -858,6 +859,301 @@ func TestDetailedDiffSet(t *testing.T) { }, } + computedAttributeSchema := schema.Resource{ + Schema: map[string]*schema.Schema{ + "test": { + Type: schema.TypeSet, + Optional: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + CreateContext: func(ctx context.Context, d *schema.ResourceData, i interface{}) diag.Diagnostics { + d.SetId("id") + setHashFunc := d.Get("test").(*schema.Set).F + err := d.Set("test", schema.NewSet(setHashFunc, []interface{}{"computed"})) + contract.Assertf(err == nil, "failed to set attribute: %v", err) + return nil + }, + UpdateContext: func(ctx context.Context, d *schema.ResourceData, i interface{}) diag.Diagnostics { + if d.Get("test") == nil { + setHashFunc := d.Get("test").(*schema.Set).F + err := d.Set("test", schema.NewSet(setHashFunc, []interface{}{"computed"})) + contract.Assertf(err == nil, "failed to set attribute: %v", err) + } + return nil + }, + } + + computedAttributeSchemaForceNew := schema.Resource{ + Schema: map[string]*schema.Schema{ + "test": { + Type: schema.TypeSet, + Optional: true, + Computed: true, + ForceNew: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + CreateContext: func(ctx context.Context, d *schema.ResourceData, i interface{}) diag.Diagnostics { + d.SetId("id") + if d.Get("test") == nil { + err := d.Set("test", schema.NewSet(schema.HashString, []interface{}{"computed"})) + contract.Assertf(err == nil, "failed to set attribute: %v", err) + } + return nil + }, + UpdateContext: func(ctx context.Context, d *schema.ResourceData, i interface{}) diag.Diagnostics { + if d.Get("test") == nil { + err := d.Set("test", schema.NewSet(schema.HashString, []interface{}{"computed"})) + contract.Assertf(err == nil, "failed to set attribute: %v", err) + } + return nil + }, + } + + computedSetBlockAttributeFunc := func(_ context.Context, d *schema.ResourceData, _ interface{}) { + contract.Assertf(d.Get("test") != nil, "test attribute is nil") + testVals := d.Get("test").(*schema.Set).List() + for _, v := range testVals { + val := v.(map[string]interface{}) + if val["computed"] == nil { + compVal := "computed1" + if val["nested"] != nil { + compVal = val["nested"].(string) + } + val["computed"] = compVal + } + } + setHashFunc := d.Get("test").(*schema.Set).F + err := d.Set("test", schema.NewSet(setHashFunc, testVals)) + contract.Assertf(err == nil, "failed to set attribute: %v", err) + } + + computedSetBlockFunc := func(ctx context.Context, d *schema.ResourceData, i interface{}) { + if d.Get("test") == nil { + setHashFunc := d.Get("test").(*schema.Set).F + err := d.Set("test", schema.NewSet(setHashFunc, []interface{}{ + map[string]interface{}{ + "nested": "computed", + "computed": "computed1", + }, + })) + contract.Assertf(err == nil, "failed to set attribute: %v", err) + } else { + computedSetBlockAttributeFunc(ctx, d, i) + } + } + + blockSchemaComputed := schema.Resource{ + Schema: map[string]*schema.Schema{ + "test": { + Type: schema.TypeSet, + Optional: true, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "nested": { + Type: schema.TypeString, + Optional: true, + }, + "computed": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + }, + }, + }, + }, + CreateContext: func(ctx context.Context, d *schema.ResourceData, i interface{}) diag.Diagnostics { + d.SetId("id") + computedSetBlockFunc(ctx, d, i) + return nil + }, + UpdateContext: func(ctx context.Context, d *schema.ResourceData, i interface{}) diag.Diagnostics { + computedSetBlockFunc(ctx, d, i) + return nil + }, + } + + blockSchemaComputedForceNew := schema.Resource{ + Schema: map[string]*schema.Schema{ + "test": { + Type: schema.TypeSet, + Optional: true, + ForceNew: true, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "nested": { + Type: schema.TypeString, + Optional: true, + }, + "computed": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + }, + }, + }, + }, + CreateContext: func(ctx context.Context, d *schema.ResourceData, i interface{}) diag.Diagnostics { + d.SetId("id") + computedSetBlockFunc(ctx, d, i) + return nil + }, + UpdateContext: func(ctx context.Context, d *schema.ResourceData, i interface{}) diag.Diagnostics { + computedSetBlockFunc(ctx, d, i) + return nil + }, + } + + blockSchemaComputedNestedForceNew := schema.Resource{ + Schema: map[string]*schema.Schema{ + "test": { + Type: schema.TypeSet, + Optional: true, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "nested": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, + "computed": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + }, + }, + }, + }, + CreateContext: func(ctx context.Context, d *schema.ResourceData, i interface{}) diag.Diagnostics { + d.SetId("id") + computedSetBlockFunc(ctx, d, i) + return nil + }, + UpdateContext: func(ctx context.Context, d *schema.ResourceData, i interface{}) diag.Diagnostics { + computedSetBlockFunc(ctx, d, i) + return nil + }, + } + + blockSchemaNestedComputed := schema.Resource{ + Schema: map[string]*schema.Schema{ + "test": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "nested": { + Type: schema.TypeString, + Optional: true, + }, + "computed": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + }, + }, + }, + }, + CreateContext: func(ctx context.Context, d *schema.ResourceData, i interface{}) diag.Diagnostics { + d.SetId("id") + if d.Get("test") != nil { + computedSetBlockAttributeFunc(ctx, d, i) + } + return nil + }, + UpdateContext: func(ctx context.Context, d *schema.ResourceData, i interface{}) diag.Diagnostics { + if d.Get("test") != nil { + computedSetBlockAttributeFunc(ctx, d, i) + } + return nil + }, + } + + blockSchemaNestedComputedForceNew := schema.Resource{ + Schema: map[string]*schema.Schema{ + "test": { + Type: schema.TypeSet, + Optional: true, + ForceNew: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "nested": { + Type: schema.TypeString, + Optional: true, + }, + "computed": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + }, + }, + }, + }, + CreateContext: func(ctx context.Context, d *schema.ResourceData, i interface{}) diag.Diagnostics { + d.SetId("id") + if d.Get("test") != nil { + computedSetBlockAttributeFunc(ctx, d, i) + } + return nil + }, + UpdateContext: func(ctx context.Context, d *schema.ResourceData, i interface{}) diag.Diagnostics { + if d.Get("test") != nil { + computedSetBlockAttributeFunc(ctx, d, i) + } + return nil + }, + } + + blockSchemaNestedComputedNestedForceNew := schema.Resource{ + Schema: map[string]*schema.Schema{ + "test": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "nested": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, + "computed": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + }, + }, + }, + }, + CreateContext: func(ctx context.Context, d *schema.ResourceData, i interface{}) diag.Diagnostics { + d.SetId("id") + if d.Get("test") != nil { + computedSetBlockAttributeFunc(ctx, d, i) + } + return nil + }, + UpdateContext: func(ctx context.Context, d *schema.ResourceData, i interface{}) diag.Diagnostics { + if d.Get("test") != nil { + computedSetBlockAttributeFunc(ctx, d, i) + } + return nil + }, + } + attrList := func(arr *[]string) cty.Value { if arr == nil { return cty.NullVal(cty.DynamicPseudoType) @@ -890,30 +1186,67 @@ func TestDetailedDiffSet(t *testing.T) { return cty.ListVal(slice) } - noForceNewSchemaValueMakerPairs := []struct { + nestedAttrListWithComputedSpecified := func(arr *[]string) cty.Value { + if arr == nil { + return cty.NullVal(cty.DynamicPseudoType) + } + + slice := make([]cty.Value, len(*arr)) + for i, v := range *arr { + slice[i] = cty.ObjectVal( + map[string]cty.Value{ + "nested": cty.StringVal(v), + "computed": cty.StringVal("non-computed-" + v), + }, + ) + } + if len(slice) == 0 { + return cty.ListValEmpty(cty.Object(map[string]cty.Type{ + "nested": cty.String, + "computed": cty.String, + })) + } + return cty.ListVal(slice) + } + + type schemaValueMakerPair struct { name string res schema.Resource valueMaker func(*[]string) cty.Value - }{ + } + + type testScenario struct { + name string + initialValue *[]string + changeValue *[]string + } + + noForceNewSchemaValueMakerPairs := []schemaValueMakerPair{ {"attribute no force new", attributeSchema, attrList}, {"block no force new", blockSchema, nestedAttrList}, + {"computed attribute no force new", computedAttributeSchema, attrList}, + {"block with computed no replace", blockSchemaComputed, nestedAttrList}, + {"block with computed no replace computed specified in program", blockSchemaComputed, nestedAttrListWithComputedSpecified}, + {"block with nested computed no replace", blockSchemaNestedComputed, nestedAttrList}, + {"block with nested computed no replace computed specified in program", blockSchemaNestedComputed, nestedAttrListWithComputedSpecified}, } - forceNewSchemaValueMakerPairs := []struct { - name string - res schema.Resource - valueMaker func(*[]string) cty.Value - }{ + forceNewSchemaValueMakerPairs := []schemaValueMakerPair{ {"attribute force new", attributeSchemaForceNew, attrList}, {"block top level force new", blockSchemaForceNew, nestedAttrList}, {"block nested force new", blockSchemaNestedForceNew, nestedAttrList}, + {"computed attribute force new", computedAttributeSchemaForceNew, attrList}, + {"block with computed force new", blockSchemaComputedForceNew, nestedAttrList}, + {"block with computed force new computed specified in program", blockSchemaComputedForceNew, nestedAttrListWithComputedSpecified}, + {"block with computed and nested force new", blockSchemaComputedNestedForceNew, nestedAttrList}, + {"block with computed and nested force new computed specified in program", blockSchemaComputedNestedForceNew, nestedAttrListWithComputedSpecified}, + {"block with nested computed and force new", blockSchemaNestedComputedForceNew, nestedAttrList}, + {"block with nested computed and force new computed specified in program", blockSchemaNestedComputedForceNew, nestedAttrListWithComputedSpecified}, + {"block with nested computed and nested force new", blockSchemaNestedComputedNestedForceNew, nestedAttrList}, + {"block with nested computed and nested force new computed specified in program", blockSchemaNestedComputedNestedForceNew, nestedAttrListWithComputedSpecified}, } - scenarios := []struct { - name string - initialValue *[]string - changeValue *[]string - }{ + scenarios := []testScenario{ {"unchanged non-empty", &[]string{"value"}, &[]string{"value"}}, {"unchanged empty", &[]string{}, &[]string{}}, {"unchanged null", nil, nil}, @@ -941,8 +1274,6 @@ func TestDetailedDiffSet(t *testing.T) { {"added end", &[]string{"val1", "val2"}, &[]string{"val1", "val2", "val3"}}, {"added end unordered", &[]string{"val2", "val3"}, &[]string{"val2", "val3", "val1"}}, - {"same element updated", &[]string{"val1", "val2", "val3"}, &[]string{"val1", "val4", "val3"}}, - {"shuffled", &[]string{"val1", "val2", "val3"}, &[]string{"val3", "val1", "val2"}}, {"shuffled unordered", &[]string{"val2", "val3", "val1"}, &[]string{"val3", "val1", "val2"}}, {"shuffled with duplicates", &[]string{"val1", "val2", "val3"}, &[]string{"val3", "val1", "val2", "val3"}}, @@ -962,11 +1293,8 @@ func TestDetailedDiffSet(t *testing.T) { // TODO[pulumi/pulumi-terraform-bridge#2726]: These tests fail to produce the correct replacement plan // for the force new shcemas - extraScenarios := []struct { - name string - initialValue *[]string - changeValue *[]string - }{ + extraScenarios := []testScenario{ + {"same element updated", &[]string{"val1", "val2", "val3"}, &[]string{"val1", "val4", "val3"}}, {"same element updated unordered", &[]string{"val2", "val3", "val1"}, &[]string{"val2", "val4", "val1"}}, {"two added and two removed", &[]string{"val1", "val2", "val3", "val4"}, &[]string{"val1", "val2", "val5", "val6"}}, {"two added and two removed shuffled, one overlaps", &[]string{"val1", "val2", "val3", "val4"}, &[]string{"val1", "val5", "val6", "val2"}}, diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added.golden new file mode 100644 index 0000000000..94f5561c4d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added.golden @@ -0,0 +1,40 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{"value"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = (known after apply) + + nested = "value" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_end.golden new file mode 100644 index 0000000000..61e7023f48 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_end.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_end_unordered.golden new file mode 100644 index 0000000000..39107993f7 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_end_unordered.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val2" + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_front.golden new file mode 100644 index 0000000000..3a2d9fcbbf --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_front.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val1" + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_front_unordered.golden new file mode 100644 index 0000000000..4f04f29e8c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_front_unordered.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_middle.golden new file mode 100644 index 0000000000..d911436900 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_middle.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_middle_unordered.golden new file mode 100644 index 0000000000..bdac10688e --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_middle_unordered.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_empty_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_empty_to_null.golden new file mode 100644 index 0000000000..7bae19762f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_empty_to_null.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_non-null.golden new file mode 100644 index 0000000000..3c61d1ead0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_non-null.golden @@ -0,0 +1,49 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value1"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "value" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "value1" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "value" => "value1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_non-null_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_non-null_to_null.golden new file mode 100644 index 0000000000..eff89843a0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_non-null_to_null.golden @@ -0,0 +1,17 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_null_to_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_null_to_empty.golden new file mode 100644 index 0000000000..9589fbdf0d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_null_to_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_null_to_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_null_to_non-null.golden new file mode 100644 index 0000000000..7e7fdd2f06 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_null_to_non-null.golden @@ -0,0 +1,41 @@ +tests.testOutput{ + changeValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = (known after apply) + + nested = "value" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed.golden new file mode 100644 index 0000000000..b67f5c3e11 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_end.golden new file mode 100644 index 0000000000..49a4533152 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_end.golden @@ -0,0 +1,72 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_end_unordered.golden new file mode 100644 index 0000000000..11c25ea195 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_end_unordered.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val2" + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_front.golden new file mode 100644 index 0000000000..7e9debb9fb --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_front.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val2" + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_front_unordered.golden new file mode 100644 index 0000000000..b60d9fea30 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_front_unordered.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_middle.golden new file mode 100644 index 0000000000..9c5e259b81 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_middle.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_middle_unordered.golden new file mode 100644 index 0000000000..41194735bd --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_middle_unordered.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + "val2", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled.golden new file mode 100644 index 0000000000..b224442990 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_added_end.golden new file mode 100644 index 0000000000..f4a3a017d6 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_added_end.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val2", + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_added_front.golden new file mode 100644 index 0000000000..220ae18483 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_added_front.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val1" + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_added_middle.golden new file mode 100644 index 0000000000..371fbf7e57 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_added_middle.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_removed_end.golden new file mode 100644 index 0000000000..8bc2fbdd12 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_removed_end.golden @@ -0,0 +1,72 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_removed_front.golden new file mode 100644 index 0000000000..5fc7ca7333 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_removed_front.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val3" + } + ~ [1]: { + ~ nested : "val2" => "val2" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_removed_middle.golden new file mode 100644 index 0000000000..a9a7842386 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_removed_middle.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_unordered.golden new file mode 100644 index 0000000000..d98c381793 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_unordered.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_with_duplicates.golden new file mode 100644 index 0000000000..09d74fe9c7 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_with_duplicates.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_with_duplicates_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_with_duplicates_unordered.golden new file mode 100644 index 0000000000..1011e92c5a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_with_duplicates_unordered.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/two_added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/two_added.golden new file mode 100644 index 0000000000..127e908470 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/two_added.golden @@ -0,0 +1,80 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val4" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + + [3]: { + + nested : "val4" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/two_removed.golden new file mode 100644 index 0000000000..b6f28b4666 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/two_removed.golden @@ -0,0 +1,82 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val4" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + - [3]: { + - computed: "" + - nested : "val4" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/unchanged_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/unchanged_empty.golden new file mode 100644 index 0000000000..7d07227be4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/unchanged_non-empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/unchanged_non-empty.golden new file mode 100644 index 0000000000..a87f03643b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/unchanged_non-empty.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value"}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/unchanged_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/unchanged_null.golden new file mode 100644 index 0000000000..a53fac34db --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/unchanged_null.golden @@ -0,0 +1,11 @@ +tests.testOutput{tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added.golden new file mode 100644 index 0000000000..1de9875a91 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added.golden @@ -0,0 +1,41 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{"value"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-value" + + nested = "value" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + computed : "non-computed-value" + + nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_end.golden new file mode 100644 index 0000000000..9c1af455d9 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_end_unordered.golden new file mode 100644 index 0000000000..5ab2ae62b2 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_end_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_front.golden new file mode 100644 index 0000000000..24ebf37206 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_front_unordered.golden new file mode 100644 index 0000000000..46e0f566a1 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_front_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_middle.golden new file mode 100644 index 0000000000..cb91ff4776 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_middle_unordered.golden new file mode 100644 index 0000000000..b773be1604 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_middle_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_empty_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_empty_to_null.golden new file mode 100644 index 0000000000..7bae19762f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_empty_to_null.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_non-null.golden new file mode 100644 index 0000000000..3d40302c39 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_non-null.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value1"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-value" -> null + - nested = "value" -> null + } + + test { # forces replacement + + computed = "non-computed-value1" + + nested = "value1" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ computed: "non-computed-value" => "non-computed-value1" + ~ nested : "value" => "value1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_non-null_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_non-null_to_null.golden new file mode 100644 index 0000000000..eff89843a0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_non-null_to_null.golden @@ -0,0 +1,17 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_null_to_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_null_to_empty.golden new file mode 100644 index 0000000000..9589fbdf0d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_null_to_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_null_to_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_null_to_non-null.golden new file mode 100644 index 0000000000..e2326c5668 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_null_to_non-null.golden @@ -0,0 +1,42 @@ +tests.testOutput{ + changeValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-value" + + nested = "value" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + computed : "non-computed-value" + + nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed.golden new file mode 100644 index 0000000000..b67f5c3e11 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_end.golden new file mode 100644 index 0000000000..27b631a621 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_end_unordered.golden new file mode 100644 index 0000000000..87c9ced14c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_end_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_front.golden new file mode 100644 index 0000000000..74c0f7468e --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_front_unordered.golden new file mode 100644 index 0000000000..d83c330b0f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_front_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_middle.golden new file mode 100644 index 0000000000..7b3e9ce15b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_middle_unordered.golden new file mode 100644 index 0000000000..8e95109d14 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_middle_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + "val2", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled.golden new file mode 100644 index 0000000000..b224442990 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_end.golden new file mode 100644 index 0000000000..cf125372c0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val2", + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_front.golden new file mode 100644 index 0000000000..c8d7a3a0f2 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_middle.golden new file mode 100644 index 0000000000..373c6cff92 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_end.golden new file mode 100644 index 0000000000..9ec766ae52 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_front.golden new file mode 100644 index 0000000000..1a4103a073 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_middle.golden new file mode 100644 index 0000000000..40b9ff67a5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_unordered.golden new file mode 100644 index 0000000000..d98c381793 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_unordered.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_with_duplicates.golden new file mode 100644 index 0000000000..09d74fe9c7 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_with_duplicates.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_with_duplicates_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_with_duplicates_unordered.golden new file mode 100644 index 0000000000..1011e92c5a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_with_duplicates_unordered.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/two_added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/two_added.golden new file mode 100644 index 0000000000..353e54999c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/two_added.golden @@ -0,0 +1,62 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val3" + + nested = "val3" + } + + test { # forces replacement + + computed = "non-computed-val4" + + nested = "val4" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + + [3]: { + + computed : "non-computed-val4" + + nested : "val4" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/two_removed.golden new file mode 100644 index 0000000000..fa8851ce6b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/two_removed.golden @@ -0,0 +1,62 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + - test { # forces replacement + - computed = "non-computed-val4" -> null + - nested = "val4" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + - [3]: { + - computed: "non-computed-val4" + - nested : "val4" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/unchanged_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/unchanged_empty.golden new file mode 100644 index 0000000000..7d07227be4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/unchanged_non-empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/unchanged_non-empty.golden new file mode 100644 index 0000000000..a87f03643b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/unchanged_non-empty.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value"}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/unchanged_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/unchanged_null.golden new file mode 100644 index 0000000000..a53fac34db --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/unchanged_null.golden @@ -0,0 +1,11 @@ +tests.testOutput{tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added.golden new file mode 100644 index 0000000000..94f5561c4d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added.golden @@ -0,0 +1,40 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{"value"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = (known after apply) + + nested = "value" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_end.golden new file mode 100644 index 0000000000..61e7023f48 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_end.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_end_unordered.golden new file mode 100644 index 0000000000..4a6c7975f5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_end_unordered.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val2" + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_front.golden new file mode 100644 index 0000000000..6c3c3e0390 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_front.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val1" + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_front_unordered.golden new file mode 100644 index 0000000000..a2a38aeba4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_front_unordered.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_middle.golden new file mode 100644 index 0000000000..23cedb220b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_middle.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_middle_unordered.golden new file mode 100644 index 0000000000..bdac10688e --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_middle_unordered.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_empty_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_empty_to_null.golden new file mode 100644 index 0000000000..7bae19762f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_empty_to_null.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_non-null.golden new file mode 100644 index 0000000000..0170773e43 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_non-null.golden @@ -0,0 +1,49 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value1"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "value" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "value1" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "value" => "value1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_non-null_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_non-null_to_null.golden new file mode 100644 index 0000000000..eff89843a0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_non-null_to_null.golden @@ -0,0 +1,17 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_null_to_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_null_to_empty.golden new file mode 100644 index 0000000000..9589fbdf0d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_null_to_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_null_to_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_null_to_non-null.golden new file mode 100644 index 0000000000..7e7fdd2f06 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_null_to_non-null.golden @@ -0,0 +1,41 @@ +tests.testOutput{ + changeValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = (known after apply) + + nested = "value" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed.golden new file mode 100644 index 0000000000..b67f5c3e11 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_end.golden new file mode 100644 index 0000000000..49a4533152 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_end.golden @@ -0,0 +1,72 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_end_unordered.golden new file mode 100644 index 0000000000..27a71d3d40 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_end_unordered.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val2" + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_front.golden new file mode 100644 index 0000000000..f908561673 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_front.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val2" + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_front_unordered.golden new file mode 100644 index 0000000000..57799de1f0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_front_unordered.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_middle.golden new file mode 100644 index 0000000000..648c2e19c0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_middle.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_middle_unordered.golden new file mode 100644 index 0000000000..f89fa4b2b0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_middle_unordered.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + "val2", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled.golden new file mode 100644 index 0000000000..b224442990 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_added_end.golden new file mode 100644 index 0000000000..f4a3a017d6 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_added_end.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val2", + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_added_front.golden new file mode 100644 index 0000000000..b93394a268 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_added_front.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val1" + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_added_middle.golden new file mode 100644 index 0000000000..0f251e5b69 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_added_middle.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_removed_end.golden new file mode 100644 index 0000000000..8bc2fbdd12 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_removed_end.golden @@ -0,0 +1,72 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_removed_front.golden new file mode 100644 index 0000000000..1930e4f5ca --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_removed_front.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val3" + } + ~ [1]: { + ~ nested : "val2" => "val2" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_removed_middle.golden new file mode 100644 index 0000000000..0f33d25b05 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_removed_middle.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_unordered.golden new file mode 100644 index 0000000000..d98c381793 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_unordered.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_with_duplicates.golden new file mode 100644 index 0000000000..09d74fe9c7 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_with_duplicates.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_with_duplicates_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_with_duplicates_unordered.golden new file mode 100644 index 0000000000..1011e92c5a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_with_duplicates_unordered.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/two_added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/two_added.golden new file mode 100644 index 0000000000..127e908470 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/two_added.golden @@ -0,0 +1,80 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val4" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + + [3]: { + + nested : "val4" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/two_removed.golden new file mode 100644 index 0000000000..b6f28b4666 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/two_removed.golden @@ -0,0 +1,82 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val4" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + - [3]: { + - computed: "" + - nested : "val4" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/unchanged_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/unchanged_empty.golden new file mode 100644 index 0000000000..7d07227be4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/unchanged_non-empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/unchanged_non-empty.golden new file mode 100644 index 0000000000..a87f03643b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/unchanged_non-empty.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value"}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/unchanged_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/unchanged_null.golden new file mode 100644 index 0000000000..a53fac34db --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/unchanged_null.golden @@ -0,0 +1,11 @@ +tests.testOutput{tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added.golden new file mode 100644 index 0000000000..1de9875a91 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added.golden @@ -0,0 +1,41 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{"value"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-value" + + nested = "value" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + computed : "non-computed-value" + + nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_end.golden new file mode 100644 index 0000000000..9c1af455d9 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_end_unordered.golden new file mode 100644 index 0000000000..5ab2ae62b2 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_end_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_front.golden new file mode 100644 index 0000000000..24ebf37206 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_front_unordered.golden new file mode 100644 index 0000000000..46e0f566a1 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_front_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_middle.golden new file mode 100644 index 0000000000..cb91ff4776 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_middle_unordered.golden new file mode 100644 index 0000000000..b773be1604 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_middle_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_empty_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_empty_to_null.golden new file mode 100644 index 0000000000..7bae19762f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_empty_to_null.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_non-null.golden new file mode 100644 index 0000000000..89c888348c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_non-null.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value1"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-value" -> null + - nested = "value" -> null + } + + test { + + computed = "non-computed-value1" + + nested = "value1" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ computed: "non-computed-value" => "non-computed-value1" + ~ nested : "value" => "value1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_non-null_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_non-null_to_null.golden new file mode 100644 index 0000000000..eff89843a0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_non-null_to_null.golden @@ -0,0 +1,17 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_null_to_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_null_to_empty.golden new file mode 100644 index 0000000000..9589fbdf0d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_null_to_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_null_to_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_null_to_non-null.golden new file mode 100644 index 0000000000..e2326c5668 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_null_to_non-null.golden @@ -0,0 +1,42 @@ +tests.testOutput{ + changeValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-value" + + nested = "value" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + computed : "non-computed-value" + + nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed.golden new file mode 100644 index 0000000000..b67f5c3e11 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_end.golden new file mode 100644 index 0000000000..27b631a621 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_end_unordered.golden new file mode 100644 index 0000000000..87c9ced14c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_end_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_front.golden new file mode 100644 index 0000000000..74c0f7468e --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_front_unordered.golden new file mode 100644 index 0000000000..d83c330b0f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_front_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_middle.golden new file mode 100644 index 0000000000..7b3e9ce15b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_middle_unordered.golden new file mode 100644 index 0000000000..8e95109d14 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_middle_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + "val2", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled.golden new file mode 100644 index 0000000000..b224442990 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_added_end.golden new file mode 100644 index 0000000000..cf125372c0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_added_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val2", + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_added_front.golden new file mode 100644 index 0000000000..c8d7a3a0f2 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_added_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_added_middle.golden new file mode 100644 index 0000000000..373c6cff92 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_added_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_removed_end.golden new file mode 100644 index 0000000000..9ec766ae52 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_removed_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_removed_front.golden new file mode 100644 index 0000000000..1a4103a073 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_removed_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_removed_middle.golden new file mode 100644 index 0000000000..40b9ff67a5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_removed_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_unordered.golden new file mode 100644 index 0000000000..d98c381793 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_unordered.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_with_duplicates.golden new file mode 100644 index 0000000000..09d74fe9c7 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_with_duplicates.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_with_duplicates_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_with_duplicates_unordered.golden new file mode 100644 index 0000000000..1011e92c5a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_with_duplicates_unordered.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/two_added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/two_added.golden new file mode 100644 index 0000000000..353e54999c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/two_added.golden @@ -0,0 +1,62 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val3" + + nested = "val3" + } + + test { # forces replacement + + computed = "non-computed-val4" + + nested = "val4" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + + [3]: { + + computed : "non-computed-val4" + + nested : "val4" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/two_removed.golden new file mode 100644 index 0000000000..fa8851ce6b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/two_removed.golden @@ -0,0 +1,62 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + - test { # forces replacement + - computed = "non-computed-val4" -> null + - nested = "val4" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + - [3]: { + - computed: "non-computed-val4" + - nested : "val4" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/unchanged_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/unchanged_empty.golden new file mode 100644 index 0000000000..7d07227be4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/unchanged_non-empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/unchanged_non-empty.golden new file mode 100644 index 0000000000..a87f03643b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/unchanged_non-empty.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value"}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/unchanged_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/unchanged_null.golden new file mode 100644 index 0000000000..a53fac34db --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/unchanged_null.golden @@ -0,0 +1,11 @@ +tests.testOutput{tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added.golden new file mode 100644 index 0000000000..8a0de22728 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added.golden @@ -0,0 +1,40 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{"value"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = (known after apply) + + nested = "value" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + nested : "value" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_end.golden new file mode 100644 index 0000000000..f16128f511 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_end.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_end_unordered.golden new file mode 100644 index 0000000000..9eee2d69d3 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_end_unordered.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val2" + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_front.golden new file mode 100644 index 0000000000..1ee158309a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_front.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val1" + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_front_unordered.golden new file mode 100644 index 0000000000..a81fe2957b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_front_unordered.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_middle.golden new file mode 100644 index 0000000000..be8c5fc653 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_middle.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_middle_unordered.golden new file mode 100644 index 0000000000..e18bd28d0d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_middle_unordered.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_empty_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_empty_to_null.golden new file mode 100644 index 0000000000..7bae19762f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_empty_to_null.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_non-null.golden new file mode 100644 index 0000000000..0170773e43 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_non-null.golden @@ -0,0 +1,49 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value1"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "value" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "value1" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "value" => "value1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_non-null_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_non-null_to_null.golden new file mode 100644 index 0000000000..eff89843a0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_non-null_to_null.golden @@ -0,0 +1,17 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_null_to_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_null_to_empty.golden new file mode 100644 index 0000000000..9589fbdf0d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_null_to_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_null_to_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_null_to_non-null.golden new file mode 100644 index 0000000000..2672c4e434 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_null_to_non-null.golden @@ -0,0 +1,41 @@ +tests.testOutput{ + changeValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = (known after apply) + + nested = "value" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + nested : "value" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed.golden new file mode 100644 index 0000000000..b67f5c3e11 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_end.golden new file mode 100644 index 0000000000..cb5cf4ecea --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_end.golden @@ -0,0 +1,72 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_end_unordered.golden new file mode 100644 index 0000000000..899c8114bf --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_end_unordered.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val2" + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_front.golden new file mode 100644 index 0000000000..f3b02f42d3 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_front.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val2" + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_front_unordered.golden new file mode 100644 index 0000000000..16a35f8b67 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_front_unordered.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_middle.golden new file mode 100644 index 0000000000..d799448f40 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_middle.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_middle_unordered.golden new file mode 100644 index 0000000000..dabc5aebc0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_middle_unordered.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + "val2", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/same_element_updated.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/same_element_updated.golden new file mode 100644 index 0000000000..9b8aa8b52b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/same_element_updated.golden @@ -0,0 +1,79 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val4", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + + test { + + computed = (known after apply) + + nested = "val4" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val4" + } + ~ [2]: { + ~ nested : "val3" => "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/same_element_updated_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/same_element_updated_unordered.golden new file mode 100644 index 0000000000..be19e29c7e --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/same_element_updated_unordered.golden @@ -0,0 +1,77 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val4", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val4" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + ~ [2]: { + ~ nested : "val3" => "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled.golden new file mode 100644 index 0000000000..b224442990 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_added_end.golden new file mode 100644 index 0000000000..83564177f7 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_added_end.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val2", + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_added_front.golden new file mode 100644 index 0000000000..8b796bce2e --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_added_front.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val1" + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_added_middle.golden new file mode 100644 index 0000000000..43f337249e --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_added_middle.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_removed_end.golden new file mode 100644 index 0000000000..39a2205170 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_removed_end.golden @@ -0,0 +1,72 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_removed_front.golden new file mode 100644 index 0000000000..acb278d4c5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_removed_front.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val3" + } + ~ [1]: { + ~ nested : "val2" => "val2" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_removed_middle.golden new file mode 100644 index 0000000000..323e01ff96 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_removed_middle.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_unordered.golden new file mode 100644 index 0000000000..d98c381793 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_unordered.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_with_duplicates.golden new file mode 100644 index 0000000000..09d74fe9c7 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_with_duplicates.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_with_duplicates_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_with_duplicates_unordered.golden new file mode 100644 index 0000000000..1011e92c5a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_with_duplicates_unordered.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added.golden new file mode 100644 index 0000000000..1637ef2333 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added.golden @@ -0,0 +1,80 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + + test { + + computed = (known after apply) + + nested = "val4" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + + [3]: { + + nested : "val4" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + "tests[3]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added_and_two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added_and_two_removed.golden new file mode 100644 index 0000000000..78e89cb3f6 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added_and_two_removed.golden @@ -0,0 +1,92 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + "val5", + "val6", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val4" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val5" + } + + test { + + computed = (known after apply) + + nested = "val6" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + ~ [2]: { + ~ nested : "val3" => "val5" + } + ~ [3]: { + ~ nested : "val4" => "val6" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added_and_two_removed_shuffled,_no_overlaps.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added_and_two_removed_shuffled,_no_overlaps.golden new file mode 100644 index 0000000000..9f1fdbf0bd --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added_and_two_removed_shuffled,_no_overlaps.golden @@ -0,0 +1,92 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val5", + "val6", + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val4" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val5" + } + + test { + + computed = (known after apply) + + nested = "val6" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + ~ [2]: { + ~ nested : "val3" => "val1" + } + ~ [3]: { + ~ nested : "val4" => "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added_and_two_removed_shuffled,_one_overlaps.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added_and_two_removed_shuffled,_one_overlaps.golden new file mode 100644 index 0000000000..09c91c9a51 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added_and_two_removed_shuffled,_one_overlaps.golden @@ -0,0 +1,92 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val5", + "val6", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val4" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val5" + } + + test { + + computed = (known after apply) + + nested = "val6" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + ~ [2]: { + ~ nested : "val3" => "val6" + } + ~ [3]: { + ~ nested : "val4" => "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added_and_two_removed_shuffled,_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added_and_two_removed_shuffled,_with_duplicates.golden new file mode 100644 index 0000000000..03a4d2a37c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added_and_two_removed_shuffled,_with_duplicates.golden @@ -0,0 +1,94 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val5", + "val6", + "val2", + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val4" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val5" + } + + test { + + computed = (known after apply) + + nested = "val6" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + ~ [2]: { + ~ nested : "val3" => "val6" + } + ~ [3]: { + ~ nested : "val4" => "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_removed.golden new file mode 100644 index 0000000000..6677548c8c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_removed.golden @@ -0,0 +1,82 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val4" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + - [3]: { + - computed: "" + - nested : "val4" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + "tests[3]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/unchanged_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/unchanged_empty.golden new file mode 100644 index 0000000000..7d07227be4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/unchanged_non-empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/unchanged_non-empty.golden new file mode 100644 index 0000000000..a87f03643b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/unchanged_non-empty.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value"}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/unchanged_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/unchanged_null.golden new file mode 100644 index 0000000000..a53fac34db --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/unchanged_null.golden @@ -0,0 +1,11 @@ +tests.testOutput{tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added.golden new file mode 100644 index 0000000000..9c107c39eb --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added.golden @@ -0,0 +1,41 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{"value"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-value" + + nested = "value" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + computed : "non-computed-value" + + nested : "value" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_end.golden new file mode 100644 index 0000000000..66fbc1c2d5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_end_unordered.golden new file mode 100644 index 0000000000..b1236f0902 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_end_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_front.golden new file mode 100644 index 0000000000..9a86837647 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_front_unordered.golden new file mode 100644 index 0000000000..33112977a6 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_front_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_middle.golden new file mode 100644 index 0000000000..3fa147fc4e --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_middle_unordered.golden new file mode 100644 index 0000000000..bb02e047a6 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_middle_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_empty_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_empty_to_null.golden new file mode 100644 index 0000000000..7bae19762f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_empty_to_null.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_non-null.golden new file mode 100644 index 0000000000..89c888348c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_non-null.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value1"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-value" -> null + - nested = "value" -> null + } + + test { + + computed = "non-computed-value1" + + nested = "value1" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ computed: "non-computed-value" => "non-computed-value1" + ~ nested : "value" => "value1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_non-null_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_non-null_to_null.golden new file mode 100644 index 0000000000..eff89843a0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_non-null_to_null.golden @@ -0,0 +1,17 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_null_to_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_null_to_empty.golden new file mode 100644 index 0000000000..9589fbdf0d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_null_to_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_null_to_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_null_to_non-null.golden new file mode 100644 index 0000000000..238c8dba3b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_null_to_non-null.golden @@ -0,0 +1,42 @@ +tests.testOutput{ + changeValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-value" + + nested = "value" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + computed : "non-computed-value" + + nested : "value" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed.golden new file mode 100644 index 0000000000..b67f5c3e11 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_end.golden new file mode 100644 index 0000000000..101d829f4f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_end_unordered.golden new file mode 100644 index 0000000000..d3921213cc --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_end_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_front.golden new file mode 100644 index 0000000000..95cec62f95 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_front_unordered.golden new file mode 100644 index 0000000000..4ce1bb1bb0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_front_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_middle.golden new file mode 100644 index 0000000000..e27759e65c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_middle_unordered.golden new file mode 100644 index 0000000000..71aca2ff62 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_middle_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + "val2", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/same_element_updated.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/same_element_updated.golden new file mode 100644 index 0000000000..0963444122 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/same_element_updated.golden @@ -0,0 +1,62 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val4", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + test { + + computed = "non-computed-val4" + + nested = "val4" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[1]": map[string]interface{}{"kind": "DELETE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/same_element_updated_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/same_element_updated_unordered.golden new file mode 100644 index 0000000000..855997ff75 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/same_element_updated_unordered.golden @@ -0,0 +1,58 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val4", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + + test { + + computed = "non-computed-val4" + + nested = "val4" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [2]: { + ~ computed: "non-computed-val3" => "non-computed-val1" + ~ nested : "val3" => "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled.golden new file mode 100644 index 0000000000..b224442990 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_added_end.golden new file mode 100644 index 0000000000..ae58b0bccc --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_added_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val2", + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_added_front.golden new file mode 100644 index 0000000000..c73db179d9 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_added_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_added_middle.golden new file mode 100644 index 0000000000..ccd82694be --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_added_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_removed_end.golden new file mode 100644 index 0000000000..8741a83c67 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_removed_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_removed_front.golden new file mode 100644 index 0000000000..e0d9d13c46 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_removed_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_removed_middle.golden new file mode 100644 index 0000000000..19dd48fb4f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_removed_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_unordered.golden new file mode 100644 index 0000000000..d98c381793 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_unordered.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_with_duplicates.golden new file mode 100644 index 0000000000..09d74fe9c7 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_with_duplicates.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_with_duplicates_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_with_duplicates_unordered.golden new file mode 100644 index 0000000000..1011e92c5a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_with_duplicates_unordered.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added.golden new file mode 100644 index 0000000000..e43424e12d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added.golden @@ -0,0 +1,62 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val3" + + nested = "val3" + } + + test { + + computed = "non-computed-val4" + + nested = "val4" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + + [3]: { + + computed : "non-computed-val4" + + nested : "val4" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{}, + "tests[3]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added_and_two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added_and_two_removed.golden new file mode 100644 index 0000000000..fc533b2c3a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added_and_two_removed.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + "val5", + "val6", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + - test { + - computed = "non-computed-val4" -> null + - nested = "val4" -> null + } + + test { + + computed = "non-computed-val5" + + nested = "val5" + } + + test { + + computed = "non-computed-val6" + + nested = "val6" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [2]: { + ~ computed: "non-computed-val3" => "non-computed-val5" + ~ nested : "val3" => "val5" + } + ~ [3]: { + ~ computed: "non-computed-val4" => "non-computed-val6" + ~ nested : "val4" => "val6" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_no_overlaps.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_no_overlaps.golden new file mode 100644 index 0000000000..91b3776e3b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_no_overlaps.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val5", + "val6", + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + - test { + - computed = "non-computed-val4" -> null + - nested = "val4" -> null + } + + test { + + computed = "non-computed-val5" + + nested = "val5" + } + + test { + + computed = "non-computed-val6" + + nested = "val6" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [2]: { + ~ computed: "non-computed-val3" => "non-computed-val1" + ~ nested : "val3" => "val1" + } + ~ [3]: { + ~ computed: "non-computed-val4" => "non-computed-val2" + ~ nested : "val4" => "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_one_overlaps.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_one_overlaps.golden new file mode 100644 index 0000000000..872a2178de --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_one_overlaps.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val5", + "val6", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + - test { + - computed = "non-computed-val4" -> null + - nested = "val4" -> null + } + + test { + + computed = "non-computed-val5" + + nested = "val5" + } + + test { + + computed = "non-computed-val6" + + nested = "val6" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [2]: { + ~ computed: "non-computed-val3" => "non-computed-val6" + ~ nested : "val3" => "val6" + } + ~ [3]: { + ~ computed: "non-computed-val4" => "non-computed-val2" + ~ nested : "val4" => "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_with_duplicates.golden new file mode 100644 index 0000000000..82ff7cf7c9 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_with_duplicates.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val5", + "val6", + "val2", + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + - test { + - computed = "non-computed-val4" -> null + - nested = "val4" -> null + } + + test { + + computed = "non-computed-val5" + + nested = "val5" + } + + test { + + computed = "non-computed-val6" + + nested = "val6" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [2]: { + ~ computed: "non-computed-val3" => "non-computed-val6" + ~ nested : "val3" => "val6" + } + ~ [3]: { + ~ computed: "non-computed-val4" => "non-computed-val2" + ~ nested : "val4" => "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_removed.golden new file mode 100644 index 0000000000..b811014c91 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_removed.golden @@ -0,0 +1,62 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + - test { + - computed = "non-computed-val4" -> null + - nested = "val4" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + - [3]: { + - computed: "non-computed-val4" + - nested : "val4" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + "tests[3]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/unchanged_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/unchanged_empty.golden new file mode 100644 index 0000000000..7d07227be4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/unchanged_non-empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/unchanged_non-empty.golden new file mode 100644 index 0000000000..a87f03643b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/unchanged_non-empty.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value"}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/unchanged_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/unchanged_null.golden new file mode 100644 index 0000000000..a53fac34db --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/unchanged_null.golden @@ -0,0 +1,11 @@ +tests.testOutput{tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added.golden new file mode 100644 index 0000000000..94f5561c4d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added.golden @@ -0,0 +1,40 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{"value"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = (known after apply) + + nested = "value" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_end.golden new file mode 100644 index 0000000000..61e7023f48 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_end.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_end_unordered.golden new file mode 100644 index 0000000000..4a6c7975f5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_end_unordered.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val2" + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_front.golden new file mode 100644 index 0000000000..6c3c3e0390 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_front.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val1" + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_front_unordered.golden new file mode 100644 index 0000000000..a2a38aeba4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_front_unordered.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_middle.golden new file mode 100644 index 0000000000..23cedb220b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_middle.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_middle_unordered.golden new file mode 100644 index 0000000000..bdac10688e --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_middle_unordered.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_empty_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_empty_to_null.golden new file mode 100644 index 0000000000..7bae19762f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_empty_to_null.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_non-null.golden new file mode 100644 index 0000000000..0170773e43 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_non-null.golden @@ -0,0 +1,49 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value1"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "value" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "value1" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "value" => "value1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_non-null_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_non-null_to_null.golden new file mode 100644 index 0000000000..5164e9405d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_non-null_to_null.golden @@ -0,0 +1,42 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "value" -> null + # (1 unchanged attribute hidden) + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - tests: [ + - [0]: { + - computed: "" + - nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_null_to_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_null_to_empty.golden new file mode 100644 index 0000000000..9589fbdf0d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_null_to_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_null_to_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_null_to_non-null.golden new file mode 100644 index 0000000000..7e7fdd2f06 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_null_to_non-null.golden @@ -0,0 +1,41 @@ +tests.testOutput{ + changeValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = (known after apply) + + nested = "value" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed.golden new file mode 100644 index 0000000000..be31441b25 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed.golden @@ -0,0 +1,43 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "value" -> null + # (1 unchanged attribute hidden) + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - tests: [ + - [0]: { + - computed: "" + - nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_end.golden new file mode 100644 index 0000000000..49a4533152 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_end.golden @@ -0,0 +1,72 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_end_unordered.golden new file mode 100644 index 0000000000..27a71d3d40 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_end_unordered.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val2" + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_front.golden new file mode 100644 index 0000000000..f908561673 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_front.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val2" + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_front_unordered.golden new file mode 100644 index 0000000000..57799de1f0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_front_unordered.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_middle.golden new file mode 100644 index 0000000000..648c2e19c0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_middle.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_middle_unordered.golden new file mode 100644 index 0000000000..f89fa4b2b0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_middle_unordered.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + "val2", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled.golden new file mode 100644 index 0000000000..b224442990 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_added_end.golden new file mode 100644 index 0000000000..f4a3a017d6 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_added_end.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val2", + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_added_front.golden new file mode 100644 index 0000000000..b93394a268 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_added_front.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val1" + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_added_middle.golden new file mode 100644 index 0000000000..0f251e5b69 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_added_middle.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_removed_end.golden new file mode 100644 index 0000000000..8bc2fbdd12 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_removed_end.golden @@ -0,0 +1,72 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_removed_front.golden new file mode 100644 index 0000000000..1930e4f5ca --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_removed_front.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val3" + } + ~ [1]: { + ~ nested : "val2" => "val2" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_removed_middle.golden new file mode 100644 index 0000000000..0f33d25b05 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_removed_middle.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_unordered.golden new file mode 100644 index 0000000000..d98c381793 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_unordered.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_with_duplicates.golden new file mode 100644 index 0000000000..09d74fe9c7 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_with_duplicates.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_with_duplicates_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_with_duplicates_unordered.golden new file mode 100644 index 0000000000..1011e92c5a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_with_duplicates_unordered.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/two_added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/two_added.golden new file mode 100644 index 0000000000..127e908470 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/two_added.golden @@ -0,0 +1,80 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val4" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + + [3]: { + + nested : "val4" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/two_removed.golden new file mode 100644 index 0000000000..b6f28b4666 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/two_removed.golden @@ -0,0 +1,82 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val4" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + - [3]: { + - computed: "" + - nested : "val4" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/unchanged_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/unchanged_empty.golden new file mode 100644 index 0000000000..7d07227be4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/unchanged_non-empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/unchanged_non-empty.golden new file mode 100644 index 0000000000..a87f03643b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/unchanged_non-empty.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value"}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/unchanged_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/unchanged_null.golden new file mode 100644 index 0000000000..a53fac34db --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/unchanged_null.golden @@ -0,0 +1,11 @@ +tests.testOutput{tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added.golden new file mode 100644 index 0000000000..1de9875a91 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added.golden @@ -0,0 +1,41 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{"value"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-value" + + nested = "value" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + computed : "non-computed-value" + + nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_end.golden new file mode 100644 index 0000000000..9c1af455d9 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_end_unordered.golden new file mode 100644 index 0000000000..5ab2ae62b2 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_end_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_front.golden new file mode 100644 index 0000000000..24ebf37206 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_front_unordered.golden new file mode 100644 index 0000000000..46e0f566a1 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_front_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_middle.golden new file mode 100644 index 0000000000..cb91ff4776 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_middle_unordered.golden new file mode 100644 index 0000000000..b773be1604 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_middle_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_empty_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_empty_to_null.golden new file mode 100644 index 0000000000..7bae19762f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_empty_to_null.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_non-null.golden new file mode 100644 index 0000000000..89c888348c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_non-null.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value1"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-value" -> null + - nested = "value" -> null + } + + test { + + computed = "non-computed-value1" + + nested = "value1" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ computed: "non-computed-value" => "non-computed-value1" + ~ nested : "value" => "value1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_non-null_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_non-null_to_null.golden new file mode 100644 index 0000000000..e1cbce6121 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_non-null_to_null.golden @@ -0,0 +1,42 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-value" -> null + - nested = "value" -> null + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - tests: [ + - [0]: { + - computed: "non-computed-value" + - nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_null_to_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_null_to_empty.golden new file mode 100644 index 0000000000..9589fbdf0d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_null_to_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_null_to_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_null_to_non-null.golden new file mode 100644 index 0000000000..e2326c5668 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_null_to_non-null.golden @@ -0,0 +1,42 @@ +tests.testOutput{ + changeValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-value" + + nested = "value" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + computed : "non-computed-value" + + nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed.golden new file mode 100644 index 0000000000..ea57b60682 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed.golden @@ -0,0 +1,43 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-value" -> null + - nested = "value" -> null + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - tests: [ + - [0]: { + - computed: "non-computed-value" + - nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_end.golden new file mode 100644 index 0000000000..27b631a621 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_end_unordered.golden new file mode 100644 index 0000000000..87c9ced14c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_end_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_front.golden new file mode 100644 index 0000000000..74c0f7468e --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_front_unordered.golden new file mode 100644 index 0000000000..d83c330b0f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_front_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_middle.golden new file mode 100644 index 0000000000..7b3e9ce15b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_middle_unordered.golden new file mode 100644 index 0000000000..8e95109d14 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_middle_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + "val2", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled.golden new file mode 100644 index 0000000000..b224442990 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_added_end.golden new file mode 100644 index 0000000000..cf125372c0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_added_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val2", + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_added_front.golden new file mode 100644 index 0000000000..c8d7a3a0f2 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_added_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_added_middle.golden new file mode 100644 index 0000000000..373c6cff92 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_added_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_removed_end.golden new file mode 100644 index 0000000000..9ec766ae52 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_removed_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_removed_front.golden new file mode 100644 index 0000000000..1a4103a073 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_removed_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_removed_middle.golden new file mode 100644 index 0000000000..40b9ff67a5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_removed_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_unordered.golden new file mode 100644 index 0000000000..d98c381793 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_unordered.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_with_duplicates.golden new file mode 100644 index 0000000000..09d74fe9c7 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_with_duplicates.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_with_duplicates_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_with_duplicates_unordered.golden new file mode 100644 index 0000000000..1011e92c5a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_with_duplicates_unordered.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/two_added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/two_added.golden new file mode 100644 index 0000000000..353e54999c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/two_added.golden @@ -0,0 +1,62 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val3" + + nested = "val3" + } + + test { # forces replacement + + computed = "non-computed-val4" + + nested = "val4" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + + [3]: { + + computed : "non-computed-val4" + + nested : "val4" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/two_removed.golden new file mode 100644 index 0000000000..fa8851ce6b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/two_removed.golden @@ -0,0 +1,62 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + - test { # forces replacement + - computed = "non-computed-val4" -> null + - nested = "val4" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + - [3]: { + - computed: "non-computed-val4" + - nested : "val4" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/unchanged_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/unchanged_empty.golden new file mode 100644 index 0000000000..7d07227be4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/unchanged_non-empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/unchanged_non-empty.golden new file mode 100644 index 0000000000..a87f03643b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/unchanged_non-empty.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value"}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/unchanged_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/unchanged_null.golden new file mode 100644 index 0000000000..a53fac34db --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/unchanged_null.golden @@ -0,0 +1,11 @@ +tests.testOutput{tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added.golden new file mode 100644 index 0000000000..94f5561c4d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added.golden @@ -0,0 +1,40 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{"value"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = (known after apply) + + nested = "value" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_end.golden new file mode 100644 index 0000000000..61e7023f48 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_end.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_end_unordered.golden new file mode 100644 index 0000000000..39107993f7 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_end_unordered.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val2" + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_front.golden new file mode 100644 index 0000000000..3a2d9fcbbf --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_front.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val1" + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_front_unordered.golden new file mode 100644 index 0000000000..4f04f29e8c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_front_unordered.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_middle.golden new file mode 100644 index 0000000000..d911436900 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_middle.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_middle_unordered.golden new file mode 100644 index 0000000000..bdac10688e --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_middle_unordered.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_empty_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_empty_to_null.golden new file mode 100644 index 0000000000..7bae19762f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_empty_to_null.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_non-null.golden new file mode 100644 index 0000000000..3c61d1ead0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_non-null.golden @@ -0,0 +1,49 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value1"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "value" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "value1" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "value" => "value1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_non-null_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_non-null_to_null.golden new file mode 100644 index 0000000000..5164e9405d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_non-null_to_null.golden @@ -0,0 +1,42 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "value" -> null + # (1 unchanged attribute hidden) + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - tests: [ + - [0]: { + - computed: "" + - nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_null_to_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_null_to_empty.golden new file mode 100644 index 0000000000..9589fbdf0d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_null_to_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_null_to_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_null_to_non-null.golden new file mode 100644 index 0000000000..7e7fdd2f06 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_null_to_non-null.golden @@ -0,0 +1,41 @@ +tests.testOutput{ + changeValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = (known after apply) + + nested = "value" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed.golden new file mode 100644 index 0000000000..be31441b25 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed.golden @@ -0,0 +1,43 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "value" -> null + # (1 unchanged attribute hidden) + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - tests: [ + - [0]: { + - computed: "" + - nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_end.golden new file mode 100644 index 0000000000..49a4533152 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_end.golden @@ -0,0 +1,72 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_end_unordered.golden new file mode 100644 index 0000000000..11c25ea195 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_end_unordered.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val2" + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_front.golden new file mode 100644 index 0000000000..7e9debb9fb --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_front.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val2" + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_front_unordered.golden new file mode 100644 index 0000000000..b60d9fea30 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_front_unordered.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_middle.golden new file mode 100644 index 0000000000..9c5e259b81 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_middle.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_middle_unordered.golden new file mode 100644 index 0000000000..41194735bd --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_middle_unordered.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + "val2", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled.golden new file mode 100644 index 0000000000..b224442990 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_added_end.golden new file mode 100644 index 0000000000..f4a3a017d6 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_added_end.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val2", + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_added_front.golden new file mode 100644 index 0000000000..220ae18483 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_added_front.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val1" + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_added_middle.golden new file mode 100644 index 0000000000..371fbf7e57 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_added_middle.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_removed_end.golden new file mode 100644 index 0000000000..8bc2fbdd12 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_removed_end.golden @@ -0,0 +1,72 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_removed_front.golden new file mode 100644 index 0000000000..5fc7ca7333 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_removed_front.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val3" + } + ~ [1]: { + ~ nested : "val2" => "val2" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_removed_middle.golden new file mode 100644 index 0000000000..a9a7842386 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_removed_middle.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_unordered.golden new file mode 100644 index 0000000000..d98c381793 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_unordered.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_with_duplicates.golden new file mode 100644 index 0000000000..09d74fe9c7 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_with_duplicates.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_with_duplicates_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_with_duplicates_unordered.golden new file mode 100644 index 0000000000..1011e92c5a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_with_duplicates_unordered.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/two_added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/two_added.golden new file mode 100644 index 0000000000..127e908470 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/two_added.golden @@ -0,0 +1,80 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val4" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + + [3]: { + + nested : "val4" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/two_removed.golden new file mode 100644 index 0000000000..b6f28b4666 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/two_removed.golden @@ -0,0 +1,82 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val4" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + - [3]: { + - computed: "" + - nested : "val4" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/unchanged_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/unchanged_empty.golden new file mode 100644 index 0000000000..7d07227be4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/unchanged_non-empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/unchanged_non-empty.golden new file mode 100644 index 0000000000..a87f03643b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/unchanged_non-empty.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value"}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/unchanged_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/unchanged_null.golden new file mode 100644 index 0000000000..a53fac34db --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/unchanged_null.golden @@ -0,0 +1,11 @@ +tests.testOutput{tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added.golden new file mode 100644 index 0000000000..1de9875a91 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added.golden @@ -0,0 +1,41 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{"value"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-value" + + nested = "value" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + computed : "non-computed-value" + + nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_end.golden new file mode 100644 index 0000000000..9c1af455d9 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_end_unordered.golden new file mode 100644 index 0000000000..5ab2ae62b2 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_end_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_front.golden new file mode 100644 index 0000000000..24ebf37206 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_front_unordered.golden new file mode 100644 index 0000000000..46e0f566a1 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_front_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_middle.golden new file mode 100644 index 0000000000..cb91ff4776 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_middle_unordered.golden new file mode 100644 index 0000000000..b773be1604 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_middle_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_empty_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_empty_to_null.golden new file mode 100644 index 0000000000..7bae19762f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_empty_to_null.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_non-null.golden new file mode 100644 index 0000000000..3d40302c39 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_non-null.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value1"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-value" -> null + - nested = "value" -> null + } + + test { # forces replacement + + computed = "non-computed-value1" + + nested = "value1" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ computed: "non-computed-value" => "non-computed-value1" + ~ nested : "value" => "value1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_non-null_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_non-null_to_null.golden new file mode 100644 index 0000000000..e1cbce6121 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_non-null_to_null.golden @@ -0,0 +1,42 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-value" -> null + - nested = "value" -> null + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - tests: [ + - [0]: { + - computed: "non-computed-value" + - nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_null_to_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_null_to_empty.golden new file mode 100644 index 0000000000..9589fbdf0d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_null_to_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_null_to_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_null_to_non-null.golden new file mode 100644 index 0000000000..e2326c5668 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_null_to_non-null.golden @@ -0,0 +1,42 @@ +tests.testOutput{ + changeValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-value" + + nested = "value" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + computed : "non-computed-value" + + nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed.golden new file mode 100644 index 0000000000..ea57b60682 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed.golden @@ -0,0 +1,43 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-value" -> null + - nested = "value" -> null + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - tests: [ + - [0]: { + - computed: "non-computed-value" + - nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_end.golden new file mode 100644 index 0000000000..27b631a621 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_end_unordered.golden new file mode 100644 index 0000000000..87c9ced14c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_end_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_front.golden new file mode 100644 index 0000000000..74c0f7468e --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_front_unordered.golden new file mode 100644 index 0000000000..d83c330b0f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_front_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_middle.golden new file mode 100644 index 0000000000..7b3e9ce15b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_middle_unordered.golden new file mode 100644 index 0000000000..8e95109d14 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_middle_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + "val2", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled.golden new file mode 100644 index 0000000000..b224442990 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_end.golden new file mode 100644 index 0000000000..cf125372c0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val2", + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_front.golden new file mode 100644 index 0000000000..c8d7a3a0f2 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_middle.golden new file mode 100644 index 0000000000..373c6cff92 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_end.golden new file mode 100644 index 0000000000..9ec766ae52 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_front.golden new file mode 100644 index 0000000000..1a4103a073 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_middle.golden new file mode 100644 index 0000000000..40b9ff67a5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_unordered.golden new file mode 100644 index 0000000000..d98c381793 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_unordered.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_with_duplicates.golden new file mode 100644 index 0000000000..09d74fe9c7 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_with_duplicates.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_with_duplicates_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_with_duplicates_unordered.golden new file mode 100644 index 0000000000..1011e92c5a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_with_duplicates_unordered.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/two_added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/two_added.golden new file mode 100644 index 0000000000..353e54999c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/two_added.golden @@ -0,0 +1,62 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val3" + + nested = "val3" + } + + test { # forces replacement + + computed = "non-computed-val4" + + nested = "val4" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + + [3]: { + + computed : "non-computed-val4" + + nested : "val4" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/two_removed.golden new file mode 100644 index 0000000000..fa8851ce6b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/two_removed.golden @@ -0,0 +1,62 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + - test { # forces replacement + - computed = "non-computed-val4" -> null + - nested = "val4" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + - [3]: { + - computed: "non-computed-val4" + - nested : "val4" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/unchanged_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/unchanged_empty.golden new file mode 100644 index 0000000000..7d07227be4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/unchanged_non-empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/unchanged_non-empty.golden new file mode 100644 index 0000000000..a87f03643b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/unchanged_non-empty.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value"}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/unchanged_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/unchanged_null.golden new file mode 100644 index 0000000000..a53fac34db --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/unchanged_null.golden @@ -0,0 +1,11 @@ +tests.testOutput{tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added.golden new file mode 100644 index 0000000000..8a0de22728 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added.golden @@ -0,0 +1,40 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{"value"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = (known after apply) + + nested = "value" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + nested : "value" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_end.golden new file mode 100644 index 0000000000..f16128f511 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_end.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_end_unordered.golden new file mode 100644 index 0000000000..9eee2d69d3 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_end_unordered.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val2" + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_front.golden new file mode 100644 index 0000000000..1ee158309a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_front.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val1" + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_front_unordered.golden new file mode 100644 index 0000000000..a81fe2957b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_front_unordered.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_middle.golden new file mode 100644 index 0000000000..be8c5fc653 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_middle.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_middle_unordered.golden new file mode 100644 index 0000000000..e18bd28d0d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_middle_unordered.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_empty_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_empty_to_null.golden new file mode 100644 index 0000000000..7bae19762f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_empty_to_null.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_non-null.golden new file mode 100644 index 0000000000..0170773e43 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_non-null.golden @@ -0,0 +1,49 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value1"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "value" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "value1" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "value" => "value1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_non-null_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_non-null_to_null.golden new file mode 100644 index 0000000000..07629a3e32 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_non-null_to_null.golden @@ -0,0 +1,42 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "value" -> null + # (1 unchanged attribute hidden) + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - tests: [ + - [0]: { + - computed: "" + - nested : "value" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_null_to_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_null_to_empty.golden new file mode 100644 index 0000000000..9589fbdf0d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_null_to_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_null_to_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_null_to_non-null.golden new file mode 100644 index 0000000000..2672c4e434 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_null_to_non-null.golden @@ -0,0 +1,41 @@ +tests.testOutput{ + changeValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = (known after apply) + + nested = "value" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + nested : "value" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed.golden new file mode 100644 index 0000000000..9d2c980b9d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed.golden @@ -0,0 +1,43 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "value" -> null + # (1 unchanged attribute hidden) + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - tests: [ + - [0]: { + - computed: "" + - nested : "value" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_end.golden new file mode 100644 index 0000000000..cb5cf4ecea --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_end.golden @@ -0,0 +1,72 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_end_unordered.golden new file mode 100644 index 0000000000..899c8114bf --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_end_unordered.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val2" + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_front.golden new file mode 100644 index 0000000000..f3b02f42d3 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_front.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val2" + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_front_unordered.golden new file mode 100644 index 0000000000..16a35f8b67 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_front_unordered.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_middle.golden new file mode 100644 index 0000000000..d799448f40 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_middle.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_middle_unordered.golden new file mode 100644 index 0000000000..dabc5aebc0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_middle_unordered.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + "val2", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/same_element_updated.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/same_element_updated.golden new file mode 100644 index 0000000000..9b8aa8b52b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/same_element_updated.golden @@ -0,0 +1,79 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val4", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + + test { + + computed = (known after apply) + + nested = "val4" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val4" + } + ~ [2]: { + ~ nested : "val3" => "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/same_element_updated_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/same_element_updated_unordered.golden new file mode 100644 index 0000000000..be19e29c7e --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/same_element_updated_unordered.golden @@ -0,0 +1,77 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val4", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val4" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + ~ [2]: { + ~ nested : "val3" => "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled.golden new file mode 100644 index 0000000000..b224442990 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_added_end.golden new file mode 100644 index 0000000000..83564177f7 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_added_end.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val2", + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_added_front.golden new file mode 100644 index 0000000000..8b796bce2e --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_added_front.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val1" + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_added_middle.golden new file mode 100644 index 0000000000..43f337249e --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_added_middle.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_removed_end.golden new file mode 100644 index 0000000000..39a2205170 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_removed_end.golden @@ -0,0 +1,72 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_removed_front.golden new file mode 100644 index 0000000000..acb278d4c5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_removed_front.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val3" + } + ~ [1]: { + ~ nested : "val2" => "val2" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_removed_middle.golden new file mode 100644 index 0000000000..323e01ff96 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_removed_middle.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_unordered.golden new file mode 100644 index 0000000000..d98c381793 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_unordered.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_with_duplicates.golden new file mode 100644 index 0000000000..09d74fe9c7 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_with_duplicates.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_with_duplicates_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_with_duplicates_unordered.golden new file mode 100644 index 0000000000..1011e92c5a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_with_duplicates_unordered.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added.golden new file mode 100644 index 0000000000..1637ef2333 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added.golden @@ -0,0 +1,80 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + + test { + + computed = (known after apply) + + nested = "val4" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + + [3]: { + + nested : "val4" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + "tests[3]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added_and_two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added_and_two_removed.golden new file mode 100644 index 0000000000..78e89cb3f6 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added_and_two_removed.golden @@ -0,0 +1,92 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + "val5", + "val6", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val4" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val5" + } + + test { + + computed = (known after apply) + + nested = "val6" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + ~ [2]: { + ~ nested : "val3" => "val5" + } + ~ [3]: { + ~ nested : "val4" => "val6" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added_and_two_removed_shuffled,_no_overlaps.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added_and_two_removed_shuffled,_no_overlaps.golden new file mode 100644 index 0000000000..9f1fdbf0bd --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added_and_two_removed_shuffled,_no_overlaps.golden @@ -0,0 +1,92 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val5", + "val6", + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val4" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val5" + } + + test { + + computed = (known after apply) + + nested = "val6" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + ~ [2]: { + ~ nested : "val3" => "val1" + } + ~ [3]: { + ~ nested : "val4" => "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added_and_two_removed_shuffled,_one_overlaps.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added_and_two_removed_shuffled,_one_overlaps.golden new file mode 100644 index 0000000000..09c91c9a51 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added_and_two_removed_shuffled,_one_overlaps.golden @@ -0,0 +1,92 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val5", + "val6", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val4" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val5" + } + + test { + + computed = (known after apply) + + nested = "val6" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + ~ [2]: { + ~ nested : "val3" => "val6" + } + ~ [3]: { + ~ nested : "val4" => "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added_and_two_removed_shuffled,_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added_and_two_removed_shuffled,_with_duplicates.golden new file mode 100644 index 0000000000..03a4d2a37c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added_and_two_removed_shuffled,_with_duplicates.golden @@ -0,0 +1,94 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val5", + "val6", + "val2", + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val4" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val5" + } + + test { + + computed = (known after apply) + + nested = "val6" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + ~ [2]: { + ~ nested : "val3" => "val6" + } + ~ [3]: { + ~ nested : "val4" => "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_removed.golden new file mode 100644 index 0000000000..6677548c8c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_removed.golden @@ -0,0 +1,82 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val4" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + - [3]: { + - computed: "" + - nested : "val4" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + "tests[3]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/unchanged_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/unchanged_empty.golden new file mode 100644 index 0000000000..7d07227be4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/unchanged_non-empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/unchanged_non-empty.golden new file mode 100644 index 0000000000..a87f03643b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/unchanged_non-empty.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value"}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/unchanged_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/unchanged_null.golden new file mode 100644 index 0000000000..a53fac34db --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/unchanged_null.golden @@ -0,0 +1,11 @@ +tests.testOutput{tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added.golden new file mode 100644 index 0000000000..9c107c39eb --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added.golden @@ -0,0 +1,41 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{"value"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-value" + + nested = "value" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + computed : "non-computed-value" + + nested : "value" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_end.golden new file mode 100644 index 0000000000..66fbc1c2d5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_end_unordered.golden new file mode 100644 index 0000000000..b1236f0902 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_end_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_front.golden new file mode 100644 index 0000000000..9a86837647 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_front_unordered.golden new file mode 100644 index 0000000000..33112977a6 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_front_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_middle.golden new file mode 100644 index 0000000000..3fa147fc4e --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_middle_unordered.golden new file mode 100644 index 0000000000..bb02e047a6 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_middle_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_empty_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_empty_to_null.golden new file mode 100644 index 0000000000..7bae19762f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_empty_to_null.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_non-null.golden new file mode 100644 index 0000000000..89c888348c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_non-null.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value1"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-value" -> null + - nested = "value" -> null + } + + test { + + computed = "non-computed-value1" + + nested = "value1" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ computed: "non-computed-value" => "non-computed-value1" + ~ nested : "value" => "value1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_non-null_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_non-null_to_null.golden new file mode 100644 index 0000000000..6d83e60150 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_non-null_to_null.golden @@ -0,0 +1,42 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-value" -> null + - nested = "value" -> null + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - tests: [ + - [0]: { + - computed: "non-computed-value" + - nested : "value" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_null_to_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_null_to_empty.golden new file mode 100644 index 0000000000..9589fbdf0d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_null_to_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_null_to_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_null_to_non-null.golden new file mode 100644 index 0000000000..238c8dba3b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_null_to_non-null.golden @@ -0,0 +1,42 @@ +tests.testOutput{ + changeValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-value" + + nested = "value" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + computed : "non-computed-value" + + nested : "value" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed.golden new file mode 100644 index 0000000000..5246ebfdc2 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed.golden @@ -0,0 +1,43 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-value" -> null + - nested = "value" -> null + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - tests: [ + - [0]: { + - computed: "non-computed-value" + - nested : "value" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_end.golden new file mode 100644 index 0000000000..101d829f4f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_end_unordered.golden new file mode 100644 index 0000000000..d3921213cc --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_end_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_front.golden new file mode 100644 index 0000000000..95cec62f95 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_front_unordered.golden new file mode 100644 index 0000000000..4ce1bb1bb0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_front_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_middle.golden new file mode 100644 index 0000000000..e27759e65c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_middle_unordered.golden new file mode 100644 index 0000000000..71aca2ff62 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_middle_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + "val2", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/same_element_updated.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/same_element_updated.golden new file mode 100644 index 0000000000..0963444122 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/same_element_updated.golden @@ -0,0 +1,62 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val4", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + test { + + computed = "non-computed-val4" + + nested = "val4" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[1]": map[string]interface{}{"kind": "DELETE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/same_element_updated_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/same_element_updated_unordered.golden new file mode 100644 index 0000000000..855997ff75 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/same_element_updated_unordered.golden @@ -0,0 +1,58 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val4", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + + test { + + computed = "non-computed-val4" + + nested = "val4" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [2]: { + ~ computed: "non-computed-val3" => "non-computed-val1" + ~ nested : "val3" => "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled.golden new file mode 100644 index 0000000000..b224442990 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_added_end.golden new file mode 100644 index 0000000000..ae58b0bccc --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_added_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val2", + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_added_front.golden new file mode 100644 index 0000000000..c73db179d9 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_added_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_added_middle.golden new file mode 100644 index 0000000000..ccd82694be --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_added_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_removed_end.golden new file mode 100644 index 0000000000..8741a83c67 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_removed_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_removed_front.golden new file mode 100644 index 0000000000..e0d9d13c46 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_removed_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_removed_middle.golden new file mode 100644 index 0000000000..19dd48fb4f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_removed_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_unordered.golden new file mode 100644 index 0000000000..d98c381793 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_unordered.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_with_duplicates.golden new file mode 100644 index 0000000000..09d74fe9c7 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_with_duplicates.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_with_duplicates_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_with_duplicates_unordered.golden new file mode 100644 index 0000000000..1011e92c5a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_with_duplicates_unordered.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added.golden new file mode 100644 index 0000000000..e43424e12d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added.golden @@ -0,0 +1,62 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val3" + + nested = "val3" + } + + test { + + computed = "non-computed-val4" + + nested = "val4" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + + [3]: { + + computed : "non-computed-val4" + + nested : "val4" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{}, + "tests[3]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added_and_two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added_and_two_removed.golden new file mode 100644 index 0000000000..fc533b2c3a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added_and_two_removed.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + "val5", + "val6", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + - test { + - computed = "non-computed-val4" -> null + - nested = "val4" -> null + } + + test { + + computed = "non-computed-val5" + + nested = "val5" + } + + test { + + computed = "non-computed-val6" + + nested = "val6" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [2]: { + ~ computed: "non-computed-val3" => "non-computed-val5" + ~ nested : "val3" => "val5" + } + ~ [3]: { + ~ computed: "non-computed-val4" => "non-computed-val6" + ~ nested : "val4" => "val6" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_no_overlaps.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_no_overlaps.golden new file mode 100644 index 0000000000..91b3776e3b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_no_overlaps.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val5", + "val6", + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + - test { + - computed = "non-computed-val4" -> null + - nested = "val4" -> null + } + + test { + + computed = "non-computed-val5" + + nested = "val5" + } + + test { + + computed = "non-computed-val6" + + nested = "val6" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [2]: { + ~ computed: "non-computed-val3" => "non-computed-val1" + ~ nested : "val3" => "val1" + } + ~ [3]: { + ~ computed: "non-computed-val4" => "non-computed-val2" + ~ nested : "val4" => "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_one_overlaps.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_one_overlaps.golden new file mode 100644 index 0000000000..872a2178de --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_one_overlaps.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val5", + "val6", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + - test { + - computed = "non-computed-val4" -> null + - nested = "val4" -> null + } + + test { + + computed = "non-computed-val5" + + nested = "val5" + } + + test { + + computed = "non-computed-val6" + + nested = "val6" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [2]: { + ~ computed: "non-computed-val3" => "non-computed-val6" + ~ nested : "val3" => "val6" + } + ~ [3]: { + ~ computed: "non-computed-val4" => "non-computed-val2" + ~ nested : "val4" => "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_with_duplicates.golden new file mode 100644 index 0000000000..82ff7cf7c9 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_with_duplicates.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val5", + "val6", + "val2", + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + - test { + - computed = "non-computed-val4" -> null + - nested = "val4" -> null + } + + test { + + computed = "non-computed-val5" + + nested = "val5" + } + + test { + + computed = "non-computed-val6" + + nested = "val6" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [2]: { + ~ computed: "non-computed-val3" => "non-computed-val6" + ~ nested : "val3" => "val6" + } + ~ [3]: { + ~ computed: "non-computed-val4" => "non-computed-val2" + ~ nested : "val4" => "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_removed.golden new file mode 100644 index 0000000000..b811014c91 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_removed.golden @@ -0,0 +1,62 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + - test { + - computed = "non-computed-val4" -> null + - nested = "val4" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + - [3]: { + - computed: "non-computed-val4" + - nested : "val4" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + "tests[3]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/unchanged_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/unchanged_empty.golden new file mode 100644 index 0000000000..7d07227be4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/unchanged_non-empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/unchanged_non-empty.golden new file mode 100644 index 0000000000..a87f03643b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/unchanged_non-empty.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value"}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/unchanged_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/unchanged_null.golden new file mode 100644 index 0000000000..a53fac34db --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/unchanged_null.golden @@ -0,0 +1,11 @@ +tests.testOutput{tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added.golden new file mode 100644 index 0000000000..954d6936d0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added.golden @@ -0,0 +1,36 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{"value"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + + "value", + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: "value" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_end.golden new file mode 100644 index 0000000000..efb765e14e --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_end.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + + "val3", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: "val3" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_end_unordered.golden new file mode 100644 index 0000000000..36f6efad17 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_end_unordered.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + + "val1", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: "val2" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_front.golden new file mode 100644 index 0000000000..31e792da57 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_front.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + + "val1", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: "val1" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_front_unordered.golden new file mode 100644 index 0000000000..67b2a37998 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_front_unordered.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + + "val2", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: "val3" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_middle.golden new file mode 100644 index 0000000000..fcbd5e43e1 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_middle.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + + "val2", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: "val2" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_middle_unordered.golden new file mode 100644 index 0000000000..1cbc9a54b5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_middle_unordered.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + + "val3", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: "val1" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_empty_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_empty_to_null.golden new file mode 100644 index 0000000000..7bae19762f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_empty_to_null.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_non-null.golden new file mode 100644 index 0000000000..697e4c5c9a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_non-null.golden @@ -0,0 +1,39 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value1"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + - "value", + + "value1", + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: "value" => "value1" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "UPDATE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_non-null_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_non-null_to_null.golden new file mode 100644 index 0000000000..eff89843a0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_non-null_to_null.golden @@ -0,0 +1,17 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_null_to_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_null_to_empty.golden new file mode 100644 index 0000000000..9589fbdf0d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_null_to_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_null_to_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_null_to_non-null.golden new file mode 100644 index 0000000000..e16ea5c7e0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_null_to_non-null.golden @@ -0,0 +1,37 @@ +tests.testOutput{ + changeValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + + "value", + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: "value" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed.golden new file mode 100644 index 0000000000..60aaba5ddf --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed.golden @@ -0,0 +1,38 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ + - "value", + ] -> (known after apply) # forces replacement + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - tests: [ + - [0]: "value" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_end.golden new file mode 100644 index 0000000000..778429a10d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_end.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + - "val3", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: "val3" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_end_unordered.golden new file mode 100644 index 0000000000..ba2e338378 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_end_unordered.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + - "val1", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: "val1" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_front.golden new file mode 100644 index 0000000000..559e88f3cc --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_front.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + - "val1", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: "val1" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_front_unordered.golden new file mode 100644 index 0000000000..66fb90e788 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_front_unordered.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + - "val2", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: "val2" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_middle.golden new file mode 100644 index 0000000000..89b2548c5a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_middle.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + - "val2", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: "val2" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_middle_unordered.golden new file mode 100644 index 0000000000..a34fe9f436 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_middle_unordered.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + "val2", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + - "val2", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: "val2" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled.golden new file mode 100644 index 0000000000..b224442990 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_added_end.golden new file mode 100644 index 0000000000..83c54b25e7 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_added_end.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val2", + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + + "val3", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: "val3" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_added_front.golden new file mode 100644 index 0000000000..062d80a9de --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_added_front.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + + "val1", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: "val1" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_added_middle.golden new file mode 100644 index 0000000000..4ba476ddfc --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_added_middle.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + + "val2", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: "val2" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_removed_end.golden new file mode 100644 index 0000000000..65bf2f44a0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_removed_end.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + - "val3", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: "val3" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_removed_front.golden new file mode 100644 index 0000000000..73f5630f43 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_removed_front.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + - "val1", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: "val1" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_removed_middle.golden new file mode 100644 index 0000000000..adb70ea2ce --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_removed_middle.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + - "val2", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: "val2" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_unordered.golden new file mode 100644 index 0000000000..d98c381793 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_unordered.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_with_duplicates.golden new file mode 100644 index 0000000000..09d74fe9c7 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_with_duplicates.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_with_duplicates_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_with_duplicates_unordered.golden new file mode 100644 index 0000000000..1011e92c5a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_with_duplicates_unordered.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/two_added.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/two_added.golden new file mode 100644 index 0000000000..fd567fa7bf --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/two_added.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + + "val3", + + "val4", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: "val3" + + [3]: "val4" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/two_removed.golden new file mode 100644 index 0000000000..c52a70c37f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/two_removed.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + - "val3", + - "val4", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: "val3" + - [3]: "val4" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/unchanged_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/unchanged_empty.golden new file mode 100644 index 0000000000..7d07227be4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/unchanged_non-empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/unchanged_non-empty.golden new file mode 100644 index 0000000000..a87f03643b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/unchanged_non-empty.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value"}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/unchanged_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/unchanged_null.golden new file mode 100644 index 0000000000..a53fac34db --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/unchanged_null.golden @@ -0,0 +1,11 @@ +tests.testOutput{tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added.golden new file mode 100644 index 0000000000..3ca3626f84 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added.golden @@ -0,0 +1,37 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{"value"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "computed", + + "value", + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: "computed" => "value" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_end.golden new file mode 100644 index 0000000000..7ee2106a7f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_end.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + + "val3", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: "val3" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_end_unordered.golden new file mode 100644 index 0000000000..3f7bc6224d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_end_unordered.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + + "val1", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: "val2" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_front.golden new file mode 100644 index 0000000000..8895df583a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_front.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + + "val1", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: "val1" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_front_unordered.golden new file mode 100644 index 0000000000..45a2107283 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_front_unordered.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + + "val2", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: "val3" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_middle.golden new file mode 100644 index 0000000000..39cae1691e --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_middle.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + + "val2", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: "val2" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_middle_unordered.golden new file mode 100644 index 0000000000..dd82a01863 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_middle_unordered.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + + "val3", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: "val1" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_empty_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_empty_to_null.golden new file mode 100644 index 0000000000..7bae19762f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_empty_to_null.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_non-null.golden new file mode 100644 index 0000000000..123294b6bd --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_non-null.golden @@ -0,0 +1,39 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value1"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "value", + + "value1", + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: "value" => "value1" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_non-null_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_non-null_to_null.golden new file mode 100644 index 0000000000..eff89843a0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_non-null_to_null.golden @@ -0,0 +1,17 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_null_to_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_null_to_empty.golden new file mode 100644 index 0000000000..30ad739652 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_null_to_empty.golden @@ -0,0 +1,35 @@ +tests.testOutput{ + changeValue: &[]string{}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "computed", + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - tests: [ + - [0]: "computed" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_null_to_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_null_to_non-null.golden new file mode 100644 index 0000000000..3fed7515a4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_null_to_non-null.golden @@ -0,0 +1,38 @@ +tests.testOutput{ + changeValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "computed", + + "value", + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: "computed" => "value" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed.golden new file mode 100644 index 0000000000..f19c6593ec --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed.golden @@ -0,0 +1,38 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "value", + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - tests: [ + - [0]: "value" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_end.golden new file mode 100644 index 0000000000..853195eb70 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_end.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "val3", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: "val3" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_end_unordered.golden new file mode 100644 index 0000000000..c542534f73 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_end_unordered.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "val1", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: "val1" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_front.golden new file mode 100644 index 0000000000..451cac3b86 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_front.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "val1", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: "val1" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_front_unordered.golden new file mode 100644 index 0000000000..da0f3d3ce6 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_front_unordered.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "val2", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: "val2" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_middle.golden new file mode 100644 index 0000000000..9af564bb36 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_middle.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "val2", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: "val2" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_middle_unordered.golden new file mode 100644 index 0000000000..28fd761cf7 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_middle_unordered.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + "val2", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "val2", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: "val2" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/same_element_updated.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/same_element_updated.golden new file mode 100644 index 0000000000..cafa789cc6 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/same_element_updated.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val4", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "val2", + + "val4", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: "val2" + + [2]: "val3" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[1]": map[string]interface{}{"kind": "DELETE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/same_element_updated_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/same_element_updated_unordered.golden new file mode 100644 index 0000000000..57fafddd9f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/same_element_updated_unordered.golden @@ -0,0 +1,46 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val4", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "val3", + + "val4", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [2]: "val3" => "val1" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled.golden new file mode 100644 index 0000000000..b224442990 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_added_end.golden new file mode 100644 index 0000000000..40c2fe45c7 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_added_end.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val2", + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + + "val3", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: "val3" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_added_front.golden new file mode 100644 index 0000000000..9827f1c996 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_added_front.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + + "val1", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: "val1" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_added_middle.golden new file mode 100644 index 0000000000..249ad95700 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_added_middle.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + + "val2", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: "val2" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_removed_end.golden new file mode 100644 index 0000000000..a7b63e504d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_removed_end.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "val3", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: "val3" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_removed_front.golden new file mode 100644 index 0000000000..6ca7784ef0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_removed_front.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "val1", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: "val1" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_removed_middle.golden new file mode 100644 index 0000000000..f55f66baa5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_removed_middle.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "val2", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: "val2" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_unordered.golden new file mode 100644 index 0000000000..d98c381793 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_unordered.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_with_duplicates.golden new file mode 100644 index 0000000000..09d74fe9c7 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_with_duplicates.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_with_duplicates_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_with_duplicates_unordered.golden new file mode 100644 index 0000000000..1011e92c5a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_with_duplicates_unordered.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added.golden new file mode 100644 index 0000000000..e79983b614 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + + "val3", + + "val4", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: "val3" + + [3]: "val4" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{}, + "tests[3]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added_and_two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added_and_two_removed.golden new file mode 100644 index 0000000000..c0e3239863 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added_and_two_removed.golden @@ -0,0 +1,54 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + "val5", + "val6", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "val3", + - "val4", + + "val5", + + "val6", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [2]: "val3" => "val5" + ~ [3]: "val4" => "val6" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "UPDATE"}, + "tests[3]": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added_and_two_removed_shuffled,_no_overlaps.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added_and_two_removed_shuffled,_no_overlaps.golden new file mode 100644 index 0000000000..09ef55654f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added_and_two_removed_shuffled,_no_overlaps.golden @@ -0,0 +1,54 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val5", + "val6", + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "val3", + - "val4", + + "val5", + + "val6", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [2]: "val3" => "val1" + ~ [3]: "val4" => "val2" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "UPDATE"}, + "tests[3]": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added_and_two_removed_shuffled,_one_overlaps.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added_and_two_removed_shuffled,_one_overlaps.golden new file mode 100644 index 0000000000..d548504994 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added_and_two_removed_shuffled,_one_overlaps.golden @@ -0,0 +1,54 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val5", + "val6", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "val3", + - "val4", + + "val5", + + "val6", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [2]: "val3" => "val6" + ~ [3]: "val4" => "val2" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "UPDATE"}, + "tests[3]": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added_and_two_removed_shuffled,_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added_and_two_removed_shuffled,_with_duplicates.golden new file mode 100644 index 0000000000..dae33ce78d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added_and_two_removed_shuffled,_with_duplicates.golden @@ -0,0 +1,56 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val5", + "val6", + "val2", + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "val3", + - "val4", + + "val5", + + "val6", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [2]: "val3" => "val6" + ~ [3]: "val4" => "val2" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "UPDATE"}, + "tests[3]": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_removed.golden new file mode 100644 index 0000000000..f97ddf92d3 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_removed.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "val3", + - "val4", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: "val3" + - [3]: "val4" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + "tests[3]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/unchanged_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/unchanged_empty.golden new file mode 100644 index 0000000000..ee393acc79 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/unchanged_empty.golden @@ -0,0 +1,36 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "computed", + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - tests: [ + - [0]: "computed" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/unchanged_non-empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/unchanged_non-empty.golden new file mode 100644 index 0000000000..a87f03643b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/unchanged_non-empty.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value"}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/unchanged_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/unchanged_null.golden new file mode 100644 index 0000000000..a53fac34db --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/unchanged_null.golden @@ -0,0 +1,11 @@ +tests.testOutput{tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`}