From 4c3deba8270bab2dc64884e63c3aadebde6f319d 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 | 354 +++++++++++++++++- .../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, 24494 insertions(+), 8 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 c04653422..ba04fb10d 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,23 +1186,65 @@ func TestDetailedDiffSet(t *testing.T) { return cty.ListVal(slice) } - schemaValueMakerPairs := []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 + } + + schemaValueMakerPairs := []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}, + {"attribute force new", attributeSchemaForceNew, attrList}, - {"block force new", blockSchemaForceNew, nestedAttrList}, + {"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}, diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added.golden new file mode 100644 index 000000000..94f5561c4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added.golden @@ -0,0 +1,40 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{"value"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = (known after apply) + + nested = "value" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_end.golden new file mode 100644 index 000000000..61e7023f4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_end.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_end_unordered.golden new file mode 100644 index 000000000..39107993f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_end_unordered.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val2" + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_front.golden new file mode 100644 index 000000000..3a2d9fcbb --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_front.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val1" + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_front_unordered.golden new file mode 100644 index 000000000..4f04f29e8 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_front_unordered.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_middle.golden new file mode 100644 index 000000000..d91143690 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_middle.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_middle_unordered.golden new file mode 100644 index 000000000..bdac10688 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/added_middle_unordered.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_empty_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_empty_to_null.golden new file mode 100644 index 000000000..7bae19762 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_empty_to_null.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_non-null.golden new file mode 100644 index 000000000..3c61d1ead --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_non-null.golden @@ -0,0 +1,49 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value1"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "value" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "value1" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "value" => "value1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_non-null_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_non-null_to_null.golden new file mode 100644 index 000000000..eff89843a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_non-null_to_null.golden @@ -0,0 +1,17 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_null_to_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_null_to_empty.golden new file mode 100644 index 000000000..9589fbdf0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_null_to_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_null_to_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_null_to_non-null.golden new file mode 100644 index 000000000..7e7fdd2f0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/changed_null_to_non-null.golden @@ -0,0 +1,41 @@ +tests.testOutput{ + changeValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = (known after apply) + + nested = "value" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed.golden new file mode 100644 index 000000000..b67f5c3e1 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_end.golden new file mode 100644 index 000000000..49a453315 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_end.golden @@ -0,0 +1,72 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_end_unordered.golden new file mode 100644 index 000000000..11c25ea19 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_end_unordered.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val2" + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_front.golden new file mode 100644 index 000000000..7e9debb9f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_front.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val2" + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_front_unordered.golden new file mode 100644 index 000000000..b60d9fea3 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_front_unordered.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_middle.golden new file mode 100644 index 000000000..9c5e259b8 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_middle.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_middle_unordered.golden new file mode 100644 index 000000000..41194735b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/removed_middle_unordered.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + "val2", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled.golden new file mode 100644 index 000000000..b22444299 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_added_end.golden new file mode 100644 index 000000000..f4a3a017d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_added_end.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val2", + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_added_front.golden new file mode 100644 index 000000000..220ae1848 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_added_front.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val1" + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_added_middle.golden new file mode 100644 index 000000000..371fbf7e5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_added_middle.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_removed_end.golden new file mode 100644 index 000000000..8bc2fbdd1 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_removed_end.golden @@ -0,0 +1,72 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_removed_front.golden new file mode 100644 index 000000000..5fc7ca733 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_removed_front.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val3" + } + ~ [1]: { + ~ nested : "val2" => "val2" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_removed_middle.golden new file mode 100644 index 000000000..a9a784238 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_removed_middle.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_unordered.golden new file mode 100644 index 000000000..d98c38179 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_unordered.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_with_duplicates.golden new file mode 100644 index 000000000..09d74fe9c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_with_duplicates.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_with_duplicates_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_with_duplicates_unordered.golden new file mode 100644 index 000000000..1011e92c5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/shuffled_with_duplicates_unordered.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/two_added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/two_added.golden new file mode 100644 index 000000000..127e90847 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/two_added.golden @@ -0,0 +1,80 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val4" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + + [3]: { + + nested : "val4" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/two_removed.golden new file mode 100644 index 000000000..b6f28b466 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/two_removed.golden @@ -0,0 +1,82 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val4" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + - [3]: { + - computed: "" + - nested : "val4" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/unchanged_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/unchanged_empty.golden new file mode 100644 index 000000000..7d07227be --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/unchanged_non-empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/unchanged_non-empty.golden new file mode 100644 index 000000000..a87f03643 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/unchanged_non-empty.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value"}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/unchanged_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/unchanged_null.golden new file mode 100644 index 000000000..a53fac34d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new/unchanged_null.golden @@ -0,0 +1,11 @@ +tests.testOutput{tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added.golden new file mode 100644 index 000000000..1de9875a9 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added.golden @@ -0,0 +1,41 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{"value"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-value" + + nested = "value" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + computed : "non-computed-value" + + nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_end.golden new file mode 100644 index 000000000..9c1af455d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_end_unordered.golden new file mode 100644 index 000000000..5ab2ae62b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_end_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_front.golden new file mode 100644 index 000000000..24ebf3720 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_front_unordered.golden new file mode 100644 index 000000000..46e0f566a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_front_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_middle.golden new file mode 100644 index 000000000..cb91ff477 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_middle_unordered.golden new file mode 100644 index 000000000..b773be160 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/added_middle_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_empty_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_empty_to_null.golden new file mode 100644 index 000000000..7bae19762 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_empty_to_null.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_non-null.golden new file mode 100644 index 000000000..3d40302c3 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_non-null.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value1"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-value" -> null + - nested = "value" -> null + } + + test { # forces replacement + + computed = "non-computed-value1" + + nested = "value1" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ computed: "non-computed-value" => "non-computed-value1" + ~ nested : "value" => "value1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_non-null_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_non-null_to_null.golden new file mode 100644 index 000000000..eff89843a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_non-null_to_null.golden @@ -0,0 +1,17 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_null_to_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_null_to_empty.golden new file mode 100644 index 000000000..9589fbdf0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_null_to_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_null_to_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_null_to_non-null.golden new file mode 100644 index 000000000..e2326c566 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/changed_null_to_non-null.golden @@ -0,0 +1,42 @@ +tests.testOutput{ + changeValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-value" + + nested = "value" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + computed : "non-computed-value" + + nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed.golden new file mode 100644 index 000000000..b67f5c3e1 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_end.golden new file mode 100644 index 000000000..27b631a62 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_end_unordered.golden new file mode 100644 index 000000000..87c9ced14 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_end_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_front.golden new file mode 100644 index 000000000..74c0f7468 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_front_unordered.golden new file mode 100644 index 000000000..d83c330b0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_front_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_middle.golden new file mode 100644 index 000000000..7b3e9ce15 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_middle_unordered.golden new file mode 100644 index 000000000..8e95109d1 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/removed_middle_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + "val2", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled.golden new file mode 100644 index 000000000..b22444299 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_end.golden new file mode 100644 index 000000000..cf125372c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val2", + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_front.golden new file mode 100644 index 000000000..c8d7a3a0f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_middle.golden new file mode 100644 index 000000000..373c6cff9 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_end.golden new file mode 100644 index 000000000..9ec766ae5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_front.golden new file mode 100644 index 000000000..1a4103a07 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_middle.golden new file mode 100644 index 000000000..40b9ff67a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_unordered.golden new file mode 100644 index 000000000..d98c38179 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_unordered.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_with_duplicates.golden new file mode 100644 index 000000000..09d74fe9c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_with_duplicates.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_with_duplicates_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_with_duplicates_unordered.golden new file mode 100644 index 000000000..1011e92c5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/shuffled_with_duplicates_unordered.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/two_added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/two_added.golden new file mode 100644 index 000000000..353e54999 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/two_added.golden @@ -0,0 +1,62 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val3" + + nested = "val3" + } + + test { # forces replacement + + computed = "non-computed-val4" + + nested = "val4" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + + [3]: { + + computed : "non-computed-val4" + + nested : "val4" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/two_removed.golden new file mode 100644 index 000000000..fa8851ce6 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/two_removed.golden @@ -0,0 +1,62 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + - test { # forces replacement + - computed = "non-computed-val4" -> null + - nested = "val4" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + - [3]: { + - computed: "non-computed-val4" + - nested : "val4" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/unchanged_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/unchanged_empty.golden new file mode 100644 index 000000000..7d07227be --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/unchanged_non-empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/unchanged_non-empty.golden new file mode 100644 index 000000000..a87f03643 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/unchanged_non-empty.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value"}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/unchanged_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/unchanged_null.golden new file mode 100644 index 000000000..a53fac34d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_and_nested_force_new_computed_specified_in_program/unchanged_null.golden @@ -0,0 +1,11 @@ +tests.testOutput{tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added.golden new file mode 100644 index 000000000..94f5561c4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added.golden @@ -0,0 +1,40 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{"value"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = (known after apply) + + nested = "value" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_end.golden new file mode 100644 index 000000000..61e7023f4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_end.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_end_unordered.golden new file mode 100644 index 000000000..4a6c7975f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_end_unordered.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val2" + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_front.golden new file mode 100644 index 000000000..6c3c3e039 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_front.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val1" + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_front_unordered.golden new file mode 100644 index 000000000..a2a38aeba --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_front_unordered.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_middle.golden new file mode 100644 index 000000000..23cedb220 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_middle.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_middle_unordered.golden new file mode 100644 index 000000000..bdac10688 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/added_middle_unordered.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_empty_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_empty_to_null.golden new file mode 100644 index 000000000..7bae19762 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_empty_to_null.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_non-null.golden new file mode 100644 index 000000000..0170773e4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_non-null.golden @@ -0,0 +1,49 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value1"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "value" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "value1" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "value" => "value1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_non-null_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_non-null_to_null.golden new file mode 100644 index 000000000..eff89843a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_non-null_to_null.golden @@ -0,0 +1,17 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_null_to_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_null_to_empty.golden new file mode 100644 index 000000000..9589fbdf0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_null_to_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_null_to_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_null_to_non-null.golden new file mode 100644 index 000000000..7e7fdd2f0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/changed_null_to_non-null.golden @@ -0,0 +1,41 @@ +tests.testOutput{ + changeValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = (known after apply) + + nested = "value" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed.golden new file mode 100644 index 000000000..b67f5c3e1 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_end.golden new file mode 100644 index 000000000..49a453315 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_end.golden @@ -0,0 +1,72 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_end_unordered.golden new file mode 100644 index 000000000..27a71d3d4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_end_unordered.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val2" + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_front.golden new file mode 100644 index 000000000..f90856167 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_front.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val2" + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_front_unordered.golden new file mode 100644 index 000000000..57799de1f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_front_unordered.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_middle.golden new file mode 100644 index 000000000..648c2e19c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_middle.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_middle_unordered.golden new file mode 100644 index 000000000..f89fa4b2b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/removed_middle_unordered.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + "val2", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled.golden new file mode 100644 index 000000000..b22444299 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_added_end.golden new file mode 100644 index 000000000..f4a3a017d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_added_end.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val2", + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_added_front.golden new file mode 100644 index 000000000..b93394a26 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_added_front.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val1" + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_added_middle.golden new file mode 100644 index 000000000..0f251e5b6 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_added_middle.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_removed_end.golden new file mode 100644 index 000000000..8bc2fbdd1 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_removed_end.golden @@ -0,0 +1,72 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_removed_front.golden new file mode 100644 index 000000000..1930e4f5c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_removed_front.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val3" + } + ~ [1]: { + ~ nested : "val2" => "val2" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_removed_middle.golden new file mode 100644 index 000000000..0f33d25b0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_removed_middle.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_unordered.golden new file mode 100644 index 000000000..d98c38179 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_unordered.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_with_duplicates.golden new file mode 100644 index 000000000..09d74fe9c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_with_duplicates.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_with_duplicates_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_with_duplicates_unordered.golden new file mode 100644 index 000000000..1011e92c5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/shuffled_with_duplicates_unordered.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/two_added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/two_added.golden new file mode 100644 index 000000000..127e90847 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/two_added.golden @@ -0,0 +1,80 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val4" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + + [3]: { + + nested : "val4" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/two_removed.golden new file mode 100644 index 000000000..b6f28b466 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/two_removed.golden @@ -0,0 +1,82 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val4" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + - [3]: { + - computed: "" + - nested : "val4" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/unchanged_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/unchanged_empty.golden new file mode 100644 index 000000000..7d07227be --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/unchanged_non-empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/unchanged_non-empty.golden new file mode 100644 index 000000000..a87f03643 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/unchanged_non-empty.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value"}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/unchanged_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/unchanged_null.golden new file mode 100644 index 000000000..a53fac34d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new/unchanged_null.golden @@ -0,0 +1,11 @@ +tests.testOutput{tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added.golden new file mode 100644 index 000000000..1de9875a9 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added.golden @@ -0,0 +1,41 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{"value"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-value" + + nested = "value" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + computed : "non-computed-value" + + nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_end.golden new file mode 100644 index 000000000..9c1af455d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_end_unordered.golden new file mode 100644 index 000000000..5ab2ae62b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_end_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_front.golden new file mode 100644 index 000000000..24ebf3720 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_front_unordered.golden new file mode 100644 index 000000000..46e0f566a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_front_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_middle.golden new file mode 100644 index 000000000..cb91ff477 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_middle_unordered.golden new file mode 100644 index 000000000..b773be160 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/added_middle_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_empty_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_empty_to_null.golden new file mode 100644 index 000000000..7bae19762 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_empty_to_null.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_non-null.golden new file mode 100644 index 000000000..89c888348 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_non-null.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value1"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-value" -> null + - nested = "value" -> null + } + + test { + + computed = "non-computed-value1" + + nested = "value1" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ computed: "non-computed-value" => "non-computed-value1" + ~ nested : "value" => "value1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_non-null_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_non-null_to_null.golden new file mode 100644 index 000000000..eff89843a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_non-null_to_null.golden @@ -0,0 +1,17 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_null_to_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_null_to_empty.golden new file mode 100644 index 000000000..9589fbdf0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_null_to_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_null_to_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_null_to_non-null.golden new file mode 100644 index 000000000..e2326c566 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/changed_null_to_non-null.golden @@ -0,0 +1,42 @@ +tests.testOutput{ + changeValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-value" + + nested = "value" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + computed : "non-computed-value" + + nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed.golden new file mode 100644 index 000000000..b67f5c3e1 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_end.golden new file mode 100644 index 000000000..27b631a62 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_end_unordered.golden new file mode 100644 index 000000000..87c9ced14 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_end_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_front.golden new file mode 100644 index 000000000..74c0f7468 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_front_unordered.golden new file mode 100644 index 000000000..d83c330b0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_front_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_middle.golden new file mode 100644 index 000000000..7b3e9ce15 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_middle_unordered.golden new file mode 100644 index 000000000..8e95109d1 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/removed_middle_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + "val2", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled.golden new file mode 100644 index 000000000..b22444299 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_added_end.golden new file mode 100644 index 000000000..cf125372c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_added_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val2", + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_added_front.golden new file mode 100644 index 000000000..c8d7a3a0f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_added_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_added_middle.golden new file mode 100644 index 000000000..373c6cff9 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_added_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_removed_end.golden new file mode 100644 index 000000000..9ec766ae5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_removed_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_removed_front.golden new file mode 100644 index 000000000..1a4103a07 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_removed_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_removed_middle.golden new file mode 100644 index 000000000..40b9ff67a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_removed_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_unordered.golden new file mode 100644 index 000000000..d98c38179 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_unordered.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_with_duplicates.golden new file mode 100644 index 000000000..09d74fe9c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_with_duplicates.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_with_duplicates_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_with_duplicates_unordered.golden new file mode 100644 index 000000000..1011e92c5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/shuffled_with_duplicates_unordered.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/two_added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/two_added.golden new file mode 100644 index 000000000..353e54999 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/two_added.golden @@ -0,0 +1,62 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val3" + + nested = "val3" + } + + test { # forces replacement + + computed = "non-computed-val4" + + nested = "val4" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + + [3]: { + + computed : "non-computed-val4" + + nested : "val4" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/two_removed.golden new file mode 100644 index 000000000..fa8851ce6 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/two_removed.golden @@ -0,0 +1,62 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + - test { # forces replacement + - computed = "non-computed-val4" -> null + - nested = "val4" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + - [3]: { + - computed: "non-computed-val4" + - nested : "val4" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/unchanged_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/unchanged_empty.golden new file mode 100644 index 000000000..7d07227be --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/unchanged_non-empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/unchanged_non-empty.golden new file mode 100644 index 000000000..a87f03643 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/unchanged_non-empty.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value"}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/unchanged_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/unchanged_null.golden new file mode 100644 index 000000000..a53fac34d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_force_new_computed_specified_in_program/unchanged_null.golden @@ -0,0 +1,11 @@ +tests.testOutput{tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added.golden new file mode 100644 index 000000000..8a0de2272 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added.golden @@ -0,0 +1,40 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{"value"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = (known after apply) + + nested = "value" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + nested : "value" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_end.golden new file mode 100644 index 000000000..f16128f51 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_end.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_end_unordered.golden new file mode 100644 index 000000000..9eee2d69d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_end_unordered.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val2" + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_front.golden new file mode 100644 index 000000000..1ee158309 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_front.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val1" + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_front_unordered.golden new file mode 100644 index 000000000..a81fe2957 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_front_unordered.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_middle.golden new file mode 100644 index 000000000..be8c5fc65 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_middle.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_middle_unordered.golden new file mode 100644 index 000000000..e18bd28d0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/added_middle_unordered.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_empty_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_empty_to_null.golden new file mode 100644 index 000000000..7bae19762 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_empty_to_null.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_non-null.golden new file mode 100644 index 000000000..0170773e4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_non-null.golden @@ -0,0 +1,49 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value1"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "value" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "value1" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "value" => "value1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_non-null_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_non-null_to_null.golden new file mode 100644 index 000000000..eff89843a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_non-null_to_null.golden @@ -0,0 +1,17 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_null_to_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_null_to_empty.golden new file mode 100644 index 000000000..9589fbdf0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_null_to_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_null_to_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_null_to_non-null.golden new file mode 100644 index 000000000..2672c4e43 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/changed_null_to_non-null.golden @@ -0,0 +1,41 @@ +tests.testOutput{ + changeValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = (known after apply) + + nested = "value" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + nested : "value" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed.golden new file mode 100644 index 000000000..b67f5c3e1 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_end.golden new file mode 100644 index 000000000..cb5cf4ece --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_end.golden @@ -0,0 +1,72 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_end_unordered.golden new file mode 100644 index 000000000..899c8114b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_end_unordered.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val2" + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_front.golden new file mode 100644 index 000000000..f3b02f42d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_front.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val2" + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_front_unordered.golden new file mode 100644 index 000000000..16a35f8b6 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_front_unordered.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_middle.golden new file mode 100644 index 000000000..d799448f4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_middle.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_middle_unordered.golden new file mode 100644 index 000000000..dabc5aebc --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/removed_middle_unordered.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + "val2", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/same_element_updated.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/same_element_updated.golden new file mode 100644 index 000000000..9b8aa8b52 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/same_element_updated.golden @@ -0,0 +1,79 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val4", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + + test { + + computed = (known after apply) + + nested = "val4" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val4" + } + ~ [2]: { + ~ nested : "val3" => "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/same_element_updated_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/same_element_updated_unordered.golden new file mode 100644 index 000000000..be19e29c7 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/same_element_updated_unordered.golden @@ -0,0 +1,77 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val4", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val4" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + ~ [2]: { + ~ nested : "val3" => "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled.golden new file mode 100644 index 000000000..b22444299 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_added_end.golden new file mode 100644 index 000000000..83564177f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_added_end.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val2", + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_added_front.golden new file mode 100644 index 000000000..8b796bce2 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_added_front.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val1" + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_added_middle.golden new file mode 100644 index 000000000..43f337249 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_added_middle.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_removed_end.golden new file mode 100644 index 000000000..39a220517 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_removed_end.golden @@ -0,0 +1,72 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_removed_front.golden new file mode 100644 index 000000000..acb278d4c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_removed_front.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val3" + } + ~ [1]: { + ~ nested : "val2" => "val2" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_removed_middle.golden new file mode 100644 index 000000000..323e01ff9 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_removed_middle.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_unordered.golden new file mode 100644 index 000000000..d98c38179 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_unordered.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_with_duplicates.golden new file mode 100644 index 000000000..09d74fe9c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_with_duplicates.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_with_duplicates_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_with_duplicates_unordered.golden new file mode 100644 index 000000000..1011e92c5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/shuffled_with_duplicates_unordered.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added.golden new file mode 100644 index 000000000..1637ef233 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added.golden @@ -0,0 +1,80 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + + test { + + computed = (known after apply) + + nested = "val4" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + + [3]: { + + nested : "val4" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + "tests[3]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added_and_two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added_and_two_removed.golden new file mode 100644 index 000000000..78e89cb3f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added_and_two_removed.golden @@ -0,0 +1,92 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + "val5", + "val6", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val4" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val5" + } + + test { + + computed = (known after apply) + + nested = "val6" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + ~ [2]: { + ~ nested : "val3" => "val5" + } + ~ [3]: { + ~ nested : "val4" => "val6" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added_and_two_removed_shuffled,_no_overlaps.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added_and_two_removed_shuffled,_no_overlaps.golden new file mode 100644 index 000000000..9f1fdbf0b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added_and_two_removed_shuffled,_no_overlaps.golden @@ -0,0 +1,92 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val5", + "val6", + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val4" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val5" + } + + test { + + computed = (known after apply) + + nested = "val6" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + ~ [2]: { + ~ nested : "val3" => "val1" + } + ~ [3]: { + ~ nested : "val4" => "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added_and_two_removed_shuffled,_one_overlaps.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added_and_two_removed_shuffled,_one_overlaps.golden new file mode 100644 index 000000000..09c91c9a5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added_and_two_removed_shuffled,_one_overlaps.golden @@ -0,0 +1,92 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val5", + "val6", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val4" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val5" + } + + test { + + computed = (known after apply) + + nested = "val6" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + ~ [2]: { + ~ nested : "val3" => "val6" + } + ~ [3]: { + ~ nested : "val4" => "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added_and_two_removed_shuffled,_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added_and_two_removed_shuffled,_with_duplicates.golden new file mode 100644 index 000000000..03a4d2a37 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_added_and_two_removed_shuffled,_with_duplicates.golden @@ -0,0 +1,94 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val5", + "val6", + "val2", + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val4" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val5" + } + + test { + + computed = (known after apply) + + nested = "val6" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + ~ [2]: { + ~ nested : "val3" => "val6" + } + ~ [3]: { + ~ nested : "val4" => "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_removed.golden new file mode 100644 index 000000000..6677548c8 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/two_removed.golden @@ -0,0 +1,82 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val4" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + - [3]: { + - computed: "" + - nested : "val4" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + "tests[3]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/unchanged_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/unchanged_empty.golden new file mode 100644 index 000000000..7d07227be --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/unchanged_non-empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/unchanged_non-empty.golden new file mode 100644 index 000000000..a87f03643 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/unchanged_non-empty.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value"}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/unchanged_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/unchanged_null.golden new file mode 100644 index 000000000..a53fac34d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace/unchanged_null.golden @@ -0,0 +1,11 @@ +tests.testOutput{tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added.golden new file mode 100644 index 000000000..9c107c39e --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added.golden @@ -0,0 +1,41 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{"value"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-value" + + nested = "value" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + computed : "non-computed-value" + + nested : "value" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_end.golden new file mode 100644 index 000000000..66fbc1c2d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_end_unordered.golden new file mode 100644 index 000000000..b1236f090 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_end_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_front.golden new file mode 100644 index 000000000..9a8683764 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_front_unordered.golden new file mode 100644 index 000000000..33112977a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_front_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_middle.golden new file mode 100644 index 000000000..3fa147fc4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_middle_unordered.golden new file mode 100644 index 000000000..bb02e047a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/added_middle_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_empty_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_empty_to_null.golden new file mode 100644 index 000000000..7bae19762 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_empty_to_null.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_non-null.golden new file mode 100644 index 000000000..89c888348 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_non-null.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value1"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-value" -> null + - nested = "value" -> null + } + + test { + + computed = "non-computed-value1" + + nested = "value1" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ computed: "non-computed-value" => "non-computed-value1" + ~ nested : "value" => "value1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_non-null_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_non-null_to_null.golden new file mode 100644 index 000000000..eff89843a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_non-null_to_null.golden @@ -0,0 +1,17 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_null_to_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_null_to_empty.golden new file mode 100644 index 000000000..9589fbdf0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_null_to_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_null_to_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_null_to_non-null.golden new file mode 100644 index 000000000..238c8dba3 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/changed_null_to_non-null.golden @@ -0,0 +1,42 @@ +tests.testOutput{ + changeValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-value" + + nested = "value" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + computed : "non-computed-value" + + nested : "value" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed.golden new file mode 100644 index 000000000..b67f5c3e1 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_end.golden new file mode 100644 index 000000000..101d829f4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_end_unordered.golden new file mode 100644 index 000000000..d3921213c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_end_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_front.golden new file mode 100644 index 000000000..95cec62f9 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_front_unordered.golden new file mode 100644 index 000000000..4ce1bb1bb --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_front_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_middle.golden new file mode 100644 index 000000000..e27759e65 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_middle_unordered.golden new file mode 100644 index 000000000..71aca2ff6 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/removed_middle_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + "val2", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/same_element_updated.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/same_element_updated.golden new file mode 100644 index 000000000..096344412 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/same_element_updated.golden @@ -0,0 +1,62 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val4", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + test { + + computed = "non-computed-val4" + + nested = "val4" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[1]": map[string]interface{}{"kind": "DELETE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/same_element_updated_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/same_element_updated_unordered.golden new file mode 100644 index 000000000..855997ff7 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/same_element_updated_unordered.golden @@ -0,0 +1,58 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val4", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + + test { + + computed = "non-computed-val4" + + nested = "val4" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [2]: { + ~ computed: "non-computed-val3" => "non-computed-val1" + ~ nested : "val3" => "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled.golden new file mode 100644 index 000000000..b22444299 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_added_end.golden new file mode 100644 index 000000000..ae58b0bcc --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_added_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val2", + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_added_front.golden new file mode 100644 index 000000000..c73db179d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_added_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_added_middle.golden new file mode 100644 index 000000000..ccd82694b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_added_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_removed_end.golden new file mode 100644 index 000000000..8741a83c6 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_removed_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_removed_front.golden new file mode 100644 index 000000000..e0d9d13c4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_removed_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_removed_middle.golden new file mode 100644 index 000000000..19dd48fb4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_removed_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_unordered.golden new file mode 100644 index 000000000..d98c38179 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_unordered.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_with_duplicates.golden new file mode 100644 index 000000000..09d74fe9c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_with_duplicates.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_with_duplicates_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_with_duplicates_unordered.golden new file mode 100644 index 000000000..1011e92c5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/shuffled_with_duplicates_unordered.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added.golden new file mode 100644 index 000000000..e43424e12 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added.golden @@ -0,0 +1,62 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val3" + + nested = "val3" + } + + test { + + computed = "non-computed-val4" + + nested = "val4" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + + [3]: { + + computed : "non-computed-val4" + + nested : "val4" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{}, + "tests[3]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added_and_two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added_and_two_removed.golden new file mode 100644 index 000000000..fc533b2c3 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added_and_two_removed.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + "val5", + "val6", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + - test { + - computed = "non-computed-val4" -> null + - nested = "val4" -> null + } + + test { + + computed = "non-computed-val5" + + nested = "val5" + } + + test { + + computed = "non-computed-val6" + + nested = "val6" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [2]: { + ~ computed: "non-computed-val3" => "non-computed-val5" + ~ nested : "val3" => "val5" + } + ~ [3]: { + ~ computed: "non-computed-val4" => "non-computed-val6" + ~ nested : "val4" => "val6" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_no_overlaps.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_no_overlaps.golden new file mode 100644 index 000000000..91b3776e3 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_no_overlaps.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val5", + "val6", + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + - test { + - computed = "non-computed-val4" -> null + - nested = "val4" -> null + } + + test { + + computed = "non-computed-val5" + + nested = "val5" + } + + test { + + computed = "non-computed-val6" + + nested = "val6" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [2]: { + ~ computed: "non-computed-val3" => "non-computed-val1" + ~ nested : "val3" => "val1" + } + ~ [3]: { + ~ computed: "non-computed-val4" => "non-computed-val2" + ~ nested : "val4" => "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_one_overlaps.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_one_overlaps.golden new file mode 100644 index 000000000..872a2178d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_one_overlaps.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val5", + "val6", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + - test { + - computed = "non-computed-val4" -> null + - nested = "val4" -> null + } + + test { + + computed = "non-computed-val5" + + nested = "val5" + } + + test { + + computed = "non-computed-val6" + + nested = "val6" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [2]: { + ~ computed: "non-computed-val3" => "non-computed-val6" + ~ nested : "val3" => "val6" + } + ~ [3]: { + ~ computed: "non-computed-val4" => "non-computed-val2" + ~ nested : "val4" => "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_with_duplicates.golden new file mode 100644 index 000000000..82ff7cf7c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_with_duplicates.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val5", + "val6", + "val2", + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + - test { + - computed = "non-computed-val4" -> null + - nested = "val4" -> null + } + + test { + + computed = "non-computed-val5" + + nested = "val5" + } + + test { + + computed = "non-computed-val6" + + nested = "val6" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [2]: { + ~ computed: "non-computed-val3" => "non-computed-val6" + ~ nested : "val3" => "val6" + } + ~ [3]: { + ~ computed: "non-computed-val4" => "non-computed-val2" + ~ nested : "val4" => "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_removed.golden new file mode 100644 index 000000000..b811014c9 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/two_removed.golden @@ -0,0 +1,62 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + - test { + - computed = "non-computed-val4" -> null + - nested = "val4" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + - [3]: { + - computed: "non-computed-val4" + - nested : "val4" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + "tests[3]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/unchanged_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/unchanged_empty.golden new file mode 100644 index 000000000..7d07227be --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/unchanged_non-empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/unchanged_non-empty.golden new file mode 100644 index 000000000..a87f03643 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/unchanged_non-empty.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value"}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/unchanged_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/unchanged_null.golden new file mode 100644 index 000000000..a53fac34d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_computed_no_replace_computed_specified_in_program/unchanged_null.golden @@ -0,0 +1,11 @@ +tests.testOutput{tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added.golden new file mode 100644 index 000000000..94f5561c4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added.golden @@ -0,0 +1,40 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{"value"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = (known after apply) + + nested = "value" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_end.golden new file mode 100644 index 000000000..61e7023f4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_end.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_end_unordered.golden new file mode 100644 index 000000000..4a6c7975f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_end_unordered.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val2" + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_front.golden new file mode 100644 index 000000000..6c3c3e039 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_front.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val1" + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_front_unordered.golden new file mode 100644 index 000000000..a2a38aeba --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_front_unordered.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_middle.golden new file mode 100644 index 000000000..23cedb220 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_middle.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_middle_unordered.golden new file mode 100644 index 000000000..bdac10688 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/added_middle_unordered.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_empty_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_empty_to_null.golden new file mode 100644 index 000000000..7bae19762 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_empty_to_null.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_non-null.golden new file mode 100644 index 000000000..0170773e4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_non-null.golden @@ -0,0 +1,49 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value1"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "value" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "value1" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "value" => "value1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_non-null_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_non-null_to_null.golden new file mode 100644 index 000000000..5164e9405 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_non-null_to_null.golden @@ -0,0 +1,42 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "value" -> null + # (1 unchanged attribute hidden) + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - tests: [ + - [0]: { + - computed: "" + - nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_null_to_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_null_to_empty.golden new file mode 100644 index 000000000..9589fbdf0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_null_to_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_null_to_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_null_to_non-null.golden new file mode 100644 index 000000000..7e7fdd2f0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/changed_null_to_non-null.golden @@ -0,0 +1,41 @@ +tests.testOutput{ + changeValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = (known after apply) + + nested = "value" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed.golden new file mode 100644 index 000000000..be31441b2 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed.golden @@ -0,0 +1,43 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "value" -> null + # (1 unchanged attribute hidden) + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - tests: [ + - [0]: { + - computed: "" + - nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_end.golden new file mode 100644 index 000000000..49a453315 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_end.golden @@ -0,0 +1,72 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_end_unordered.golden new file mode 100644 index 000000000..27a71d3d4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_end_unordered.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val2" + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_front.golden new file mode 100644 index 000000000..f90856167 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_front.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val2" + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_front_unordered.golden new file mode 100644 index 000000000..57799de1f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_front_unordered.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_middle.golden new file mode 100644 index 000000000..648c2e19c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_middle.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_middle_unordered.golden new file mode 100644 index 000000000..f89fa4b2b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/removed_middle_unordered.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + "val2", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled.golden new file mode 100644 index 000000000..b22444299 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_added_end.golden new file mode 100644 index 000000000..f4a3a017d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_added_end.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val2", + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_added_front.golden new file mode 100644 index 000000000..b93394a26 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_added_front.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val1" + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_added_middle.golden new file mode 100644 index 000000000..0f251e5b6 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_added_middle.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_removed_end.golden new file mode 100644 index 000000000..8bc2fbdd1 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_removed_end.golden @@ -0,0 +1,72 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_removed_front.golden new file mode 100644 index 000000000..1930e4f5c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_removed_front.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val3" + } + ~ [1]: { + ~ nested : "val2" => "val2" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_removed_middle.golden new file mode 100644 index 000000000..0f33d25b0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_removed_middle.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_unordered.golden new file mode 100644 index 000000000..d98c38179 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_unordered.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_with_duplicates.golden new file mode 100644 index 000000000..09d74fe9c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_with_duplicates.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_with_duplicates_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_with_duplicates_unordered.golden new file mode 100644 index 000000000..1011e92c5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/shuffled_with_duplicates_unordered.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/two_added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/two_added.golden new file mode 100644 index 000000000..127e90847 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/two_added.golden @@ -0,0 +1,80 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val4" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + + [3]: { + + nested : "val4" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/two_removed.golden new file mode 100644 index 000000000..b6f28b466 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/two_removed.golden @@ -0,0 +1,82 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val4" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + - [3]: { + - computed: "" + - nested : "val4" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/unchanged_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/unchanged_empty.golden new file mode 100644 index 000000000..7d07227be --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/unchanged_non-empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/unchanged_non-empty.golden new file mode 100644 index 000000000..a87f03643 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/unchanged_non-empty.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value"}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/unchanged_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/unchanged_null.golden new file mode 100644 index 000000000..a53fac34d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new/unchanged_null.golden @@ -0,0 +1,11 @@ +tests.testOutput{tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added.golden new file mode 100644 index 000000000..1de9875a9 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added.golden @@ -0,0 +1,41 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{"value"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-value" + + nested = "value" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + computed : "non-computed-value" + + nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_end.golden new file mode 100644 index 000000000..9c1af455d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_end_unordered.golden new file mode 100644 index 000000000..5ab2ae62b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_end_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_front.golden new file mode 100644 index 000000000..24ebf3720 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_front_unordered.golden new file mode 100644 index 000000000..46e0f566a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_front_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_middle.golden new file mode 100644 index 000000000..cb91ff477 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_middle_unordered.golden new file mode 100644 index 000000000..b773be160 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/added_middle_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_empty_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_empty_to_null.golden new file mode 100644 index 000000000..7bae19762 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_empty_to_null.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_non-null.golden new file mode 100644 index 000000000..89c888348 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_non-null.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value1"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-value" -> null + - nested = "value" -> null + } + + test { + + computed = "non-computed-value1" + + nested = "value1" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ computed: "non-computed-value" => "non-computed-value1" + ~ nested : "value" => "value1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_non-null_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_non-null_to_null.golden new file mode 100644 index 000000000..e1cbce612 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_non-null_to_null.golden @@ -0,0 +1,42 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-value" -> null + - nested = "value" -> null + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - tests: [ + - [0]: { + - computed: "non-computed-value" + - nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_null_to_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_null_to_empty.golden new file mode 100644 index 000000000..9589fbdf0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_null_to_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_null_to_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_null_to_non-null.golden new file mode 100644 index 000000000..e2326c566 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/changed_null_to_non-null.golden @@ -0,0 +1,42 @@ +tests.testOutput{ + changeValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-value" + + nested = "value" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + computed : "non-computed-value" + + nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed.golden new file mode 100644 index 000000000..ea57b6068 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed.golden @@ -0,0 +1,43 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-value" -> null + - nested = "value" -> null + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - tests: [ + - [0]: { + - computed: "non-computed-value" + - nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_end.golden new file mode 100644 index 000000000..27b631a62 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_end_unordered.golden new file mode 100644 index 000000000..87c9ced14 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_end_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_front.golden new file mode 100644 index 000000000..74c0f7468 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_front_unordered.golden new file mode 100644 index 000000000..d83c330b0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_front_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_middle.golden new file mode 100644 index 000000000..7b3e9ce15 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_middle_unordered.golden new file mode 100644 index 000000000..8e95109d1 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/removed_middle_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + "val2", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled.golden new file mode 100644 index 000000000..b22444299 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_added_end.golden new file mode 100644 index 000000000..cf125372c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_added_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val2", + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_added_front.golden new file mode 100644 index 000000000..c8d7a3a0f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_added_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_added_middle.golden new file mode 100644 index 000000000..373c6cff9 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_added_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_removed_end.golden new file mode 100644 index 000000000..9ec766ae5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_removed_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_removed_front.golden new file mode 100644 index 000000000..1a4103a07 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_removed_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_removed_middle.golden new file mode 100644 index 000000000..40b9ff67a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_removed_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_unordered.golden new file mode 100644 index 000000000..d98c38179 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_unordered.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_with_duplicates.golden new file mode 100644 index 000000000..09d74fe9c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_with_duplicates.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_with_duplicates_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_with_duplicates_unordered.golden new file mode 100644 index 000000000..1011e92c5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/shuffled_with_duplicates_unordered.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/two_added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/two_added.golden new file mode 100644 index 000000000..353e54999 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/two_added.golden @@ -0,0 +1,62 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val3" + + nested = "val3" + } + + test { # forces replacement + + computed = "non-computed-val4" + + nested = "val4" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + + [3]: { + + computed : "non-computed-val4" + + nested : "val4" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/two_removed.golden new file mode 100644 index 000000000..fa8851ce6 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/two_removed.golden @@ -0,0 +1,62 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + - test { # forces replacement + - computed = "non-computed-val4" -> null + - nested = "val4" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + - [3]: { + - computed: "non-computed-val4" + - nested : "val4" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/unchanged_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/unchanged_empty.golden new file mode 100644 index 000000000..7d07227be --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/unchanged_non-empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/unchanged_non-empty.golden new file mode 100644 index 000000000..a87f03643 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/unchanged_non-empty.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value"}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/unchanged_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/unchanged_null.golden new file mode 100644 index 000000000..a53fac34d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_force_new_computed_specified_in_program/unchanged_null.golden @@ -0,0 +1,11 @@ +tests.testOutput{tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added.golden new file mode 100644 index 000000000..94f5561c4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added.golden @@ -0,0 +1,40 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{"value"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = (known after apply) + + nested = "value" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_end.golden new file mode 100644 index 000000000..61e7023f4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_end.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_end_unordered.golden new file mode 100644 index 000000000..39107993f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_end_unordered.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val2" + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_front.golden new file mode 100644 index 000000000..3a2d9fcbb --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_front.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val1" + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_front_unordered.golden new file mode 100644 index 000000000..4f04f29e8 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_front_unordered.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_middle.golden new file mode 100644 index 000000000..d91143690 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_middle.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_middle_unordered.golden new file mode 100644 index 000000000..bdac10688 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/added_middle_unordered.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_empty_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_empty_to_null.golden new file mode 100644 index 000000000..7bae19762 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_empty_to_null.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_non-null.golden new file mode 100644 index 000000000..3c61d1ead --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_non-null.golden @@ -0,0 +1,49 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value1"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "value" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "value1" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "value" => "value1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_non-null_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_non-null_to_null.golden new file mode 100644 index 000000000..5164e9405 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_non-null_to_null.golden @@ -0,0 +1,42 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "value" -> null + # (1 unchanged attribute hidden) + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - tests: [ + - [0]: { + - computed: "" + - nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_null_to_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_null_to_empty.golden new file mode 100644 index 000000000..9589fbdf0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_null_to_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_null_to_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_null_to_non-null.golden new file mode 100644 index 000000000..7e7fdd2f0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/changed_null_to_non-null.golden @@ -0,0 +1,41 @@ +tests.testOutput{ + changeValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = (known after apply) + + nested = "value" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed.golden new file mode 100644 index 000000000..be31441b2 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed.golden @@ -0,0 +1,43 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "value" -> null + # (1 unchanged attribute hidden) + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - tests: [ + - [0]: { + - computed: "" + - nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_end.golden new file mode 100644 index 000000000..49a453315 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_end.golden @@ -0,0 +1,72 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_end_unordered.golden new file mode 100644 index 000000000..11c25ea19 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_end_unordered.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val2" + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_front.golden new file mode 100644 index 000000000..7e9debb9f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_front.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val2" + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_front_unordered.golden new file mode 100644 index 000000000..b60d9fea3 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_front_unordered.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_middle.golden new file mode 100644 index 000000000..9c5e259b8 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_middle.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_middle_unordered.golden new file mode 100644 index 000000000..41194735b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/removed_middle_unordered.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + "val2", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled.golden new file mode 100644 index 000000000..b22444299 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_added_end.golden new file mode 100644 index 000000000..f4a3a017d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_added_end.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val2", + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_added_front.golden new file mode 100644 index 000000000..220ae1848 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_added_front.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val1" + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_added_middle.golden new file mode 100644 index 000000000..371fbf7e5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_added_middle.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_removed_end.golden new file mode 100644 index 000000000..8bc2fbdd1 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_removed_end.golden @@ -0,0 +1,72 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_removed_front.golden new file mode 100644 index 000000000..5fc7ca733 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_removed_front.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val3" + } + ~ [1]: { + ~ nested : "val2" => "val2" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_removed_middle.golden new file mode 100644 index 000000000..a9a784238 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_removed_middle.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_unordered.golden new file mode 100644 index 000000000..d98c38179 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_unordered.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_with_duplicates.golden new file mode 100644 index 000000000..09d74fe9c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_with_duplicates.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_with_duplicates_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_with_duplicates_unordered.golden new file mode 100644 index 000000000..1011e92c5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/shuffled_with_duplicates_unordered.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/two_added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/two_added.golden new file mode 100644 index 000000000..127e90847 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/two_added.golden @@ -0,0 +1,80 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val3" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val4" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + + [3]: { + + nested : "val4" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/two_removed.golden new file mode 100644 index 000000000..b6f28b466 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/two_removed.golden @@ -0,0 +1,82 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + - test { # forces replacement + - nested = "val4" -> null + # (1 unchanged attribute hidden) + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val1" + } + + test { # forces replacement + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + - [3]: { + - computed: "" + - nested : "val4" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/unchanged_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/unchanged_empty.golden new file mode 100644 index 000000000..7d07227be --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/unchanged_non-empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/unchanged_non-empty.golden new file mode 100644 index 000000000..a87f03643 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/unchanged_non-empty.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value"}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/unchanged_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/unchanged_null.golden new file mode 100644 index 000000000..a53fac34d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new/unchanged_null.golden @@ -0,0 +1,11 @@ +tests.testOutput{tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added.golden new file mode 100644 index 000000000..1de9875a9 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added.golden @@ -0,0 +1,41 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{"value"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-value" + + nested = "value" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + computed : "non-computed-value" + + nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_end.golden new file mode 100644 index 000000000..9c1af455d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_end_unordered.golden new file mode 100644 index 000000000..5ab2ae62b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_end_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_front.golden new file mode 100644 index 000000000..24ebf3720 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_front_unordered.golden new file mode 100644 index 000000000..46e0f566a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_front_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_middle.golden new file mode 100644 index 000000000..cb91ff477 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_middle_unordered.golden new file mode 100644 index 000000000..b773be160 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/added_middle_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_empty_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_empty_to_null.golden new file mode 100644 index 000000000..7bae19762 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_empty_to_null.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_non-null.golden new file mode 100644 index 000000000..3d40302c3 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_non-null.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value1"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-value" -> null + - nested = "value" -> null + } + + test { # forces replacement + + computed = "non-computed-value1" + + nested = "value1" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ computed: "non-computed-value" => "non-computed-value1" + ~ nested : "value" => "value1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_non-null_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_non-null_to_null.golden new file mode 100644 index 000000000..e1cbce612 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_non-null_to_null.golden @@ -0,0 +1,42 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-value" -> null + - nested = "value" -> null + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - tests: [ + - [0]: { + - computed: "non-computed-value" + - nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_null_to_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_null_to_empty.golden new file mode 100644 index 000000000..9589fbdf0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_null_to_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_null_to_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_null_to_non-null.golden new file mode 100644 index 000000000..e2326c566 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/changed_null_to_non-null.golden @@ -0,0 +1,42 @@ +tests.testOutput{ + changeValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-value" + + nested = "value" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + computed : "non-computed-value" + + nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed.golden new file mode 100644 index 000000000..ea57b6068 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed.golden @@ -0,0 +1,43 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-value" -> null + - nested = "value" -> null + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - tests: [ + - [0]: { + - computed: "non-computed-value" + - nested : "value" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_end.golden new file mode 100644 index 000000000..27b631a62 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_end_unordered.golden new file mode 100644 index 000000000..87c9ced14 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_end_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_front.golden new file mode 100644 index 000000000..74c0f7468 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_front_unordered.golden new file mode 100644 index 000000000..d83c330b0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_front_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_middle.golden new file mode 100644 index 000000000..7b3e9ce15 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_middle_unordered.golden new file mode 100644 index 000000000..8e95109d1 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/removed_middle_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + "val2", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled.golden new file mode 100644 index 000000000..b22444299 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_end.golden new file mode 100644 index 000000000..cf125372c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val2", + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_front.golden new file mode 100644 index 000000000..c8d7a3a0f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_middle.golden new file mode 100644 index 000000000..373c6cff9 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_added_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_end.golden new file mode 100644 index 000000000..9ec766ae5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_front.golden new file mode 100644 index 000000000..1a4103a07 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_middle.golden new file mode 100644 index 000000000..40b9ff67a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_removed_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_unordered.golden new file mode 100644 index 000000000..d98c38179 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_unordered.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_with_duplicates.golden new file mode 100644 index 000000000..09d74fe9c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_with_duplicates.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_with_duplicates_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_with_duplicates_unordered.golden new file mode 100644 index 000000000..1011e92c5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/shuffled_with_duplicates_unordered.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/two_added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/two_added.golden new file mode 100644 index 000000000..353e54999 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/two_added.golden @@ -0,0 +1,62 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + + test { # forces replacement + + computed = "non-computed-val3" + + nested = "val3" + } + + test { # forces replacement + + computed = "non-computed-val4" + + nested = "val4" + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + + [3]: { + + computed : "non-computed-val4" + + nested : "val4" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/two_removed.golden new file mode 100644 index 000000000..fa8851ce6 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/two_removed.golden @@ -0,0 +1,62 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + + - test { # forces replacement + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + - test { # forces replacement + - computed = "non-computed-val4" -> null + - nested = "val4" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + - [3]: { + - computed: "non-computed-val4" + - nested : "val4" + } + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/unchanged_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/unchanged_empty.golden new file mode 100644 index 000000000..7d07227be --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/unchanged_non-empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/unchanged_non-empty.golden new file mode 100644 index 000000000..a87f03643 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/unchanged_non-empty.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value"}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/unchanged_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/unchanged_null.golden new file mode 100644 index 000000000..a53fac34d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_and_nested_force_new_computed_specified_in_program/unchanged_null.golden @@ -0,0 +1,11 @@ +tests.testOutput{tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added.golden new file mode 100644 index 000000000..8a0de2272 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added.golden @@ -0,0 +1,40 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{"value"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = (known after apply) + + nested = "value" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + nested : "value" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_end.golden new file mode 100644 index 000000000..f16128f51 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_end.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_end_unordered.golden new file mode 100644 index 000000000..9eee2d69d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_end_unordered.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val2" + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_front.golden new file mode 100644 index 000000000..1ee158309 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_front.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val1" + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_front_unordered.golden new file mode 100644 index 000000000..a81fe2957 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_front_unordered.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_middle.golden new file mode 100644 index 000000000..be8c5fc65 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_middle.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_middle_unordered.golden new file mode 100644 index 000000000..e18bd28d0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/added_middle_unordered.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_empty_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_empty_to_null.golden new file mode 100644 index 000000000..7bae19762 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_empty_to_null.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_non-null.golden new file mode 100644 index 000000000..0170773e4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_non-null.golden @@ -0,0 +1,49 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value1"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "value" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "value1" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "value" => "value1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_non-null_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_non-null_to_null.golden new file mode 100644 index 000000000..07629a3e3 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_non-null_to_null.golden @@ -0,0 +1,42 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "value" -> null + # (1 unchanged attribute hidden) + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - tests: [ + - [0]: { + - computed: "" + - nested : "value" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_null_to_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_null_to_empty.golden new file mode 100644 index 000000000..9589fbdf0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_null_to_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_null_to_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_null_to_non-null.golden new file mode 100644 index 000000000..2672c4e43 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/changed_null_to_non-null.golden @@ -0,0 +1,41 @@ +tests.testOutput{ + changeValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = (known after apply) + + nested = "value" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + nested : "value" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed.golden new file mode 100644 index 000000000..9d2c980b9 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed.golden @@ -0,0 +1,43 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "value" -> null + # (1 unchanged attribute hidden) + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - tests: [ + - [0]: { + - computed: "" + - nested : "value" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_end.golden new file mode 100644 index 000000000..cb5cf4ece --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_end.golden @@ -0,0 +1,72 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_end_unordered.golden new file mode 100644 index 000000000..899c8114b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_end_unordered.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val2" + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_front.golden new file mode 100644 index 000000000..f3b02f42d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_front.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val2" + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_front_unordered.golden new file mode 100644 index 000000000..16a35f8b6 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_front_unordered.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_middle.golden new file mode 100644 index 000000000..d799448f4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_middle.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val3" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_middle_unordered.golden new file mode 100644 index 000000000..dabc5aebc --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/removed_middle_unordered.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + "val2", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/same_element_updated.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/same_element_updated.golden new file mode 100644 index 000000000..9b8aa8b52 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/same_element_updated.golden @@ -0,0 +1,79 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val4", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + + test { + + computed = (known after apply) + + nested = "val4" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val4" + } + ~ [2]: { + ~ nested : "val3" => "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/same_element_updated_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/same_element_updated_unordered.golden new file mode 100644 index 000000000..be19e29c7 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/same_element_updated_unordered.golden @@ -0,0 +1,77 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val4", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val4" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + ~ [2]: { + ~ nested : "val3" => "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled.golden new file mode 100644 index 000000000..b22444299 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_added_end.golden new file mode 100644 index 000000000..83564177f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_added_end.golden @@ -0,0 +1,71 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val2", + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_added_front.golden new file mode 100644 index 000000000..8b796bce2 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_added_front.golden @@ -0,0 +1,75 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val2" => "val1" + } + ~ [1]: { + ~ nested : "val3" => "val3" + } + + [2]: { + + nested : "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_added_middle.golden new file mode 100644 index 000000000..43f337249 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_added_middle.golden @@ -0,0 +1,73 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val3" => "val2" + } + + [2]: { + + nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_removed_end.golden new file mode 100644 index 000000000..39a220517 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_removed_end.golden @@ -0,0 +1,72 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_removed_front.golden new file mode 100644 index 000000000..acb278d4c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_removed_front.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested : "val1" => "val3" + } + ~ [1]: { + ~ nested : "val2" => "val2" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_removed_middle.golden new file mode 100644 index 000000000..323e01ff9 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_removed_middle.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + ~ nested : "val2" => "val1" + } + - [2]: { + - computed: "" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_unordered.golden new file mode 100644 index 000000000..d98c38179 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_unordered.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_with_duplicates.golden new file mode 100644 index 000000000..09d74fe9c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_with_duplicates.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_with_duplicates_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_with_duplicates_unordered.golden new file mode 100644 index 000000000..1011e92c5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/shuffled_with_duplicates_unordered.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added.golden new file mode 100644 index 000000000..1637ef233 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added.golden @@ -0,0 +1,80 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val3" + } + + test { + + computed = (known after apply) + + nested = "val4" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + + [2]: { + + nested : "val3" + } + + [3]: { + + nested : "val4" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{}, + "tests[3]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added_and_two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added_and_two_removed.golden new file mode 100644 index 000000000..78e89cb3f --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added_and_two_removed.golden @@ -0,0 +1,92 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + "val5", + "val6", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val4" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val5" + } + + test { + + computed = (known after apply) + + nested = "val6" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + ~ [2]: { + ~ nested : "val3" => "val5" + } + ~ [3]: { + ~ nested : "val4" => "val6" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added_and_two_removed_shuffled,_no_overlaps.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added_and_two_removed_shuffled,_no_overlaps.golden new file mode 100644 index 000000000..9f1fdbf0b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added_and_two_removed_shuffled,_no_overlaps.golden @@ -0,0 +1,92 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val5", + "val6", + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val4" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val5" + } + + test { + + computed = (known after apply) + + nested = "val6" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + ~ [2]: { + ~ nested : "val3" => "val1" + } + ~ [3]: { + ~ nested : "val4" => "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added_and_two_removed_shuffled,_one_overlaps.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added_and_two_removed_shuffled,_one_overlaps.golden new file mode 100644 index 000000000..09c91c9a5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added_and_two_removed_shuffled,_one_overlaps.golden @@ -0,0 +1,92 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val5", + "val6", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val4" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val5" + } + + test { + + computed = (known after apply) + + nested = "val6" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + ~ [2]: { + ~ nested : "val3" => "val6" + } + ~ [3]: { + ~ nested : "val4" => "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added_and_two_removed_shuffled,_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added_and_two_removed_shuffled,_with_duplicates.golden new file mode 100644 index 000000000..03a4d2a37 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_added_and_two_removed_shuffled,_with_duplicates.golden @@ -0,0 +1,94 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val5", + "val6", + "val2", + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val4" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + + test { + + computed = (known after apply) + + nested = "val5" + } + + test { + + computed = (known after apply) + + nested = "val6" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + ~ [2]: { + ~ nested : "val3" => "val6" + } + ~ [3]: { + ~ nested : "val4" => "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_removed.golden new file mode 100644 index 000000000..6677548c8 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/two_removed.golden @@ -0,0 +1,82 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - nested = "val1" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val2" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val3" -> null + # (1 unchanged attribute hidden) + } + - test { + - nested = "val4" -> null + # (1 unchanged attribute hidden) + } + + test { + + computed = (known after apply) + + nested = "val1" + } + + test { + + computed = (known after apply) + + nested = "val2" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + } + ~ [1]: { + } + - [2]: { + - computed: "" + - nested : "val3" + } + - [3]: { + - computed: "" + - nested : "val4" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[1].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + "tests[3]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/unchanged_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/unchanged_empty.golden new file mode 100644 index 000000000..7d07227be --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/unchanged_non-empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/unchanged_non-empty.golden new file mode 100644 index 000000000..a87f03643 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/unchanged_non-empty.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value"}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/unchanged_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/unchanged_null.golden new file mode 100644 index 000000000..a53fac34d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace/unchanged_null.golden @@ -0,0 +1,11 @@ +tests.testOutput{tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added.golden new file mode 100644 index 000000000..9c107c39e --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added.golden @@ -0,0 +1,41 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{"value"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-value" + + nested = "value" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + computed : "non-computed-value" + + nested : "value" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_end.golden new file mode 100644 index 000000000..66fbc1c2d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_end_unordered.golden new file mode 100644 index 000000000..b1236f090 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_end_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_front.golden new file mode 100644 index 000000000..9a8683764 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_front_unordered.golden new file mode 100644 index 000000000..33112977a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_front_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_middle.golden new file mode 100644 index 000000000..3fa147fc4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_middle_unordered.golden new file mode 100644 index 000000000..bb02e047a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/added_middle_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_empty_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_empty_to_null.golden new file mode 100644 index 000000000..7bae19762 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_empty_to_null.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_non-null.golden new file mode 100644 index 000000000..89c888348 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_non-null.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value1"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-value" -> null + - nested = "value" -> null + } + + test { + + computed = "non-computed-value1" + + nested = "value1" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ computed: "non-computed-value" => "non-computed-value1" + ~ nested : "value" => "value1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[0].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_non-null_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_non-null_to_null.golden new file mode 100644 index 000000000..6d83e6015 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_non-null_to_null.golden @@ -0,0 +1,42 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-value" -> null + - nested = "value" -> null + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - tests: [ + - [0]: { + - computed: "non-computed-value" + - nested : "value" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_null_to_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_null_to_empty.golden new file mode 100644 index 000000000..9589fbdf0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_null_to_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_null_to_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_null_to_non-null.golden new file mode 100644 index 000000000..238c8dba3 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/changed_null_to_non-null.golden @@ -0,0 +1,42 @@ +tests.testOutput{ + changeValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-value" + + nested = "value" + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: { + + computed : "non-computed-value" + + nested : "value" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed.golden new file mode 100644 index 000000000..5246ebfdc --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed.golden @@ -0,0 +1,43 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-value" -> null + - nested = "value" -> null + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - tests: [ + - [0]: { + - computed: "non-computed-value" + - nested : "value" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_end.golden new file mode 100644 index 000000000..101d829f4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_end_unordered.golden new file mode 100644 index 000000000..d3921213c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_end_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_front.golden new file mode 100644 index 000000000..95cec62f9 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_front_unordered.golden new file mode 100644 index 000000000..4ce1bb1bb --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_front_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_middle.golden new file mode 100644 index 000000000..e27759e65 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_middle_unordered.golden new file mode 100644 index 000000000..71aca2ff6 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/removed_middle_unordered.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + "val2", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/same_element_updated.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/same_element_updated.golden new file mode 100644 index 000000000..096344412 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/same_element_updated.golden @@ -0,0 +1,62 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val4", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + test { + + computed = "non-computed-val4" + + nested = "val4" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[1]": map[string]interface{}{"kind": "DELETE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/same_element_updated_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/same_element_updated_unordered.golden new file mode 100644 index 000000000..855997ff7 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/same_element_updated_unordered.golden @@ -0,0 +1,58 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val4", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + + test { + + computed = "non-computed-val4" + + nested = "val4" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [2]: { + ~ computed: "non-computed-val3" => "non-computed-val1" + ~ nested : "val3" => "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled.golden new file mode 100644 index 000000000..b22444299 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_added_end.golden new file mode 100644 index 000000000..ae58b0bcc --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_added_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val2", + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val3" + + nested = "val3" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_added_front.golden new file mode 100644 index 000000000..c73db179d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_added_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val1" + + nested = "val1" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: { + + computed : "non-computed-val1" + + nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_added_middle.golden new file mode 100644 index 000000000..ccd82694b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_added_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val2" + + nested = "val2" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: { + + computed : "non-computed-val2" + + nested : "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_removed_end.golden new file mode 100644 index 000000000..8741a83c6 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_removed_end.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_removed_front.golden new file mode 100644 index 000000000..e0d9d13c4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_removed_front.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val1" -> null + - nested = "val1" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: { + - computed: "non-computed-val1" + - nested : "val1" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_removed_middle.golden new file mode 100644 index 000000000..19dd48fb4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_removed_middle.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val2" -> null + - nested = "val2" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: { + - computed: "non-computed-val2" + - nested : "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_unordered.golden new file mode 100644 index 000000000..d98c38179 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_unordered.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_with_duplicates.golden new file mode 100644 index 000000000..09d74fe9c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_with_duplicates.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_with_duplicates_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_with_duplicates_unordered.golden new file mode 100644 index 000000000..1011e92c5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/shuffled_with_duplicates_unordered.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added.golden new file mode 100644 index 000000000..e43424e12 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added.golden @@ -0,0 +1,62 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + + test { + + computed = "non-computed-val3" + + nested = "val3" + } + + test { + + computed = "non-computed-val4" + + nested = "val4" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: { + + computed : "non-computed-val3" + + nested : "val3" + } + + [3]: { + + computed : "non-computed-val4" + + nested : "val4" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{}, + "tests[3]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added_and_two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added_and_two_removed.golden new file mode 100644 index 000000000..fc533b2c3 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added_and_two_removed.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + "val5", + "val6", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + - test { + - computed = "non-computed-val4" -> null + - nested = "val4" -> null + } + + test { + + computed = "non-computed-val5" + + nested = "val5" + } + + test { + + computed = "non-computed-val6" + + nested = "val6" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [2]: { + ~ computed: "non-computed-val3" => "non-computed-val5" + ~ nested : "val3" => "val5" + } + ~ [3]: { + ~ computed: "non-computed-val4" => "non-computed-val6" + ~ nested : "val4" => "val6" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_no_overlaps.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_no_overlaps.golden new file mode 100644 index 000000000..91b3776e3 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_no_overlaps.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val5", + "val6", + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + - test { + - computed = "non-computed-val4" -> null + - nested = "val4" -> null + } + + test { + + computed = "non-computed-val5" + + nested = "val5" + } + + test { + + computed = "non-computed-val6" + + nested = "val6" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [2]: { + ~ computed: "non-computed-val3" => "non-computed-val1" + ~ nested : "val3" => "val1" + } + ~ [3]: { + ~ computed: "non-computed-val4" => "non-computed-val2" + ~ nested : "val4" => "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_one_overlaps.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_one_overlaps.golden new file mode 100644 index 000000000..872a2178d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_one_overlaps.golden @@ -0,0 +1,74 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val5", + "val6", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + - test { + - computed = "non-computed-val4" -> null + - nested = "val4" -> null + } + + test { + + computed = "non-computed-val5" + + nested = "val5" + } + + test { + + computed = "non-computed-val6" + + nested = "val6" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [2]: { + ~ computed: "non-computed-val3" => "non-computed-val6" + ~ nested : "val3" => "val6" + } + ~ [3]: { + ~ computed: "non-computed-val4" => "non-computed-val2" + ~ nested : "val4" => "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_with_duplicates.golden new file mode 100644 index 000000000..82ff7cf7c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_added_and_two_removed_shuffled,_with_duplicates.golden @@ -0,0 +1,76 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val5", + "val6", + "val2", + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + - test { + - computed = "non-computed-val4" -> null + - nested = "val4" -> null + } + + test { + + computed = "non-computed-val5" + + nested = "val5" + } + + test { + + computed = "non-computed-val6" + + nested = "val6" + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [2]: { + ~ computed: "non-computed-val3" => "non-computed-val6" + ~ nested : "val3" => "val6" + } + ~ [3]: { + ~ computed: "non-computed-val4" => "non-computed-val2" + ~ nested : "val4" => "val2" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].computed": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_removed.golden new file mode 100644 index 000000000..b811014c9 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/two_removed.golden @@ -0,0 +1,62 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + + - test { + - computed = "non-computed-val3" -> null + - nested = "val3" -> null + } + - test { + - computed = "non-computed-val4" -> null + - nested = "val4" -> null + } + + # (2 unchanged blocks hidden) + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: { + - computed: "non-computed-val3" + - nested : "val3" + } + - [3]: { + - computed: "non-computed-val4" + - nested : "val4" + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + "tests[3]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/unchanged_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/unchanged_empty.golden new file mode 100644 index 000000000..7d07227be --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/unchanged_non-empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/unchanged_non-empty.golden new file mode 100644 index 000000000..a87f03643 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/unchanged_non-empty.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value"}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/unchanged_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/unchanged_null.golden new file mode 100644 index 000000000..a53fac34d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/block_with_nested_computed_no_replace_computed_specified_in_program/unchanged_null.golden @@ -0,0 +1,11 @@ +tests.testOutput{tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added.golden new file mode 100644 index 000000000..954d6936d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added.golden @@ -0,0 +1,36 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{"value"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + + "value", + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: "value" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_end.golden new file mode 100644 index 000000000..efb765e14 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_end.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + + "val3", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: "val3" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_end_unordered.golden new file mode 100644 index 000000000..36f6efad1 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_end_unordered.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + + "val1", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: "val2" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_front.golden new file mode 100644 index 000000000..31e792da5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_front.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + + "val1", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: "val1" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_front_unordered.golden new file mode 100644 index 000000000..67b2a3799 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_front_unordered.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + + "val2", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: "val3" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_middle.golden new file mode 100644 index 000000000..fcbd5e43e --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_middle.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + + "val2", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: "val2" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_middle_unordered.golden new file mode 100644 index 000000000..1cbc9a54b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/added_middle_unordered.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + + "val3", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: "val1" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_empty_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_empty_to_null.golden new file mode 100644 index 000000000..7bae19762 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_empty_to_null.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_non-null.golden new file mode 100644 index 000000000..697e4c5c9 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_non-null.golden @@ -0,0 +1,39 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value1"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + - "value", + + "value1", + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: "value" => "value1" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "UPDATE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_non-null_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_non-null_to_null.golden new file mode 100644 index 000000000..eff89843a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_non-null_to_null.golden @@ -0,0 +1,17 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_null_to_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_null_to_empty.golden new file mode 100644 index 000000000..9589fbdf0 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_null_to_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_null_to_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_null_to_non-null.golden new file mode 100644 index 000000000..e16ea5c7e --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/changed_null_to_non-null.golden @@ -0,0 +1,37 @@ +tests.testOutput{ + changeValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + + "value", + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [ + + [0]: "value" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed.golden new file mode 100644 index 000000000..60aaba5dd --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed.golden @@ -0,0 +1,38 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ + - "value", + ] -> (known after apply) # forces replacement + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - tests: [ + - [0]: "value" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_end.golden new file mode 100644 index 000000000..778429a10 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_end.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + - "val3", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: "val3" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_end_unordered.golden new file mode 100644 index 000000000..ba2e33837 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_end_unordered.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + - "val1", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: "val1" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_front.golden new file mode 100644 index 000000000..559e88f3c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_front.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + - "val1", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: "val1" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_front_unordered.golden new file mode 100644 index 000000000..66fb90e78 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_front_unordered.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + - "val2", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: "val2" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_middle.golden new file mode 100644 index 000000000..89b2548c5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_middle.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + - "val2", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: "val2" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_middle_unordered.golden new file mode 100644 index 000000000..a34fe9f43 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/removed_middle_unordered.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + "val2", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + - "val2", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: "val2" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled.golden new file mode 100644 index 000000000..b22444299 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_added_end.golden new file mode 100644 index 000000000..83c54b25e --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_added_end.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val2", + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + + "val3", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: "val3" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_added_front.golden new file mode 100644 index 000000000..062d80a9d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_added_front.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + + "val1", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: "val1" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_added_middle.golden new file mode 100644 index 000000000..4ba476ddf --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_added_middle.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + + "val2", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: "val2" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_removed_end.golden new file mode 100644 index 000000000..65bf2f44a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_removed_end.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + - "val3", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: "val3" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_removed_front.golden new file mode 100644 index 000000000..73f5630f4 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_removed_front.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + - "val1", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: "val1" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_removed_middle.golden new file mode 100644 index 000000000..adb70ea2c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_removed_middle.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + - "val2", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: "val2" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_unordered.golden new file mode 100644 index 000000000..d98c38179 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_unordered.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_with_duplicates.golden new file mode 100644 index 000000000..09d74fe9c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_with_duplicates.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_with_duplicates_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_with_duplicates_unordered.golden new file mode 100644 index 000000000..1011e92c5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/shuffled_with_duplicates_unordered.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/two_added.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/two_added.golden new file mode 100644 index 000000000..fd567fa7b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/two_added.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + + "val3", + + "val4", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: "val3" + + [3]: "val4" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "ADD_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "ADD_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/two_removed.golden new file mode 100644 index 000000000..c52a70c37 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/two_removed.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ test = [ # forces replacement + - "val3", + - "val4", + # (2 unchanged elements hidden) + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: "val3" + - [3]: "val4" + ] +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + "tests[3]": map[string]interface{}{"kind": "DELETE_REPLACE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/unchanged_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/unchanged_empty.golden new file mode 100644 index 000000000..7d07227be --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/unchanged_non-empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/unchanged_non-empty.golden new file mode 100644 index 000000000..a87f03643 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/unchanged_non-empty.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value"}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/unchanged_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/unchanged_null.golden new file mode 100644 index 000000000..a53fac34d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_force_new/unchanged_null.golden @@ -0,0 +1,11 @@ +tests.testOutput{tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added.golden new file mode 100644 index 000000000..3ca3626f8 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added.golden @@ -0,0 +1,37 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{"value"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "computed", + + "value", + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: "computed" => "value" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_end.golden new file mode 100644 index 000000000..7ee2106a7 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_end.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + + "val3", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: "val3" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_end_unordered.golden new file mode 100644 index 000000000..3f7bc6224 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_end_unordered.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + + "val1", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: "val2" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_front.golden new file mode 100644 index 000000000..8895df583 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_front.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + + "val1", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: "val1" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_front_unordered.golden new file mode 100644 index 000000000..45a210728 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_front_unordered.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + + "val2", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: "val3" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_middle.golden new file mode 100644 index 000000000..39cae1691 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_middle.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + + "val2", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: "val2" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_middle_unordered.golden new file mode 100644 index 000000000..dd82a0186 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/added_middle_unordered.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + + "val3", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: "val1" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_empty_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_empty_to_null.golden new file mode 100644 index 000000000..7bae19762 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_empty_to_null.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_non-null.golden new file mode 100644 index 000000000..123294b6b --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_non-null.golden @@ -0,0 +1,39 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value1"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "value", + + "value1", + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: "value" => "value1" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_non-null_to_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_non-null_to_null.golden new file mode 100644 index 000000000..eff89843a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_non-null_to_null.golden @@ -0,0 +1,17 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_null_to_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_null_to_empty.golden new file mode 100644 index 000000000..30ad73965 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_null_to_empty.golden @@ -0,0 +1,35 @@ +tests.testOutput{ + changeValue: &[]string{}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "computed", + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - tests: [ + - [0]: "computed" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_null_to_non-null.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_null_to_non-null.golden new file mode 100644 index 000000000..3fed7515a --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/changed_null_to_non-null.golden @@ -0,0 +1,38 @@ +tests.testOutput{ + changeValue: &[]string{ + "value", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "computed", + + "value", + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: "computed" => "value" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed.golden new file mode 100644 index 000000000..f19c6593e --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed.golden @@ -0,0 +1,38 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "value", + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - tests: [ + - [0]: "value" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_end.golden new file mode 100644 index 000000000..853195eb7 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_end.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "val3", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: "val3" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_end_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_end_unordered.golden new file mode 100644 index 000000000..c542534f7 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_end_unordered.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "val1", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: "val1" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_front.golden new file mode 100644 index 000000000..451cac3b8 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_front.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "val1", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: "val1" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_front_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_front_unordered.golden new file mode 100644 index 000000000..da0f3d3ce --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_front_unordered.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "val2", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: "val2" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_middle.golden new file mode 100644 index 000000000..9af564bb3 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_middle.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "val2", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: "val2" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_middle_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_middle_unordered.golden new file mode 100644 index 000000000..28fd761cf --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/removed_middle_unordered.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val3", + "val1", + "val2", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "val2", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: "val2" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/same_element_updated.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/same_element_updated.golden new file mode 100644 index 000000000..cafa789cc --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/same_element_updated.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val4", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "val2", + + "val4", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: "val2" + + [2]: "val3" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[1]": map[string]interface{}{"kind": "DELETE"}, + "tests[2]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/same_element_updated_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/same_element_updated_unordered.golden new file mode 100644 index 000000000..57fafddd9 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/same_element_updated_unordered.golden @@ -0,0 +1,46 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val2", + "val4", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "val3", + + "val4", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [2]: "val3" => "val1" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled.golden new file mode 100644 index 000000000..b22444299 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_added_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_added_end.golden new file mode 100644 index 000000000..40c2fe45c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_added_end.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val2", + "val1", + "val3", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + + "val3", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: "val3" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_added_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_added_front.golden new file mode 100644 index 000000000..9827f1c99 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_added_front.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + }, + changeValue: &[]string{ + "val1", + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + + "val1", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: "val1" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_added_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_added_middle.golden new file mode 100644 index 000000000..249ad9570 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_added_middle.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + + "val2", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: "val2" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_removed_end.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_removed_end.golden new file mode 100644 index 000000000..a7b63e504 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_removed_end.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val2", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "val3", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: "val3" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_removed_front.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_removed_front.golden new file mode 100644 index 000000000..6ca7784ef --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_removed_front.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "val1", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: "val1" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_removed_middle.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_removed_middle.golden new file mode 100644 index 000000000..f55f66baa --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_removed_middle.golden @@ -0,0 +1,44 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "val2", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: "val2" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_unordered.golden new file mode 100644 index 000000000..d98c38179 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_unordered.golden @@ -0,0 +1,24 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_with_duplicates.golden new file mode 100644 index 000000000..09d74fe9c --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_with_duplicates.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_with_duplicates_unordered.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_with_duplicates_unordered.golden new file mode 100644 index 000000000..1011e92c5 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/shuffled_with_duplicates_unordered.golden @@ -0,0 +1,25 @@ +tests.testOutput{ + initialValue: &[]string{ + "val2", + "val3", + "val1", + }, + changeValue: &[]string{ + "val3", + "val1", + "val2", + "val3", + }, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added.golden new file mode 100644 index 000000000..e79983b61 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + }, + changeValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + + "val3", + + "val4", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: "val3" + + [3]: "val4" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{}, + "tests[3]": map[string]interface{}{}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added_and_two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added_and_two_removed.golden new file mode 100644 index 000000000..c0e323986 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added_and_two_removed.golden @@ -0,0 +1,54 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + "val5", + "val6", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "val3", + - "val4", + + "val5", + + "val6", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [2]: "val3" => "val5" + ~ [3]: "val4" => "val6" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "UPDATE"}, + "tests[3]": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added_and_two_removed_shuffled,_no_overlaps.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added_and_two_removed_shuffled,_no_overlaps.golden new file mode 100644 index 000000000..09ef55654 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added_and_two_removed_shuffled,_no_overlaps.golden @@ -0,0 +1,54 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val5", + "val6", + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "val3", + - "val4", + + "val5", + + "val6", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [2]: "val3" => "val1" + ~ [3]: "val4" => "val2" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "UPDATE"}, + "tests[3]": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added_and_two_removed_shuffled,_one_overlaps.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added_and_two_removed_shuffled,_one_overlaps.golden new file mode 100644 index 000000000..d54850499 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added_and_two_removed_shuffled,_one_overlaps.golden @@ -0,0 +1,54 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val5", + "val6", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "val3", + - "val4", + + "val5", + + "val6", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [2]: "val3" => "val6" + ~ [3]: "val4" => "val2" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "UPDATE"}, + "tests[3]": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added_and_two_removed_shuffled,_with_duplicates.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added_and_two_removed_shuffled,_with_duplicates.golden new file mode 100644 index 000000000..dae33ce78 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_added_and_two_removed_shuffled,_with_duplicates.golden @@ -0,0 +1,56 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val5", + "val6", + "val2", + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "val3", + - "val4", + + "val5", + + "val6", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [2]: "val3" => "val6" + ~ [3]: "val4" => "val2" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "UPDATE"}, + "tests[3]": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_removed.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_removed.golden new file mode 100644 index 000000000..f97ddf92d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/two_removed.golden @@ -0,0 +1,50 @@ +tests.testOutput{ + initialValue: &[]string{ + "val1", + "val2", + "val3", + "val4", + }, + changeValue: &[]string{ + "val1", + "val2", + }, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "val3", + - "val4", + # (2 unchanged elements hidden) + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: "val3" + - [3]: "val4" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + "tests[3]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/unchanged_empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/unchanged_empty.golden new file mode 100644 index 000000000..ee393acc7 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/unchanged_empty.golden @@ -0,0 +1,36 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ test = [ + - "computed", + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - tests: [ + - [0]: "computed" + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/unchanged_non-empty.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/unchanged_non-empty.golden new file mode 100644 index 000000000..a87f03643 --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/unchanged_non-empty.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value"}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/unchanged_null.golden b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/unchanged_null.golden new file mode 100644 index 000000000..a53fac34d --- /dev/null +++ b/pkg/tests/testdata/TestDetailedDiffSet/computed_attribute_no_force_new/unchanged_null.golden @@ -0,0 +1,11 @@ +tests.testOutput{tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`}