diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute/added.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute/added.golden new file mode 100644 index 000000000..2d97154a2 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute/added.golden @@ -0,0 +1,34 @@ +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" + + prop = [ + + "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] + + prop: "value" +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute/changed_empty_to_null.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute/changed_empty_to_null.golden new file mode 100644 index 000000000..ffec138c1 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute/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/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute/changed_non-null.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute/changed_non-null.golden new file mode 100644 index 000000000..d8ee9d97d --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute/changed_non-null.golden @@ -0,0 +1,37 @@ +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" + ~ prop = [ + - "value", + + "value1", + ] + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ prop: "value" => "value1" +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute/changed_non-null_to_null.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute/changed_non-null_to_null.golden new file mode 100644 index 000000000..f722fe4fd --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute/changed_non-null_to_null.golden @@ -0,0 +1,36 @@ +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" + ~ prop = [ + - "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] + - prop: "value" +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute/changed_null_to_empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute/changed_null_to_empty.golden new file mode 100644 index 000000000..5e63deeb2 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute/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/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute/changed_null_to_non-null.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute/changed_null_to_non-null.golden new file mode 100644 index 000000000..214e0a43e --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute/changed_null_to_non-null.golden @@ -0,0 +1,35 @@ +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" + + prop = [ + + "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] + + prop: "value" +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute/removed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute/removed.golden new file mode 100644 index 000000000..e15863bce --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute/removed.golden @@ -0,0 +1,36 @@ +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" + ~ prop = [ + - "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] + - prop: "value" +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute/unchanged_empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute/unchanged_empty.golden new file mode 100644 index 000000000..7d07227be --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute/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/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute/unchanged_non-empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute/unchanged_non-empty.golden new file mode 100644 index 000000000..a87f03643 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute/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/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute/unchanged_null.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute/unchanged_null.golden new file mode 100644 index 000000000..53d2a9794 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute/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/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute_force_new/added.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute_force_new/added.golden new file mode 100644 index 000000000..5298c65a6 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute_force_new/added.golden @@ -0,0 +1,34 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{"value"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "newid" -> (known after apply) + + prop = [ # forces replacement + + "value", + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + prop: "value" +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute_force_new/changed_empty_to_null.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute_force_new/changed_empty_to_null.golden new file mode 100644 index 000000000..ffec138c1 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute_force_new/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/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute_force_new/changed_non-null.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute_force_new/changed_non-null.golden new file mode 100644 index 000000000..ac1e42e51 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute_force_new/changed_non-null.golden @@ -0,0 +1,37 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value1"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "newid" -> (known after apply) + ~ prop = [ # forces replacement + - "value", + + "value1", + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ prop: "value" => "value1" +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE_REPLACE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute_force_new/changed_non-null_to_null.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute_force_new/changed_non-null_to_null.golden new file mode 100644 index 000000000..af0b0fb76 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute_force_new/changed_non-null_to_null.golden @@ -0,0 +1,36 @@ +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: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "newid" -> (known after apply) + - prop = [ # forces replacement + - "value", + ] -> null + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - prop: "value" +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute_force_new/changed_null_to_empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute_force_new/changed_null_to_empty.golden new file mode 100644 index 000000000..5e63deeb2 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute_force_new/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/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute_force_new/changed_null_to_non-null.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute_force_new/changed_null_to_non-null.golden new file mode 100644 index 000000000..f216b8ffe --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute_force_new/changed_null_to_non-null.golden @@ -0,0 +1,35 @@ +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: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "newid" -> (known after apply) + + prop = [ # forces replacement + + "value", + ] + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + prop: "value" +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute_force_new/removed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute_force_new/removed.golden new file mode 100644 index 000000000..f77d37a76 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute_force_new/removed.golden @@ -0,0 +1,36 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "newid" -> (known after apply) + - prop = [ # forces replacement + - "value", + ] -> null + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - prop: "value" +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute_force_new/unchanged_empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute_force_new/unchanged_empty.golden new file mode 100644 index 000000000..7d07227be --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute_force_new/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute_force_new/unchanged_non-empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute_force_new/unchanged_non-empty.golden new file mode 100644 index 000000000..a87f03643 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute_force_new/unchanged_non-empty.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value"}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute_force_new/unchanged_null.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute_force_new/unchanged_null.golden new file mode 100644 index 000000000..53d2a9794 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute_force_new/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/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block/added.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block/added.golden new file mode 100644 index 000000000..d77a34cee --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block/added.golden @@ -0,0 +1,37 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{"value"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "newid" + + + prop { + + nested_prop = "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] + + prop: { + + nestedProp: "value" + } +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block/changed_empty_to_null.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block/changed_empty_to_null.golden new file mode 100644 index 000000000..ffec138c1 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block/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/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block/changed_non-null.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block/changed_non-null.golden new file mode 100644 index 000000000..e1706b9d7 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block/changed_non-null.golden @@ -0,0 +1,42 @@ +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" + + - prop { + - nested_prop = "value" -> null + } + + prop { + + nested_prop = "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] + ~ prop: { + ~ nestedProp: "value" => "value1" + } +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop.nestedProp": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block/changed_non-null_to_null.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block/changed_non-null_to_null.golden new file mode 100644 index 000000000..bc9b73453 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block/changed_non-null_to_null.golden @@ -0,0 +1,39 @@ +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" + + - prop { + - nested_prop = "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] + - prop: { + - nestedProp: "value" + } +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block/changed_null_to_empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block/changed_null_to_empty.golden new file mode 100644 index 000000000..5e63deeb2 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block/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/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block/changed_null_to_non-null.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block/changed_null_to_non-null.golden new file mode 100644 index 000000000..2b8f74d59 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block/changed_null_to_non-null.golden @@ -0,0 +1,38 @@ +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" + + + prop { + + nested_prop = "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] + + prop: { + + nestedProp: "value" + } +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block/removed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block/removed.golden new file mode 100644 index 000000000..ea9f85023 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block/removed.golden @@ -0,0 +1,39 @@ +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" + + - prop { + - nested_prop = "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] + - prop: { + - nestedProp: "value" + } +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "DELETE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block/unchanged_empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block/unchanged_empty.golden new file mode 100644 index 000000000..7d07227be --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block/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/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block/unchanged_non-empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block/unchanged_non-empty.golden new file mode 100644 index 000000000..a87f03643 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block/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/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block/unchanged_null.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block/unchanged_null.golden new file mode 100644 index 000000000..53d2a9794 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block/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/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_force_new/added.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_force_new/added.golden new file mode 100644 index 000000000..ea16644bc --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_force_new/added.golden @@ -0,0 +1,37 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{"value"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "newid" -> (known after apply) + + + prop { # forces replacement + + nested_prop = "value" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + prop: { + + nestedProp: "value" + } +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_force_new/changed_empty_to_null.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_force_new/changed_empty_to_null.golden new file mode 100644 index 000000000..ffec138c1 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_force_new/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/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_force_new/changed_non-null.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_force_new/changed_non-null.golden new file mode 100644 index 000000000..e1706b9d7 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_force_new/changed_non-null.golden @@ -0,0 +1,42 @@ +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" + + - prop { + - nested_prop = "value" -> null + } + + prop { + + nested_prop = "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] + ~ prop: { + ~ nestedProp: "value" => "value1" + } +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop.nestedProp": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_force_new/changed_non-null_to_null.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_force_new/changed_non-null_to_null.golden new file mode 100644 index 000000000..ab40a3c6b --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_force_new/changed_non-null_to_null.golden @@ -0,0 +1,39 @@ +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: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "newid" -> (known after apply) + + - prop { # forces replacement + - nested_prop = "value" -> null + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - prop: { + - nestedProp: "value" + } +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_force_new/changed_null_to_empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_force_new/changed_null_to_empty.golden new file mode 100644 index 000000000..5e63deeb2 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_force_new/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/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_force_new/changed_null_to_non-null.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_force_new/changed_null_to_non-null.golden new file mode 100644 index 000000000..d2d575456 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_force_new/changed_null_to_non-null.golden @@ -0,0 +1,38 @@ +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: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "newid" -> (known after apply) + + + prop { # forces replacement + + nested_prop = "value" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + prop: { + + nestedProp: "value" + } +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_force_new/removed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_force_new/removed.golden new file mode 100644 index 000000000..905b66d5e --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_force_new/removed.golden @@ -0,0 +1,39 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "newid" -> (known after apply) + + - prop { # forces replacement + - nested_prop = "value" -> null + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - prop: { + - nestedProp: "value" + } +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_force_new/unchanged_empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_force_new/unchanged_empty.golden new file mode 100644 index 000000000..7d07227be --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_force_new/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_force_new/unchanged_non-empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_force_new/unchanged_non-empty.golden new file mode 100644 index 000000000..a87f03643 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_force_new/unchanged_non-empty.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value"}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_force_new/unchanged_null.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_force_new/unchanged_null.golden new file mode 100644 index 000000000..53d2a9794 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_force_new/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/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_nested_force_new/added.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_nested_force_new/added.golden new file mode 100644 index 000000000..ea16644bc --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_nested_force_new/added.golden @@ -0,0 +1,37 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{"value"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "newid" -> (known after apply) + + + prop { # forces replacement + + nested_prop = "value" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + prop: { + + nestedProp: "value" + } +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_nested_force_new/changed_empty_to_null.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_nested_force_new/changed_empty_to_null.golden new file mode 100644 index 000000000..ffec138c1 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_nested_force_new/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/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_nested_force_new/changed_non-null.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_nested_force_new/changed_non-null.golden new file mode 100644 index 000000000..f782e5684 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_nested_force_new/changed_non-null.golden @@ -0,0 +1,42 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value1"}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "newid" -> (known after apply) + + - prop { # forces replacement + - nested_prop = "value" -> null + } + + prop { # forces replacement + + nested_prop = "value1" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ prop: { + ~ nestedProp: "value" => "value1" + } +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop.nestedProp": map[string]interface{}{"kind": "UPDATE_REPLACE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_nested_force_new/changed_non-null_to_null.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_nested_force_new/changed_non-null_to_null.golden new file mode 100644 index 000000000..ab40a3c6b --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_nested_force_new/changed_non-null_to_null.golden @@ -0,0 +1,39 @@ +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: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "newid" -> (known after apply) + + - prop { # forces replacement + - nested_prop = "value" -> null + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - prop: { + - nestedProp: "value" + } +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_nested_force_new/changed_null_to_empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_nested_force_new/changed_null_to_empty.golden new file mode 100644 index 000000000..5e63deeb2 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_nested_force_new/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/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_nested_force_new/changed_null_to_non-null.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_nested_force_new/changed_null_to_non-null.golden new file mode 100644 index 000000000..d2d575456 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_nested_force_new/changed_null_to_non-null.golden @@ -0,0 +1,38 @@ +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: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "newid" -> (known after apply) + + + prop { # forces replacement + + nested_prop = "value" + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + prop: { + + nestedProp: "value" + } +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "ADD_REPLACE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_nested_force_new/removed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_nested_force_new/removed.golden new file mode 100644 index 000000000..905b66d5e --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_nested_force_new/removed.golden @@ -0,0 +1,39 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{}, + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "newid" -> (known after apply) + + - prop { # forces replacement + - nested_prop = "value" -> null + } + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - prop: { + - nestedProp: "value" + } +Resources: + +-1 to replace + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "DELETE_REPLACE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_nested_force_new/unchanged_empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_nested_force_new/unchanged_empty.golden new file mode 100644 index 000000000..7d07227be --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_nested_force_new/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: &[]string{}, + changeValue: &[]string{}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_nested_force_new/unchanged_non-empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_nested_force_new/unchanged_non-empty.golden new file mode 100644 index 000000000..a87f03643 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_nested_force_new/unchanged_non-empty.golden @@ -0,0 +1,18 @@ +tests.testOutput{ + initialValue: &[]string{ + "value", + }, + changeValue: &[]string{"value"}, + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_nested_force_new/unchanged_null.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_nested_force_new/unchanged_null.golden new file mode 100644 index 000000000..53d2a9794 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_block_nested_force_new/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 +`, +}