diff --git a/pkg/tests/diff_test/detailed_diff_set_test.go b/pkg/tests/diff_test/detailed_diff_set_test.go index 89224b4c7..808688f38 100644 --- a/pkg/tests/diff_test/detailed_diff_set_test.go +++ b/pkg/tests/diff_test/detailed_diff_set_test.go @@ -575,3 +575,57 @@ func TestSDKv2DetailedDiffSetNestedComputedBlock(t *testing.T) { }) } } + +func TestSDKv2DetailedDiffSetBlockSensitive(t *testing.T) { + t.Parallel() + + blockSchemaSensitive := schema.Resource{ + Schema: map[string]*schema.Schema{ + "test": { + Type: schema.TypeSet, + Optional: true, + Sensitive: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "nested": { + Type: schema.TypeString, + Optional: true, + }, + }, + }, + }, + }, + } + + blockSchemaNestedSensitive := 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, + Sensitive: true, + }, + }, + }, + }, + }, + } + + setSchemaValueMakerPairs := []setSchemaValueMakerPair{ + {"block sensitive", blockSchemaSensitive, nestedListValueMaker}, + {"block nested sensitive", blockSchemaNestedSensitive, nestedListValueMaker}, + } + + for _, schemaValueMakerPair := range setSchemaValueMakerPairs { + t.Run(schemaValueMakerPair.name, func(t *testing.T) { + t.Parallel() + for _, scenario := range setScenarios() { + t.Run(scenario.name, runSetTest(schemaValueMakerPair.res, schemaValueMakerPair.valueMaker, scenario.initialValue, scenario.changeValue, false)) + } + }) + } +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/added.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/added.golden new file mode 100644 index 000000000..850a6778e --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/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: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "newid" + + + test { + # At least one attribute in this block is (or was) sensitive, + # so its contents will not be displayed. + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [secret] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/added_end.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/added_end.golden new file mode 100644 index 000000000..4c5e337fc --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/added_end.golden @@ -0,0 +1,47 @@ +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 = "newid" + + + test { + # At least one attribute in this block is (or was) sensitive, + # so its contents will not be displayed. + } + + # (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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: [secret] + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/added_end_unordered.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/added_end_unordered.golden new file mode 100644 index 000000000..de1bf9b74 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/added_end_unordered.golden @@ -0,0 +1,47 @@ +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 = "newid" + + + test { + # At least one attribute in this block is (or was) sensitive, + # so its contents will not be displayed. + } + + # (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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: [secret] + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/added_front.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/added_front.golden new file mode 100644 index 000000000..c5c854373 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/added_front.golden @@ -0,0 +1,47 @@ +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 = "newid" + + + test { + # At least one attribute in this block is (or was) sensitive, + # so its contents will not be displayed. + } + + # (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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: [secret] + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/added_front_unordered.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/added_front_unordered.golden new file mode 100644 index 000000000..ab8199633 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/added_front_unordered.golden @@ -0,0 +1,47 @@ +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 = "newid" + + + test { + # At least one attribute in this block is (or was) sensitive, + # so its contents will not be displayed. + } + + # (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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: [secret] + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/added_middle.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/added_middle.golden new file mode 100644 index 000000000..c9a26e149 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/added_middle.golden @@ -0,0 +1,47 @@ +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 = "newid" + + + test { + # At least one attribute in this block is (or was) sensitive, + # so its contents will not be displayed. + } + + # (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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: [secret] + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/added_middle_unordered.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/added_middle_unordered.golden new file mode 100644 index 000000000..fe6a84016 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/added_middle_unordered.golden @@ -0,0 +1,47 @@ +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 = "newid" + + + test { + # At least one attribute in this block is (or was) sensitive, + # so its contents will not be displayed. + } + + # (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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: [secret] + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/changed_empty_to_null.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/changed_empty_to_null.golden new file mode 100644 index 000000000..ffec138c1 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/changed_empty_to_null.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: nil, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/changed_non-null.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/changed_non-null.golden new file mode 100644 index 000000000..491552bc5 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/changed_non-null.golden @@ -0,0 +1,46 @@ +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 = "newid" + + - test { + # At least one attribute in this block is (or was) sensitive, + # so its contents will not be displayed. + } + + test { + # At least one attribute in this block is (or was) sensitive, + # so its contents will not be displayed. + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested: [secret] => [secret] + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0].nested": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/changed_non-null_to_null.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/changed_non-null_to_null.golden new file mode 100644 index 000000000..f89bf7308 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/changed_non-null_to_null.golden @@ -0,0 +1,38 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: nil, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "newid" + + - test { + # At least one attribute in this block is (or was) sensitive, + # so its contents will not be displayed. + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - tests: [secret] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/changed_null_to_empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/changed_null_to_empty.golden new file mode 100644 index 000000000..5e63deeb2 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/changed_null_to_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: nil, 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/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/changed_null_to_non-null.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/changed_null_to_non-null.golden new file mode 100644 index 000000000..75e2f7bcc --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/changed_null_to_non-null.golden @@ -0,0 +1,37 @@ +tests.testOutput{ + initialValue: nil, 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 = "newid" + + + test { + # At least one attribute in this block is (or was) sensitive, + # so its contents will not be displayed. + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [secret] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/removed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/removed.golden new file mode 100644 index 000000000..7b4df09ca --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/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 = "newid" + + - test { + # At least one attribute in this block is (or was) sensitive, + # so its contents will not be displayed. + } + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - tests: [secret] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/removed_end.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/removed_end.golden new file mode 100644 index 000000000..ebd730dbd --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/removed_end.golden @@ -0,0 +1,47 @@ +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 = "newid" + + - test { + # At least one attribute in this block is (or was) sensitive, + # so its contents will not be displayed. + } + + # (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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: [secret] + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/removed_end_unordered.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/removed_end_unordered.golden new file mode 100644 index 000000000..97729965c --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/removed_end_unordered.golden @@ -0,0 +1,47 @@ +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 = "newid" + + - test { + # At least one attribute in this block is (or was) sensitive, + # so its contents will not be displayed. + } + + # (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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: [secret] + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/removed_front.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/removed_front.golden new file mode 100644 index 000000000..f10953ea7 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/removed_front.golden @@ -0,0 +1,47 @@ +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 = "newid" + + - test { + # At least one attribute in this block is (or was) sensitive, + # so its contents will not be displayed. + } + + # (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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: [secret] + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/removed_front_unordered.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/removed_front_unordered.golden new file mode 100644 index 000000000..8c421c576 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/removed_front_unordered.golden @@ -0,0 +1,47 @@ +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 = "newid" + + - test { + # At least one attribute in this block is (or was) sensitive, + # so its contents will not be displayed. + } + + # (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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: [secret] + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/removed_middle.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/removed_middle.golden new file mode 100644 index 000000000..a4ee2a31e --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/removed_middle.golden @@ -0,0 +1,47 @@ +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 = "newid" + + - test { + # At least one attribute in this block is (or was) sensitive, + # so its contents will not be displayed. + } + + # (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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: [secret] + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/removed_middle_unordered.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/removed_middle_unordered.golden new file mode 100644 index 000000000..410a09fcc --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/removed_middle_unordered.golden @@ -0,0 +1,47 @@ +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 = "newid" + + - test { + # At least one attribute in this block is (or was) sensitive, + # so its contents will not be displayed. + } + + # (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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: [secret] + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/same_element_updated.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/same_element_updated.golden new file mode 100644 index 000000000..821728cb4 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/same_element_updated.golden @@ -0,0 +1,54 @@ +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 = "newid" + + - test { + # At least one attribute in this block is (or was) sensitive, + # so its contents will not be displayed. + } + + test { + # At least one attribute in this block is (or was) sensitive, + # so its contents will not be displayed. + } + + # (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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [1]: { + ~ nested: [secret] => [secret] + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1].nested": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/same_element_updated_unordered.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/same_element_updated_unordered.golden new file mode 100644 index 000000000..aea2b1675 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/same_element_updated_unordered.golden @@ -0,0 +1,56 @@ +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 = "newid" + + - test { + # At least one attribute in this block is (or was) sensitive, + # so its contents will not be displayed. + } + + test { + # At least one attribute in this block is (or was) sensitive, + # so its contents will not be displayed. + } + + # (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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: [secret] + - [2]: [secret] + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[1]": map[string]interface{}{}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/shuffled.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/shuffled.golden new file mode 100644 index 000000000..b22444299 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/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/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/shuffled_added_end.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/shuffled_added_end.golden new file mode 100644 index 000000000..22cdfc830 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/shuffled_added_end.golden @@ -0,0 +1,47 @@ +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 = "newid" + + + test { + # At least one attribute in this block is (or was) sensitive, + # so its contents will not be displayed. + } + + # (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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: [secret] + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/shuffled_added_front.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/shuffled_added_front.golden new file mode 100644 index 000000000..6dd8bcb9f --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/shuffled_added_front.golden @@ -0,0 +1,47 @@ +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 = "newid" + + + test { + # At least one attribute in this block is (or was) sensitive, + # so its contents will not be displayed. + } + + # (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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: [secret] + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/shuffled_added_middle.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/shuffled_added_middle.golden new file mode 100644 index 000000000..f6494e781 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/shuffled_added_middle.golden @@ -0,0 +1,47 @@ +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 = "newid" + + + test { + # At least one attribute in this block is (or was) sensitive, + # so its contents will not be displayed. + } + + # (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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: [secret] + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/shuffled_removed_end.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/shuffled_removed_end.golden new file mode 100644 index 000000000..d32209adb --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/shuffled_removed_end.golden @@ -0,0 +1,47 @@ +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 = "newid" + + - test { + # At least one attribute in this block is (or was) sensitive, + # so its contents will not be displayed. + } + + # (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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: [secret] + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/shuffled_removed_front.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/shuffled_removed_front.golden new file mode 100644 index 000000000..dccbbf340 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/shuffled_removed_front.golden @@ -0,0 +1,47 @@ +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 = "newid" + + - test { + # At least one attribute in this block is (or was) sensitive, + # so its contents will not be displayed. + } + + # (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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: [secret] + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/shuffled_removed_middle.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/shuffled_removed_middle.golden new file mode 100644 index 000000000..02d1805c7 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/shuffled_removed_middle.golden @@ -0,0 +1,47 @@ +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 = "newid" + + - test { + # At least one attribute in this block is (or was) sensitive, + # so its contents will not be displayed. + } + + # (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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: [secret] + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/shuffled_unordered.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/shuffled_unordered.golden new file mode 100644 index 000000000..d98c38179 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/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/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/shuffled_with_duplicates.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/shuffled_with_duplicates.golden new file mode 100644 index 000000000..09d74fe9c --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/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/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/shuffled_with_duplicates_unordered.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/shuffled_with_duplicates_unordered.golden new file mode 100644 index 000000000..1011e92c5 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/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/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/two_added.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/two_added.golden new file mode 100644 index 000000000..5f3c94b63 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/two_added.golden @@ -0,0 +1,56 @@ +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 = "newid" + + + test { + # At least one attribute in this block is (or was) sensitive, + # so its contents will not be displayed. + } + + test { + # At least one attribute in this block is (or was) sensitive, + # so its contents will not be displayed. + } + + # (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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: [secret] + + [3]: [secret] + ] +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/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/two_added_and_two_removed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/two_added_and_two_removed.golden new file mode 100644 index 000000000..de1dea8d5 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/two_added_and_two_removed.golden @@ -0,0 +1,70 @@ +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 = "newid" + + - test { + # At least one attribute in this block is (or was) sensitive, + # so its contents will not be displayed. + } + - test { + # At least one attribute in this block is (or was) sensitive, + # so its contents will not be displayed. + } + + test { + # At least one attribute in this block is (or was) sensitive, + # so its contents will not be displayed. + } + + test { + # At least one attribute in this block is (or was) sensitive, + # so its contents will not be displayed. + } + + # (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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [2]: { + ~ nested: [secret] => [secret] + } + ~ [3]: { + ~ nested: [secret] => [secret] + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/two_added_and_two_removed_shuffled,_no_overlaps.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/two_added_and_two_removed_shuffled,_no_overlaps.golden new file mode 100644 index 000000000..3296e5a14 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/two_added_and_two_removed_shuffled,_no_overlaps.golden @@ -0,0 +1,70 @@ +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 = "newid" + + - test { + # At least one attribute in this block is (or was) sensitive, + # so its contents will not be displayed. + } + - test { + # At least one attribute in this block is (or was) sensitive, + # so its contents will not be displayed. + } + + test { + # At least one attribute in this block is (or was) sensitive, + # so its contents will not be displayed. + } + + test { + # At least one attribute in this block is (or was) sensitive, + # so its contents will not be displayed. + } + + # (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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: [secret] + + [1]: [secret] + - [2]: [secret] + - [3]: [secret] + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0]": map[string]interface{}{}, + "tests[1]": map[string]interface{}{}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + "tests[3]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/two_added_and_two_removed_shuffled,_one_overlaps.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/two_added_and_two_removed_shuffled,_one_overlaps.golden new file mode 100644 index 000000000..2c4f7ba01 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/two_added_and_two_removed_shuffled,_one_overlaps.golden @@ -0,0 +1,70 @@ +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 = "newid" + + - test { + # At least one attribute in this block is (or was) sensitive, + # so its contents will not be displayed. + } + - test { + # At least one attribute in this block is (or was) sensitive, + # so its contents will not be displayed. + } + + test { + # At least one attribute in this block is (or was) sensitive, + # so its contents will not be displayed. + } + + test { + # At least one attribute in this block is (or was) sensitive, + # so its contents will not be displayed. + } + + # (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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: [secret] + ~ [2]: { + ~ nested: [secret] => [secret] + } + - [3]: [secret] + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[1]": map[string]interface{}{}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/two_added_and_two_removed_shuffled,_with_duplicates.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/two_added_and_two_removed_shuffled,_with_duplicates.golden new file mode 100644 index 000000000..94d8479e5 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/two_added_and_two_removed_shuffled,_with_duplicates.golden @@ -0,0 +1,72 @@ +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 = "newid" + + - test { + # At least one attribute in this block is (or was) sensitive, + # so its contents will not be displayed. + } + - test { + # At least one attribute in this block is (or was) sensitive, + # so its contents will not be displayed. + } + + test { + # At least one attribute in this block is (or was) sensitive, + # so its contents will not be displayed. + } + + test { + # At least one attribute in this block is (or was) sensitive, + # so its contents will not be displayed. + } + + # (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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: [secret] + ~ [2]: { + ~ nested: [secret] => [secret] + } + - [3]: [secret] + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[1]": map[string]interface{}{}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/two_removed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/two_removed.golden new file mode 100644 index 000000000..00cdfb430 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/two_removed.golden @@ -0,0 +1,56 @@ +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 = "newid" + + - test { + # At least one attribute in this block is (or was) sensitive, + # so its contents will not be displayed. + } + - test { + # At least one attribute in this block is (or was) sensitive, + # so its contents will not be displayed. + } + + # (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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: [secret] + - [3]: [secret] + ] +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/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/unchanged_empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/unchanged_empty.golden new file mode 100644 index 000000000..7d07227be --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/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/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/unchanged_non-empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/unchanged_non-empty.golden new file mode 100644 index 000000000..a87f03643 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/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/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/unchanged_null.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/unchanged_null.golden new file mode 100644 index 000000000..53d2a9794 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_nested_sensitive/unchanged_null.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: nil, changeValue: nil, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/added.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/added.golden new file mode 100644 index 000000000..ead166f9e --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/added.golden @@ -0,0 +1,35 @@ +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 = "newid" + + + test { + + 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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [secret] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/added_end.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/added_end.golden new file mode 100644 index 000000000..0e02f7fbb --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/added_end.golden @@ -0,0 +1,46 @@ +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 = "newid" + + + test { + + 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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: [secret] + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/added_end_unordered.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/added_end_unordered.golden new file mode 100644 index 000000000..b7a03a57b --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/added_end_unordered.golden @@ -0,0 +1,46 @@ +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 = "newid" + + + test { + + 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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: [secret] + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/added_front.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/added_front.golden new file mode 100644 index 000000000..ceec9f13b --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/added_front.golden @@ -0,0 +1,46 @@ +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 = "newid" + + + test { + + 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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: [secret] + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/added_front_unordered.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/added_front_unordered.golden new file mode 100644 index 000000000..6f9c2d1bb --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/added_front_unordered.golden @@ -0,0 +1,46 @@ +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 = "newid" + + + test { + + 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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: [secret] + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/added_middle.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/added_middle.golden new file mode 100644 index 000000000..dd3439bef --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/added_middle.golden @@ -0,0 +1,46 @@ +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 = "newid" + + + test { + + 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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: [secret] + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/added_middle_unordered.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/added_middle_unordered.golden new file mode 100644 index 000000000..a5d1cf314 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/added_middle_unordered.golden @@ -0,0 +1,46 @@ +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 = "newid" + + + test { + + 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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: [secret] + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/changed_empty_to_null.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/changed_empty_to_null.golden new file mode 100644 index 000000000..ffec138c1 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/changed_empty_to_null.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: nil, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/changed_non-null.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/changed_non-null.golden new file mode 100644 index 000000000..16be7628b --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/changed_non-null.golden @@ -0,0 +1,44 @@ +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 = "newid" + + - test { + - nested = "value" -> null + } + + test { + + 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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [0]: { + ~ nested: [secret] => [secret] + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0].nested": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/changed_non-null_to_null.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/changed_non-null_to_null.golden new file mode 100644 index 000000000..026d1eaee --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/changed_non-null_to_null.golden @@ -0,0 +1,37 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: nil, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "newid" + + - test { + - 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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - tests: [secret] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/changed_null_to_empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/changed_null_to_empty.golden new file mode 100644 index 000000000..5e63deeb2 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/changed_null_to_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: nil, 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/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/changed_null_to_non-null.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/changed_null_to_non-null.golden new file mode 100644 index 000000000..d28a79400 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/changed_null_to_non-null.golden @@ -0,0 +1,36 @@ +tests.testOutput{ + initialValue: nil, 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 = "newid" + + + test { + + 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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + tests: [secret] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/removed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/removed.golden new file mode 100644 index 000000000..378c70774 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/removed.golden @@ -0,0 +1,37 @@ +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 = "newid" + + - test { + - 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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - tests: [secret] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/removed_end.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/removed_end.golden new file mode 100644 index 000000000..1038f827f --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/removed_end.golden @@ -0,0 +1,46 @@ +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 = "newid" + + - test { + - 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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: [secret] + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/removed_end_unordered.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/removed_end_unordered.golden new file mode 100644 index 000000000..bcbf2e5ec --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/removed_end_unordered.golden @@ -0,0 +1,46 @@ +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 = "newid" + + - test { + - 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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: [secret] + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/removed_front.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/removed_front.golden new file mode 100644 index 000000000..642efbc29 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/removed_front.golden @@ -0,0 +1,46 @@ +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 = "newid" + + - test { + - 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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: [secret] + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/removed_front_unordered.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/removed_front_unordered.golden new file mode 100644 index 000000000..f52cf39ca --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/removed_front_unordered.golden @@ -0,0 +1,46 @@ +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 = "newid" + + - test { + - 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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: [secret] + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/removed_middle.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/removed_middle.golden new file mode 100644 index 000000000..7176d5971 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/removed_middle.golden @@ -0,0 +1,46 @@ +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 = "newid" + + - test { + - 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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: [secret] + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/removed_middle_unordered.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/removed_middle_unordered.golden new file mode 100644 index 000000000..6fa7c68e4 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/removed_middle_unordered.golden @@ -0,0 +1,46 @@ +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 = "newid" + + - test { + - 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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: [secret] + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/same_element_updated.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/same_element_updated.golden new file mode 100644 index 000000000..88a83a709 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/same_element_updated.golden @@ -0,0 +1,52 @@ +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 = "newid" + + - test { + - nested = "val2" -> null + } + + test { + + 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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [1]: { + ~ nested: [secret] => [secret] + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1].nested": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/same_element_updated_unordered.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/same_element_updated_unordered.golden new file mode 100644 index 000000000..02d169ed0 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/same_element_updated_unordered.golden @@ -0,0 +1,54 @@ +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 = "newid" + + - test { + - nested = "val3" -> null + } + + test { + + 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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: [secret] + - [2]: [secret] + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[1]": map[string]interface{}{}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/shuffled.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/shuffled.golden new file mode 100644 index 000000000..b22444299 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/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/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/shuffled_added_end.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/shuffled_added_end.golden new file mode 100644 index 000000000..94bf025fd --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/shuffled_added_end.golden @@ -0,0 +1,46 @@ +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 = "newid" + + + test { + + 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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: [secret] + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/shuffled_added_front.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/shuffled_added_front.golden new file mode 100644 index 000000000..4bfc37686 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/shuffled_added_front.golden @@ -0,0 +1,46 @@ +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 = "newid" + + + test { + + 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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: [secret] + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/shuffled_added_middle.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/shuffled_added_middle.golden new file mode 100644 index 000000000..c3513cc68 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/shuffled_added_middle.golden @@ -0,0 +1,46 @@ +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 = "newid" + + + test { + + 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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: [secret] + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/shuffled_removed_end.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/shuffled_removed_end.golden new file mode 100644 index 000000000..9cefcabf1 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/shuffled_removed_end.golden @@ -0,0 +1,46 @@ +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 = "newid" + + - test { + - 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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: [secret] + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[2]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/shuffled_removed_front.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/shuffled_removed_front.golden new file mode 100644 index 000000000..0504c5f23 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/shuffled_removed_front.golden @@ -0,0 +1,46 @@ +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 = "newid" + + - test { + - 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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [0]: [secret] + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[0]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/shuffled_removed_middle.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/shuffled_removed_middle.golden new file mode 100644 index 000000000..c703a2039 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/shuffled_removed_middle.golden @@ -0,0 +1,46 @@ +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 = "newid" + + - test { + - 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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [1]: [secret] + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"tests[1]": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/shuffled_unordered.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/shuffled_unordered.golden new file mode 100644 index 000000000..d98c38179 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/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/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/shuffled_with_duplicates.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/shuffled_with_duplicates.golden new file mode 100644 index 000000000..09d74fe9c --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/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/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/shuffled_with_duplicates_unordered.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/shuffled_with_duplicates_unordered.golden new file mode 100644 index 000000000..1011e92c5 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/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/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/two_added.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/two_added.golden new file mode 100644 index 000000000..aafa0fc09 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/two_added.golden @@ -0,0 +1,54 @@ +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 = "newid" + + + test { + + nested = "val3" + } + + test { + + 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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [2]: [secret] + + [3]: [secret] + ] +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/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/two_added_and_two_removed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/two_added_and_two_removed.golden new file mode 100644 index 000000000..2ad0c65f0 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/two_added_and_two_removed.golden @@ -0,0 +1,66 @@ +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 = "newid" + + - test { + - nested = "val3" -> null + } + - test { + - nested = "val4" -> null + } + + test { + + nested = "val5" + } + + test { + + 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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + ~ [2]: { + ~ nested: [secret] => [secret] + } + ~ [3]: { + ~ nested: [secret] => [secret] + } + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3].nested": map[string]interface{}{"kind": "UPDATE"}, + }, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/two_added_and_two_removed_shuffled,_no_overlaps.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/two_added_and_two_removed_shuffled,_no_overlaps.golden new file mode 100644 index 000000000..627adc622 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/two_added_and_two_removed_shuffled,_no_overlaps.golden @@ -0,0 +1,66 @@ +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 = "newid" + + - test { + - nested = "val3" -> null + } + - test { + - nested = "val4" -> null + } + + test { + + nested = "val5" + } + + test { + + 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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [0]: [secret] + + [1]: [secret] + - [2]: [secret] + - [3]: [secret] + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[0]": map[string]interface{}{}, + "tests[1]": map[string]interface{}{}, + "tests[2]": map[string]interface{}{"kind": "DELETE"}, + "tests[3]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/two_added_and_two_removed_shuffled,_one_overlaps.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/two_added_and_two_removed_shuffled,_one_overlaps.golden new file mode 100644 index 000000000..78a7be4a9 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/two_added_and_two_removed_shuffled,_one_overlaps.golden @@ -0,0 +1,66 @@ +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 = "newid" + + - test { + - nested = "val3" -> null + } + - test { + - nested = "val4" -> null + } + + test { + + nested = "val5" + } + + test { + + 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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: [secret] + ~ [2]: { + ~ nested: [secret] => [secret] + } + - [3]: [secret] + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[1]": map[string]interface{}{}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/two_added_and_two_removed_shuffled,_with_duplicates.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/two_added_and_two_removed_shuffled,_with_duplicates.golden new file mode 100644 index 000000000..7ff739e95 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/two_added_and_two_removed_shuffled,_with_duplicates.golden @@ -0,0 +1,68 @@ +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 = "newid" + + - test { + - nested = "val3" -> null + } + - test { + - nested = "val4" -> null + } + + test { + + nested = "val5" + } + + test { + + 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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + + [1]: [secret] + ~ [2]: { + ~ nested: [secret] => [secret] + } + - [3]: [secret] + ] +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{ + "tests[1]": map[string]interface{}{}, + "tests[2].nested": map[string]interface{}{"kind": "UPDATE"}, + "tests[3]": map[string]interface{}{"kind": "DELETE"}, + }, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/two_removed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/two_removed.golden new file mode 100644 index 000000000..ffeabebff --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/two_removed.golden @@ -0,0 +1,54 @@ +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 = "newid" + + - test { + - nested = "val3" -> null + } + - test { + - 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=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ tests: [ + - [2]: [secret] + - [3]: [secret] + ] +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/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/unchanged_empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/unchanged_empty.golden new file mode 100644 index 000000000..7d07227be --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/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/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/unchanged_non-empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/unchanged_non-empty.golden new file mode 100644 index 000000000..a87f03643 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/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/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/unchanged_null.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/unchanged_null.golden new file mode 100644 index 000000000..53d2a9794 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetBlockSensitive/block_sensitive/unchanged_null.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: nil, changeValue: nil, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +}