diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optional/added.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optional/added.golden new file mode 100644 index 000000000..cf38f6a37 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optional/added.golden @@ -0,0 +1,31 @@ +tests.testOutput{ + initialValue: valast.Ptr(false), changeValue: valast.Ptr(true), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ 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 = false -> true + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + 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: false => true +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optional/changed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optional/changed.golden new file mode 100644 index 000000000..564920693 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optional/changed.golden @@ -0,0 +1,31 @@ +tests.testOutput{ + initialValue: valast.Ptr(true), changeValue: valast.Ptr(false), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ 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 = true -> false + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + 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: true => false +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optional/removed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optional/removed.golden new file mode 100644 index 000000000..564920693 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optional/removed.golden @@ -0,0 +1,31 @@ +tests.testOutput{ + initialValue: valast.Ptr(true), changeValue: valast.Ptr(false), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ 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 = true -> false + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + 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: true => false +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optional/unchanged_empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optional/unchanged_empty.golden new file mode 100644 index 000000000..96e43c9b8 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optional/unchanged_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: valast.Ptr(false), changeValue: valast.Ptr(false), + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing 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/TestSDKv2DetailedDiffBool/optional/unchanged_non-empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optional/unchanged_non-empty.golden new file mode 100644 index 000000000..706b6da68 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optional/unchanged_non-empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: valast.Ptr(true), changeValue: valast.Ptr(true), + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing 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/TestSDKv2DetailedDiffBool/optionalComputed/added.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalComputed/added.golden new file mode 100644 index 000000000..c4701d306 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalComputed/added.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: valast.Ptr(false), changeValue: valast.Ptr(true), + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing 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/TestSDKv2DetailedDiffBool/optionalComputed/changed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalComputed/changed.golden new file mode 100644 index 000000000..5f507c6b3 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalComputed/changed.golden @@ -0,0 +1,31 @@ +tests.testOutput{ + initialValue: valast.Ptr(true), changeValue: valast.Ptr(false), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ prop = true -> false + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ prop: true => false +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalComputed/removed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalComputed/removed.golden new file mode 100644 index 000000000..5f507c6b3 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalComputed/removed.golden @@ -0,0 +1,31 @@ +tests.testOutput{ + initialValue: valast.Ptr(true), changeValue: valast.Ptr(false), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ prop = true -> false + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ prop: true => false +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalComputed/unchanged_empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalComputed/unchanged_empty.golden new file mode 100644 index 000000000..faa41da3d --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalComputed/unchanged_empty.golden @@ -0,0 +1,31 @@ +tests.testOutput{ + initialValue: valast.Ptr(false), changeValue: valast.Ptr(false), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ prop = true -> false + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ prop: true => false +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalComputed/unchanged_non-empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalComputed/unchanged_non-empty.golden new file mode 100644 index 000000000..706b6da68 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalComputed/unchanged_non-empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: valast.Ptr(true), changeValue: valast.Ptr(true), + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing 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/TestSDKv2DetailedDiffBool/optionalComputedForceNew/added.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalComputedForceNew/added.golden new file mode 100644 index 000000000..c4701d306 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalComputedForceNew/added.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: valast.Ptr(false), changeValue: valast.Ptr(true), + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing 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/TestSDKv2DetailedDiffBool/optionalComputedForceNew/changed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalComputedForceNew/changed.golden new file mode 100644 index 000000000..20b509a2c --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalComputedForceNew/changed.golden @@ -0,0 +1,31 @@ +tests.testOutput{ + initialValue: valast.Ptr(true), changeValue: valast.Ptr(false), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ prop = true -> false # forces replacement + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ prop: true => false +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/TestSDKv2DetailedDiffBool/optionalComputedForceNew/removed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalComputedForceNew/removed.golden new file mode 100644 index 000000000..20b509a2c --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalComputedForceNew/removed.golden @@ -0,0 +1,31 @@ +tests.testOutput{ + initialValue: valast.Ptr(true), changeValue: valast.Ptr(false), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ prop = true -> false # forces replacement + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ prop: true => false +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/TestSDKv2DetailedDiffBool/optionalComputedForceNew/unchanged_empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalComputedForceNew/unchanged_empty.golden new file mode 100644 index 000000000..21e7d83be --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalComputedForceNew/unchanged_empty.golden @@ -0,0 +1,31 @@ +tests.testOutput{ + initialValue: valast.Ptr(false), changeValue: valast.Ptr(false), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ prop = true -> false # forces replacement + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ prop: true => false +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/TestSDKv2DetailedDiffBool/optionalComputedForceNew/unchanged_non-empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalComputedForceNew/unchanged_non-empty.golden new file mode 100644 index 000000000..706b6da68 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalComputedForceNew/unchanged_non-empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: valast.Ptr(true), changeValue: valast.Ptr(true), + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing 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/TestSDKv2DetailedDiffBool/optionalDefault/added.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalDefault/added.golden new file mode 100644 index 000000000..cf38f6a37 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalDefault/added.golden @@ -0,0 +1,31 @@ +tests.testOutput{ + initialValue: valast.Ptr(false), changeValue: valast.Ptr(true), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ 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 = false -> true + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + 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: false => true +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalDefault/changed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalDefault/changed.golden new file mode 100644 index 000000000..564920693 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalDefault/changed.golden @@ -0,0 +1,31 @@ +tests.testOutput{ + initialValue: valast.Ptr(true), changeValue: valast.Ptr(false), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ 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 = true -> false + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + 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: true => false +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalDefault/removed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalDefault/removed.golden new file mode 100644 index 000000000..564920693 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalDefault/removed.golden @@ -0,0 +1,31 @@ +tests.testOutput{ + initialValue: valast.Ptr(true), changeValue: valast.Ptr(false), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ 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 = true -> false + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + 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: true => false +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalDefault/unchanged_empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalDefault/unchanged_empty.golden new file mode 100644 index 000000000..96e43c9b8 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalDefault/unchanged_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: valast.Ptr(false), changeValue: valast.Ptr(false), + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing 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/TestSDKv2DetailedDiffBool/optionalDefault/unchanged_non-empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalDefault/unchanged_non-empty.golden new file mode 100644 index 000000000..706b6da68 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalDefault/unchanged_non-empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: valast.Ptr(true), changeValue: valast.Ptr(true), + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing 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/TestSDKv2DetailedDiffBool/optionalDefaultForceNew/added.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalDefaultForceNew/added.golden new file mode 100644 index 000000000..15dcbecee --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalDefaultForceNew/added.golden @@ -0,0 +1,31 @@ +tests.testOutput{ + initialValue: valast.Ptr(false), changeValue: valast.Ptr(true), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- 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 = false -> true # forces replacement + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ prop: false => true +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/TestSDKv2DetailedDiffBool/optionalDefaultForceNew/changed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalDefaultForceNew/changed.golden new file mode 100644 index 000000000..b4e804ab5 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalDefaultForceNew/changed.golden @@ -0,0 +1,31 @@ +tests.testOutput{ + initialValue: valast.Ptr(true), changeValue: valast.Ptr(false), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- 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 = true -> false # forces replacement + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ prop: true => false +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/TestSDKv2DetailedDiffBool/optionalDefaultForceNew/removed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalDefaultForceNew/removed.golden new file mode 100644 index 000000000..b4e804ab5 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalDefaultForceNew/removed.golden @@ -0,0 +1,31 @@ +tests.testOutput{ + initialValue: valast.Ptr(true), changeValue: valast.Ptr(false), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- 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 = true -> false # forces replacement + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ prop: true => false +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/TestSDKv2DetailedDiffBool/optionalDefaultForceNew/unchanged_empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalDefaultForceNew/unchanged_empty.golden new file mode 100644 index 000000000..96e43c9b8 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalDefaultForceNew/unchanged_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: valast.Ptr(false), changeValue: valast.Ptr(false), + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing 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/TestSDKv2DetailedDiffBool/optionalDefaultForceNew/unchanged_non-empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalDefaultForceNew/unchanged_non-empty.golden new file mode 100644 index 000000000..706b6da68 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalDefaultForceNew/unchanged_non-empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: valast.Ptr(true), changeValue: valast.Ptr(true), + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing 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/TestSDKv2DetailedDiffBool/optionalForceNew/added.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalForceNew/added.golden new file mode 100644 index 000000000..15dcbecee --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalForceNew/added.golden @@ -0,0 +1,31 @@ +tests.testOutput{ + initialValue: valast.Ptr(false), changeValue: valast.Ptr(true), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- 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 = false -> true # forces replacement + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ prop: false => true +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/TestSDKv2DetailedDiffBool/optionalForceNew/changed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalForceNew/changed.golden new file mode 100644 index 000000000..b4e804ab5 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalForceNew/changed.golden @@ -0,0 +1,31 @@ +tests.testOutput{ + initialValue: valast.Ptr(true), changeValue: valast.Ptr(false), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- 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 = true -> false # forces replacement + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ prop: true => false +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/TestSDKv2DetailedDiffBool/optionalForceNew/removed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalForceNew/removed.golden new file mode 100644 index 000000000..b4e804ab5 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalForceNew/removed.golden @@ -0,0 +1,31 @@ +tests.testOutput{ + initialValue: valast.Ptr(true), changeValue: valast.Ptr(false), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- 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 = true -> false # forces replacement + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ prop: true => false +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/TestSDKv2DetailedDiffBool/optionalForceNew/unchanged_empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalForceNew/unchanged_empty.golden new file mode 100644 index 000000000..96e43c9b8 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalForceNew/unchanged_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: valast.Ptr(false), changeValue: valast.Ptr(false), + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing 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/TestSDKv2DetailedDiffBool/optionalForceNew/unchanged_non-empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalForceNew/unchanged_non-empty.golden new file mode 100644 index 000000000..706b6da68 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/optionalForceNew/unchanged_non-empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: valast.Ptr(true), changeValue: valast.Ptr(true), + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing 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/TestSDKv2DetailedDiffBool/required/added.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/required/added.golden new file mode 100644 index 000000000..cf38f6a37 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/required/added.golden @@ -0,0 +1,31 @@ +tests.testOutput{ + initialValue: valast.Ptr(false), changeValue: valast.Ptr(true), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ 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 = false -> true + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + 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: false => true +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/required/changed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/required/changed.golden new file mode 100644 index 000000000..564920693 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/required/changed.golden @@ -0,0 +1,31 @@ +tests.testOutput{ + initialValue: valast.Ptr(true), changeValue: valast.Ptr(false), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ 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 = true -> false + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + 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: true => false +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/required/removed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/required/removed.golden new file mode 100644 index 000000000..564920693 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/required/removed.golden @@ -0,0 +1,31 @@ +tests.testOutput{ + initialValue: valast.Ptr(true), changeValue: valast.Ptr(false), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ 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 = true -> false + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + 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: true => false +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/required/unchanged_empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/required/unchanged_empty.golden new file mode 100644 index 000000000..96e43c9b8 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/required/unchanged_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: valast.Ptr(false), changeValue: valast.Ptr(false), + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing 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/TestSDKv2DetailedDiffBool/required/unchanged_non-empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/required/unchanged_non-empty.golden new file mode 100644 index 000000000..706b6da68 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/required/unchanged_non-empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: valast.Ptr(true), changeValue: valast.Ptr(true), + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing 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/TestSDKv2DetailedDiffBool/requiredForceNew/added.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/requiredForceNew/added.golden new file mode 100644 index 000000000..15dcbecee --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/requiredForceNew/added.golden @@ -0,0 +1,31 @@ +tests.testOutput{ + initialValue: valast.Ptr(false), changeValue: valast.Ptr(true), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- 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 = false -> true # forces replacement + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ prop: false => true +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/TestSDKv2DetailedDiffBool/requiredForceNew/changed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/requiredForceNew/changed.golden new file mode 100644 index 000000000..b4e804ab5 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/requiredForceNew/changed.golden @@ -0,0 +1,31 @@ +tests.testOutput{ + initialValue: valast.Ptr(true), changeValue: valast.Ptr(false), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- 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 = true -> false # forces replacement + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ prop: true => false +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/TestSDKv2DetailedDiffBool/requiredForceNew/removed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/requiredForceNew/removed.golden new file mode 100644 index 000000000..b4e804ab5 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/requiredForceNew/removed.golden @@ -0,0 +1,31 @@ +tests.testOutput{ + initialValue: valast.Ptr(true), changeValue: valast.Ptr(false), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- 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 = true -> false # forces replacement + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ prop: true => false +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/TestSDKv2DetailedDiffBool/requiredForceNew/unchanged_empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/requiredForceNew/unchanged_empty.golden new file mode 100644 index 000000000..96e43c9b8 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/requiredForceNew/unchanged_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: valast.Ptr(false), changeValue: valast.Ptr(false), + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing 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/TestSDKv2DetailedDiffBool/requiredForceNew/unchanged_non-empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/requiredForceNew/unchanged_non-empty.golden new file mode 100644 index 000000000..706b6da68 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffBool/requiredForceNew/unchanged_non-empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: valast.Ptr(true), changeValue: valast.Ptr(true), + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing 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/TestSDKv2DetailedDiffFloat/optional/added.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optional/added.golden new file mode 100644 index 000000000..cfad67fbc --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optional/added.golden @@ -0,0 +1,32 @@ +tests.testOutput{ + initialValue: valast.Ptr(float64(0)), + changeValue: valast.Ptr(float64(1)), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ 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 = 0 -> 1 + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + 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: 0 => 1 +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optional/changed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optional/changed.golden new file mode 100644 index 000000000..198764dfe --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optional/changed.golden @@ -0,0 +1,32 @@ +tests.testOutput{ + initialValue: valast.Ptr(float64(1)), + changeValue: valast.Ptr(float64(2)), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ 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 = 1 -> 2 + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + 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: 1 => 2 +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optional/removed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optional/removed.golden new file mode 100644 index 000000000..04796494b --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optional/removed.golden @@ -0,0 +1,32 @@ +tests.testOutput{ + initialValue: valast.Ptr(float64(1)), + changeValue: valast.Ptr(float64(0)), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ 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 = 1 -> 0 + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + 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: 1 => 0 +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optional/unchanged_empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optional/unchanged_empty.golden new file mode 100644 index 000000000..1cd310bac --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optional/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: valast.Ptr(float64(0)), + changeValue: valast.Ptr(float64(0)), + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing 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/TestSDKv2DetailedDiffFloat/optional/unchanged_non-empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optional/unchanged_non-empty.golden new file mode 100644 index 000000000..fa2c69d67 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optional/unchanged_non-empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: valast.Ptr(float64(1)), + changeValue: valast.Ptr(float64(1)), + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing 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/TestSDKv2DetailedDiffFloat/optionalComputed/added.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalComputed/added.golden new file mode 100644 index 000000000..7ecf8f96a --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalComputed/added.golden @@ -0,0 +1,32 @@ +tests.testOutput{ + initialValue: valast.Ptr(float64(0)), + changeValue: valast.Ptr(float64(1)), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ prop = 3 -> 1 + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ prop: 3 => 1 +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalComputed/changed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalComputed/changed.golden new file mode 100644 index 000000000..301fd66fc --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalComputed/changed.golden @@ -0,0 +1,32 @@ +tests.testOutput{ + initialValue: valast.Ptr(float64(1)), + changeValue: valast.Ptr(float64(2)), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ prop = 1 -> 2 + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ prop: 1 => 2 +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalComputed/removed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalComputed/removed.golden new file mode 100644 index 000000000..f7df7690b --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalComputed/removed.golden @@ -0,0 +1,32 @@ +tests.testOutput{ + initialValue: valast.Ptr(float64(1)), + changeValue: valast.Ptr(float64(0)), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ prop = 1 -> 0 + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ prop: 1 => 0 +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalComputed/unchanged_empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalComputed/unchanged_empty.golden new file mode 100644 index 000000000..203f3e467 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalComputed/unchanged_empty.golden @@ -0,0 +1,32 @@ +tests.testOutput{ + initialValue: valast.Ptr(float64(0)), + changeValue: valast.Ptr(float64(0)), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ prop = 3 -> 0 + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ prop: 3 => 0 +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalComputed/unchanged_non-empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalComputed/unchanged_non-empty.golden new file mode 100644 index 000000000..fa2c69d67 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalComputed/unchanged_non-empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: valast.Ptr(float64(1)), + changeValue: valast.Ptr(float64(1)), + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing 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/TestSDKv2DetailedDiffFloat/optionalComputedForceNew/added.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalComputedForceNew/added.golden new file mode 100644 index 000000000..8d95a4556 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalComputedForceNew/added.golden @@ -0,0 +1,32 @@ +tests.testOutput{ + initialValue: valast.Ptr(float64(0)), + changeValue: valast.Ptr(float64(1)), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ prop = 3 -> 1 # forces replacement + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ prop: 3 => 1 +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/TestSDKv2DetailedDiffFloat/optionalComputedForceNew/changed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalComputedForceNew/changed.golden new file mode 100644 index 000000000..31c7358fd --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalComputedForceNew/changed.golden @@ -0,0 +1,32 @@ +tests.testOutput{ + initialValue: valast.Ptr(float64(1)), + changeValue: valast.Ptr(float64(2)), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ prop = 1 -> 2 # forces replacement + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ prop: 1 => 2 +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/TestSDKv2DetailedDiffFloat/optionalComputedForceNew/removed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalComputedForceNew/removed.golden new file mode 100644 index 000000000..a27e88235 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalComputedForceNew/removed.golden @@ -0,0 +1,32 @@ +tests.testOutput{ + initialValue: valast.Ptr(float64(1)), + changeValue: valast.Ptr(float64(0)), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ prop = 1 -> 0 # forces replacement + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ prop: 1 => 0 +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/TestSDKv2DetailedDiffFloat/optionalComputedForceNew/unchanged_empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalComputedForceNew/unchanged_empty.golden new file mode 100644 index 000000000..0e58c49fd --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalComputedForceNew/unchanged_empty.golden @@ -0,0 +1,32 @@ +tests.testOutput{ + initialValue: valast.Ptr(float64(0)), + changeValue: valast.Ptr(float64(0)), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ prop = 3 -> 0 # forces replacement + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ prop: 3 => 0 +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/TestSDKv2DetailedDiffFloat/optionalComputedForceNew/unchanged_non-empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalComputedForceNew/unchanged_non-empty.golden new file mode 100644 index 000000000..fa2c69d67 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalComputedForceNew/unchanged_non-empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: valast.Ptr(float64(1)), + changeValue: valast.Ptr(float64(1)), + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing 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/TestSDKv2DetailedDiffFloat/optionalDefault/added.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalDefault/added.golden new file mode 100644 index 000000000..cfad67fbc --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalDefault/added.golden @@ -0,0 +1,32 @@ +tests.testOutput{ + initialValue: valast.Ptr(float64(0)), + changeValue: valast.Ptr(float64(1)), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ 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 = 0 -> 1 + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + 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: 0 => 1 +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalDefault/changed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalDefault/changed.golden new file mode 100644 index 000000000..198764dfe --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalDefault/changed.golden @@ -0,0 +1,32 @@ +tests.testOutput{ + initialValue: valast.Ptr(float64(1)), + changeValue: valast.Ptr(float64(2)), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ 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 = 1 -> 2 + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + 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: 1 => 2 +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalDefault/removed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalDefault/removed.golden new file mode 100644 index 000000000..04796494b --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalDefault/removed.golden @@ -0,0 +1,32 @@ +tests.testOutput{ + initialValue: valast.Ptr(float64(1)), + changeValue: valast.Ptr(float64(0)), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ 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 = 1 -> 0 + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + 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: 1 => 0 +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalDefault/unchanged_empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalDefault/unchanged_empty.golden new file mode 100644 index 000000000..1cd310bac --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalDefault/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: valast.Ptr(float64(0)), + changeValue: valast.Ptr(float64(0)), + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing 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/TestSDKv2DetailedDiffFloat/optionalDefault/unchanged_non-empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalDefault/unchanged_non-empty.golden new file mode 100644 index 000000000..fa2c69d67 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalDefault/unchanged_non-empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: valast.Ptr(float64(1)), + changeValue: valast.Ptr(float64(1)), + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing 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/TestSDKv2DetailedDiffFloat/optionalDefaultForceNew/added.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalDefaultForceNew/added.golden new file mode 100644 index 000000000..0aa06cbd0 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalDefaultForceNew/added.golden @@ -0,0 +1,32 @@ +tests.testOutput{ + initialValue: valast.Ptr(float64(0)), + changeValue: valast.Ptr(float64(1)), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- 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 = 0 -> 1 # forces replacement + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ prop: 0 => 1 +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/TestSDKv2DetailedDiffFloat/optionalDefaultForceNew/changed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalDefaultForceNew/changed.golden new file mode 100644 index 000000000..330e15834 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalDefaultForceNew/changed.golden @@ -0,0 +1,32 @@ +tests.testOutput{ + initialValue: valast.Ptr(float64(1)), + changeValue: valast.Ptr(float64(2)), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- 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 = 1 -> 2 # forces replacement + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ prop: 1 => 2 +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/TestSDKv2DetailedDiffFloat/optionalDefaultForceNew/removed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalDefaultForceNew/removed.golden new file mode 100644 index 000000000..42cd5eb89 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalDefaultForceNew/removed.golden @@ -0,0 +1,32 @@ +tests.testOutput{ + initialValue: valast.Ptr(float64(1)), + changeValue: valast.Ptr(float64(0)), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- 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 = 1 -> 0 # forces replacement + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ prop: 1 => 0 +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/TestSDKv2DetailedDiffFloat/optionalDefaultForceNew/unchanged_empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalDefaultForceNew/unchanged_empty.golden new file mode 100644 index 000000000..1cd310bac --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalDefaultForceNew/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: valast.Ptr(float64(0)), + changeValue: valast.Ptr(float64(0)), + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing 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/TestSDKv2DetailedDiffFloat/optionalDefaultForceNew/unchanged_non-empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalDefaultForceNew/unchanged_non-empty.golden new file mode 100644 index 000000000..fa2c69d67 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalDefaultForceNew/unchanged_non-empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: valast.Ptr(float64(1)), + changeValue: valast.Ptr(float64(1)), + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing 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/TestSDKv2DetailedDiffFloat/optionalForceNew/added.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalForceNew/added.golden new file mode 100644 index 000000000..0aa06cbd0 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalForceNew/added.golden @@ -0,0 +1,32 @@ +tests.testOutput{ + initialValue: valast.Ptr(float64(0)), + changeValue: valast.Ptr(float64(1)), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- 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 = 0 -> 1 # forces replacement + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ prop: 0 => 1 +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/TestSDKv2DetailedDiffFloat/optionalForceNew/changed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalForceNew/changed.golden new file mode 100644 index 000000000..330e15834 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalForceNew/changed.golden @@ -0,0 +1,32 @@ +tests.testOutput{ + initialValue: valast.Ptr(float64(1)), + changeValue: valast.Ptr(float64(2)), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- 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 = 1 -> 2 # forces replacement + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ prop: 1 => 2 +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/TestSDKv2DetailedDiffFloat/optionalForceNew/removed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalForceNew/removed.golden new file mode 100644 index 000000000..42cd5eb89 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalForceNew/removed.golden @@ -0,0 +1,32 @@ +tests.testOutput{ + initialValue: valast.Ptr(float64(1)), + changeValue: valast.Ptr(float64(0)), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- 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 = 1 -> 0 # forces replacement + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ prop: 1 => 0 +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/TestSDKv2DetailedDiffFloat/optionalForceNew/unchanged_empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalForceNew/unchanged_empty.golden new file mode 100644 index 000000000..1cd310bac --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalForceNew/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: valast.Ptr(float64(0)), + changeValue: valast.Ptr(float64(0)), + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing 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/TestSDKv2DetailedDiffFloat/optionalForceNew/unchanged_non-empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalForceNew/unchanged_non-empty.golden new file mode 100644 index 000000000..fa2c69d67 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/optionalForceNew/unchanged_non-empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: valast.Ptr(float64(1)), + changeValue: valast.Ptr(float64(1)), + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing 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/TestSDKv2DetailedDiffFloat/required/added.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/required/added.golden new file mode 100644 index 000000000..cfad67fbc --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/required/added.golden @@ -0,0 +1,32 @@ +tests.testOutput{ + initialValue: valast.Ptr(float64(0)), + changeValue: valast.Ptr(float64(1)), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ 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 = 0 -> 1 + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + 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: 0 => 1 +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/required/changed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/required/changed.golden new file mode 100644 index 000000000..198764dfe --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/required/changed.golden @@ -0,0 +1,32 @@ +tests.testOutput{ + initialValue: valast.Ptr(float64(1)), + changeValue: valast.Ptr(float64(2)), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ 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 = 1 -> 2 + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + 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: 1 => 2 +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/required/removed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/required/removed.golden new file mode 100644 index 000000000..04796494b --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/required/removed.golden @@ -0,0 +1,32 @@ +tests.testOutput{ + initialValue: valast.Ptr(float64(1)), + changeValue: valast.Ptr(float64(0)), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ 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 = 1 -> 0 + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + 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: 1 => 0 +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/required/unchanged_empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/required/unchanged_empty.golden new file mode 100644 index 000000000..1cd310bac --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/required/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: valast.Ptr(float64(0)), + changeValue: valast.Ptr(float64(0)), + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing 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/TestSDKv2DetailedDiffFloat/required/unchanged_non-empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/required/unchanged_non-empty.golden new file mode 100644 index 000000000..fa2c69d67 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/required/unchanged_non-empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: valast.Ptr(float64(1)), + changeValue: valast.Ptr(float64(1)), + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing 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/TestSDKv2DetailedDiffFloat/requiredForceNew/added.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/requiredForceNew/added.golden new file mode 100644 index 000000000..0aa06cbd0 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/requiredForceNew/added.golden @@ -0,0 +1,32 @@ +tests.testOutput{ + initialValue: valast.Ptr(float64(0)), + changeValue: valast.Ptr(float64(1)), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- 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 = 0 -> 1 # forces replacement + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ prop: 0 => 1 +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/TestSDKv2DetailedDiffFloat/requiredForceNew/changed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/requiredForceNew/changed.golden new file mode 100644 index 000000000..330e15834 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/requiredForceNew/changed.golden @@ -0,0 +1,32 @@ +tests.testOutput{ + initialValue: valast.Ptr(float64(1)), + changeValue: valast.Ptr(float64(2)), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- 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 = 1 -> 2 # forces replacement + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ prop: 1 => 2 +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/TestSDKv2DetailedDiffFloat/requiredForceNew/removed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/requiredForceNew/removed.golden new file mode 100644 index 000000000..42cd5eb89 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/requiredForceNew/removed.golden @@ -0,0 +1,32 @@ +tests.testOutput{ + initialValue: valast.Ptr(float64(1)), + changeValue: valast.Ptr(float64(0)), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- 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 = 1 -> 0 # forces replacement + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ prop: 1 => 0 +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/TestSDKv2DetailedDiffFloat/requiredForceNew/unchanged_empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/requiredForceNew/unchanged_empty.golden new file mode 100644 index 000000000..1cd310bac --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/requiredForceNew/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: valast.Ptr(float64(0)), + changeValue: valast.Ptr(float64(0)), + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing 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/TestSDKv2DetailedDiffFloat/requiredForceNew/unchanged_non-empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/requiredForceNew/unchanged_non-empty.golden new file mode 100644 index 000000000..fa2c69d67 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffFloat/requiredForceNew/unchanged_non-empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: valast.Ptr(float64(1)), + changeValue: valast.Ptr(float64(1)), + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing 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/TestSDKv2DetailedDiffInt/optional/added.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optional/added.golden new file mode 100644 index 000000000..eb372e44d --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optional/added.golden @@ -0,0 +1,32 @@ +tests.testOutput{ + initialValue: valast.Ptr(int64(0)), + changeValue: valast.Ptr(int64(1)), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ 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 = 0 -> 1 + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + 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: 0 => 1 +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optional/changed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optional/changed.golden new file mode 100644 index 000000000..f0564af44 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optional/changed.golden @@ -0,0 +1,32 @@ +tests.testOutput{ + initialValue: valast.Ptr(int64(1)), + changeValue: valast.Ptr(int64(2)), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ 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 = 1 -> 2 + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + 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: 1 => 2 +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optional/removed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optional/removed.golden new file mode 100644 index 000000000..32ac766b7 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optional/removed.golden @@ -0,0 +1,32 @@ +tests.testOutput{ + initialValue: valast.Ptr(int64(1)), + changeValue: valast.Ptr(int64(0)), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ 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 = 1 -> 0 + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + 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: 1 => 0 +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optional/unchanged_empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optional/unchanged_empty.golden new file mode 100644 index 000000000..b2d49b145 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optional/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: valast.Ptr(int64(0)), + changeValue: valast.Ptr(int64(0)), + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing 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/TestSDKv2DetailedDiffInt/optional/unchanged_non-empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optional/unchanged_non-empty.golden new file mode 100644 index 000000000..ff4a6371a --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optional/unchanged_non-empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: valast.Ptr(int64(1)), + changeValue: valast.Ptr(int64(1)), + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing 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/TestSDKv2DetailedDiffInt/optionalComputed/added.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalComputed/added.golden new file mode 100644 index 000000000..094ac1be0 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalComputed/added.golden @@ -0,0 +1,32 @@ +tests.testOutput{ + initialValue: valast.Ptr(int64(0)), + changeValue: valast.Ptr(int64(1)), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ prop = 3 -> 1 + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ prop: 3 => 1 +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalComputed/changed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalComputed/changed.golden new file mode 100644 index 000000000..8143d2da5 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalComputed/changed.golden @@ -0,0 +1,32 @@ +tests.testOutput{ + initialValue: valast.Ptr(int64(1)), + changeValue: valast.Ptr(int64(2)), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ prop = 1 -> 2 + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ prop: 1 => 2 +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalComputed/removed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalComputed/removed.golden new file mode 100644 index 000000000..2a33bbd30 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalComputed/removed.golden @@ -0,0 +1,32 @@ +tests.testOutput{ + initialValue: valast.Ptr(int64(1)), + changeValue: valast.Ptr(int64(0)), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ prop = 1 -> 0 + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ prop: 1 => 0 +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalComputed/unchanged_empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalComputed/unchanged_empty.golden new file mode 100644 index 000000000..5450a0ee5 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalComputed/unchanged_empty.golden @@ -0,0 +1,32 @@ +tests.testOutput{ + initialValue: valast.Ptr(int64(0)), + changeValue: valast.Ptr(int64(0)), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ update in-place + +Terraform will perform the following actions: + + # crossprovider_test_res.example will be updated in-place + ~ resource "crossprovider_test_res" "example" { + id = "id" + ~ prop = 3 -> 0 + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + ~ crossprovider:index/testRes:TestRes: (update) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ prop: 3 => 0 +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalComputed/unchanged_non-empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalComputed/unchanged_non-empty.golden new file mode 100644 index 000000000..ff4a6371a --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalComputed/unchanged_non-empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: valast.Ptr(int64(1)), + changeValue: valast.Ptr(int64(1)), + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing 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/TestSDKv2DetailedDiffInt/optionalComputedForceNew/added.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalComputedForceNew/added.golden new file mode 100644 index 000000000..8100f7b6f --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalComputedForceNew/added.golden @@ -0,0 +1,32 @@ +tests.testOutput{ + initialValue: valast.Ptr(int64(0)), + changeValue: valast.Ptr(int64(1)), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ prop = 3 -> 1 # forces replacement + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ prop: 3 => 1 +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/TestSDKv2DetailedDiffInt/optionalComputedForceNew/changed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalComputedForceNew/changed.golden new file mode 100644 index 000000000..186276491 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalComputedForceNew/changed.golden @@ -0,0 +1,32 @@ +tests.testOutput{ + initialValue: valast.Ptr(int64(1)), + changeValue: valast.Ptr(int64(2)), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ prop = 1 -> 2 # forces replacement + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ prop: 1 => 2 +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/TestSDKv2DetailedDiffInt/optionalComputedForceNew/removed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalComputedForceNew/removed.golden new file mode 100644 index 000000000..d94315fd4 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalComputedForceNew/removed.golden @@ -0,0 +1,32 @@ +tests.testOutput{ + initialValue: valast.Ptr(int64(1)), + changeValue: valast.Ptr(int64(0)), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ prop = 1 -> 0 # forces replacement + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ prop: 1 => 0 +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/TestSDKv2DetailedDiffInt/optionalComputedForceNew/unchanged_empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalComputedForceNew/unchanged_empty.golden new file mode 100644 index 000000000..6710e22dd --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalComputedForceNew/unchanged_empty.golden @@ -0,0 +1,32 @@ +tests.testOutput{ + initialValue: valast.Ptr(int64(0)), + changeValue: valast.Ptr(int64(0)), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "id" -> (known after apply) + ~ prop = 3 -> 0 # forces replacement + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=id] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ prop: 3 => 0 +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/TestSDKv2DetailedDiffInt/optionalComputedForceNew/unchanged_non-empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalComputedForceNew/unchanged_non-empty.golden new file mode 100644 index 000000000..ff4a6371a --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalComputedForceNew/unchanged_non-empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: valast.Ptr(int64(1)), + changeValue: valast.Ptr(int64(1)), + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing 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/TestSDKv2DetailedDiffInt/optionalDefault/added.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalDefault/added.golden new file mode 100644 index 000000000..eb372e44d --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalDefault/added.golden @@ -0,0 +1,32 @@ +tests.testOutput{ + initialValue: valast.Ptr(int64(0)), + changeValue: valast.Ptr(int64(1)), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ 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 = 0 -> 1 + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + 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: 0 => 1 +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalDefault/changed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalDefault/changed.golden new file mode 100644 index 000000000..f0564af44 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalDefault/changed.golden @@ -0,0 +1,32 @@ +tests.testOutput{ + initialValue: valast.Ptr(int64(1)), + changeValue: valast.Ptr(int64(2)), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ 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 = 1 -> 2 + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + 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: 1 => 2 +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalDefault/removed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalDefault/removed.golden new file mode 100644 index 000000000..32ac766b7 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalDefault/removed.golden @@ -0,0 +1,32 @@ +tests.testOutput{ + initialValue: valast.Ptr(int64(1)), + changeValue: valast.Ptr(int64(0)), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ 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 = 1 -> 0 + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + 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: 1 => 0 +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalDefault/unchanged_empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalDefault/unchanged_empty.golden new file mode 100644 index 000000000..b2d49b145 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalDefault/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: valast.Ptr(int64(0)), + changeValue: valast.Ptr(int64(0)), + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing 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/TestSDKv2DetailedDiffInt/optionalDefault/unchanged_non-empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalDefault/unchanged_non-empty.golden new file mode 100644 index 000000000..ff4a6371a --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalDefault/unchanged_non-empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: valast.Ptr(int64(1)), + changeValue: valast.Ptr(int64(1)), + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing 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/TestSDKv2DetailedDiffInt/optionalDefaultForceNew/added.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalDefaultForceNew/added.golden new file mode 100644 index 000000000..57bb555b7 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalDefaultForceNew/added.golden @@ -0,0 +1,32 @@ +tests.testOutput{ + initialValue: valast.Ptr(int64(0)), + changeValue: valast.Ptr(int64(1)), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- 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 = 0 -> 1 # forces replacement + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ prop: 0 => 1 +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/TestSDKv2DetailedDiffInt/optionalDefaultForceNew/changed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalDefaultForceNew/changed.golden new file mode 100644 index 000000000..553434587 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalDefaultForceNew/changed.golden @@ -0,0 +1,32 @@ +tests.testOutput{ + initialValue: valast.Ptr(int64(1)), + changeValue: valast.Ptr(int64(2)), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- 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 = 1 -> 2 # forces replacement + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ prop: 1 => 2 +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/TestSDKv2DetailedDiffInt/optionalDefaultForceNew/removed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalDefaultForceNew/removed.golden new file mode 100644 index 000000000..4f9a5c0fd --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalDefaultForceNew/removed.golden @@ -0,0 +1,32 @@ +tests.testOutput{ + initialValue: valast.Ptr(int64(1)), + changeValue: valast.Ptr(int64(0)), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- 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 = 1 -> 0 # forces replacement + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ prop: 1 => 0 +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/TestSDKv2DetailedDiffInt/optionalDefaultForceNew/unchanged_empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalDefaultForceNew/unchanged_empty.golden new file mode 100644 index 000000000..b2d49b145 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalDefaultForceNew/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: valast.Ptr(int64(0)), + changeValue: valast.Ptr(int64(0)), + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing 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/TestSDKv2DetailedDiffInt/optionalDefaultForceNew/unchanged_non-empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalDefaultForceNew/unchanged_non-empty.golden new file mode 100644 index 000000000..ff4a6371a --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalDefaultForceNew/unchanged_non-empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: valast.Ptr(int64(1)), + changeValue: valast.Ptr(int64(1)), + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing 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/TestSDKv2DetailedDiffInt/optionalForceNew/added.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalForceNew/added.golden new file mode 100644 index 000000000..57bb555b7 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalForceNew/added.golden @@ -0,0 +1,32 @@ +tests.testOutput{ + initialValue: valast.Ptr(int64(0)), + changeValue: valast.Ptr(int64(1)), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- 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 = 0 -> 1 # forces replacement + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ prop: 0 => 1 +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/TestSDKv2DetailedDiffInt/optionalForceNew/changed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalForceNew/changed.golden new file mode 100644 index 000000000..553434587 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalForceNew/changed.golden @@ -0,0 +1,32 @@ +tests.testOutput{ + initialValue: valast.Ptr(int64(1)), + changeValue: valast.Ptr(int64(2)), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- 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 = 1 -> 2 # forces replacement + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ prop: 1 => 2 +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/TestSDKv2DetailedDiffInt/optionalForceNew/removed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalForceNew/removed.golden new file mode 100644 index 000000000..4f9a5c0fd --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalForceNew/removed.golden @@ -0,0 +1,32 @@ +tests.testOutput{ + initialValue: valast.Ptr(int64(1)), + changeValue: valast.Ptr(int64(0)), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- 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 = 1 -> 0 # forces replacement + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ prop: 1 => 0 +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/TestSDKv2DetailedDiffInt/optionalForceNew/unchanged_empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalForceNew/unchanged_empty.golden new file mode 100644 index 000000000..b2d49b145 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalForceNew/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: valast.Ptr(int64(0)), + changeValue: valast.Ptr(int64(0)), + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing 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/TestSDKv2DetailedDiffInt/optionalForceNew/unchanged_non-empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalForceNew/unchanged_non-empty.golden new file mode 100644 index 000000000..ff4a6371a --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/optionalForceNew/unchanged_non-empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: valast.Ptr(int64(1)), + changeValue: valast.Ptr(int64(1)), + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing 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/TestSDKv2DetailedDiffInt/required/added.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/required/added.golden new file mode 100644 index 000000000..eb372e44d --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/required/added.golden @@ -0,0 +1,32 @@ +tests.testOutput{ + initialValue: valast.Ptr(int64(0)), + changeValue: valast.Ptr(int64(1)), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ 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 = 0 -> 1 + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + 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: 0 => 1 +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/required/changed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/required/changed.golden new file mode 100644 index 000000000..f0564af44 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/required/changed.golden @@ -0,0 +1,32 @@ +tests.testOutput{ + initialValue: valast.Ptr(int64(1)), + changeValue: valast.Ptr(int64(2)), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ 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 = 1 -> 2 + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + 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: 1 => 2 +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/required/removed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/required/removed.golden new file mode 100644 index 000000000..32ac766b7 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/required/removed.golden @@ -0,0 +1,32 @@ +tests.testOutput{ + initialValue: valast.Ptr(int64(1)), + changeValue: valast.Ptr(int64(0)), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ 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 = 1 -> 0 + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + 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: 1 => 0 +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/required/unchanged_empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/required/unchanged_empty.golden new file mode 100644 index 000000000..b2d49b145 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/required/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: valast.Ptr(int64(0)), + changeValue: valast.Ptr(int64(0)), + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing 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/TestSDKv2DetailedDiffInt/required/unchanged_non-empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/required/unchanged_non-empty.golden new file mode 100644 index 000000000..ff4a6371a --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/required/unchanged_non-empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: valast.Ptr(int64(1)), + changeValue: valast.Ptr(int64(1)), + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing 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/TestSDKv2DetailedDiffInt/requiredForceNew/added.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/requiredForceNew/added.golden new file mode 100644 index 000000000..57bb555b7 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/requiredForceNew/added.golden @@ -0,0 +1,32 @@ +tests.testOutput{ + initialValue: valast.Ptr(int64(0)), + changeValue: valast.Ptr(int64(1)), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- 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 = 0 -> 1 # forces replacement + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ prop: 0 => 1 +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/TestSDKv2DetailedDiffInt/requiredForceNew/changed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/requiredForceNew/changed.golden new file mode 100644 index 000000000..553434587 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/requiredForceNew/changed.golden @@ -0,0 +1,32 @@ +tests.testOutput{ + initialValue: valast.Ptr(int64(1)), + changeValue: valast.Ptr(int64(2)), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- 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 = 1 -> 2 # forces replacement + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ prop: 1 => 2 +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/TestSDKv2DetailedDiffInt/requiredForceNew/removed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/requiredForceNew/removed.golden new file mode 100644 index 000000000..4f9a5c0fd --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/requiredForceNew/removed.golden @@ -0,0 +1,32 @@ +tests.testOutput{ + initialValue: valast.Ptr(int64(1)), + changeValue: valast.Ptr(int64(0)), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- 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 = 1 -> 0 # forces replacement + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + ~ prop: 1 => 0 +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/TestSDKv2DetailedDiffInt/requiredForceNew/unchanged_empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/requiredForceNew/unchanged_empty.golden new file mode 100644 index 000000000..b2d49b145 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/requiredForceNew/unchanged_empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: valast.Ptr(int64(0)), + changeValue: valast.Ptr(int64(0)), + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing 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/TestSDKv2DetailedDiffInt/requiredForceNew/unchanged_non-empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/requiredForceNew/unchanged_non-empty.golden new file mode 100644 index 000000000..ff4a6371a --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffInt/requiredForceNew/unchanged_non-empty.golden @@ -0,0 +1,16 @@ +tests.testOutput{ + initialValue: valast.Ptr(int64(1)), + changeValue: valast.Ptr(int64(1)), + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing 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/TestSDKv2DetailedDiffString/optional/added.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optional/added.golden index 94ba38c16..020e01e29 100644 --- a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optional/added.golden +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optional/added.golden @@ -1,5 +1,5 @@ tests.testOutput{ - initialValue: nil, changeValue: valast.Ptr("val1"), + initialValue: valast.Ptr(""), changeValue: valast.Ptr("val1"), tfOut: ` Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols: @@ -9,8 +9,8 @@ Terraform will perform the following actions: # crossprovider_test_res.example will be updated in-place ~ resource "crossprovider_test_res" "example" { - id = "newid" - + string_prop = "val1" + id = "newid" + + prop = "val1" } Plan: 0 to add, 1 to change, 0 to destroy. @@ -22,10 +22,10 @@ Plan: 0 to add, 1 to change, 0 to destroy. ~ crossprovider:index/testRes:TestRes: (update) [id=newid] [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] - + stringProp: "val1" + + prop: "val1" Resources: ~ 1 to update 1 unchanged `, - detailedDiff: map[string]interface{}{"stringProp": map[string]interface{}{}}, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE"}}, } diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optional/changed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optional/changed.golden index d32fc8650..3f412d2d5 100644 --- a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optional/changed.golden +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optional/changed.golden @@ -9,8 +9,8 @@ Terraform will perform the following actions: # crossprovider_test_res.example will be updated in-place ~ resource "crossprovider_test_res" "example" { - id = "newid" - ~ string_prop = "val1" -> "val2" + id = "newid" + ~ prop = "val1" -> "val2" } Plan: 0 to add, 1 to change, 0 to destroy. @@ -22,10 +22,10 @@ Plan: 0 to add, 1 to change, 0 to destroy. ~ crossprovider:index/testRes:TestRes: (update) [id=newid] [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] - ~ stringProp: "val1" => "val2" + ~ prop: "val1" => "val2" Resources: ~ 1 to update 1 unchanged `, - detailedDiff: map[string]interface{}{"stringProp": map[string]interface{}{"kind": "UPDATE"}}, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE"}}, } diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optional/removed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optional/removed.golden index e57708505..6d6cd3873 100644 --- a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optional/removed.golden +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optional/removed.golden @@ -1,5 +1,5 @@ tests.testOutput{ - initialValue: valast.Ptr("val1"), changeValue: nil, + initialValue: valast.Ptr("val1"), changeValue: valast.Ptr(""), tfOut: ` Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols: @@ -9,8 +9,8 @@ Terraform will perform the following actions: # crossprovider_test_res.example will be updated in-place ~ resource "crossprovider_test_res" "example" { - id = "newid" - - string_prop = "val1" -> null + id = "newid" + - prop = "val1" -> null } Plan: 0 to add, 1 to change, 0 to destroy. @@ -22,10 +22,10 @@ Plan: 0 to add, 1 to change, 0 to destroy. ~ crossprovider:index/testRes:TestRes: (update) [id=newid] [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] - - stringProp: "val1" + - prop: "val1" Resources: ~ 1 to update 1 unchanged `, - detailedDiff: map[string]interface{}{"stringProp": map[string]interface{}{"kind": "DELETE"}}, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE"}}, } diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optional/unchanged_empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optional/unchanged_empty.golden index 53d2a9794..a55e0790a 100644 --- a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optional/unchanged_empty.golden +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optional/unchanged_empty.golden @@ -1,5 +1,5 @@ tests.testOutput{ - initialValue: nil, changeValue: nil, + initialValue: valast.Ptr(""), changeValue: valast.Ptr(""), tfOut: ` No changes. Your infrastructure matches the configuration. diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalComputed/added.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalComputed/added.golden index bee51356c..b81c5b64c 100644 --- a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalComputed/added.golden +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalComputed/added.golden @@ -1,5 +1,5 @@ tests.testOutput{ - initialValue: nil, changeValue: valast.Ptr("val1"), + initialValue: valast.Ptr(""), changeValue: valast.Ptr("val1"), tfOut: ` Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols: @@ -9,8 +9,8 @@ Terraform will perform the following actions: # crossprovider_test_res.example will be updated in-place ~ resource "crossprovider_test_res" "example" { - id = "id" - ~ string_prop = "computed" -> "val1" + id = "id" + ~ prop = "computed" -> "val1" } Plan: 0 to add, 1 to change, 0 to destroy. @@ -22,10 +22,10 @@ Plan: 0 to add, 1 to change, 0 to destroy. ~ crossprovider:index/testRes:TestRes: (update) [id=id] [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] - ~ stringProp: "computed" => "val1" + ~ prop: "computed" => "val1" Resources: ~ 1 to update 1 unchanged `, - detailedDiff: map[string]interface{}{"stringProp": map[string]interface{}{"kind": "UPDATE"}}, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE"}}, } diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalComputed/changed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalComputed/changed.golden index 005d2837e..c0073f39b 100644 --- a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalComputed/changed.golden +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalComputed/changed.golden @@ -9,8 +9,8 @@ Terraform will perform the following actions: # crossprovider_test_res.example will be updated in-place ~ resource "crossprovider_test_res" "example" { - id = "id" - ~ string_prop = "val1" -> "val2" + id = "id" + ~ prop = "val1" -> "val2" } Plan: 0 to add, 1 to change, 0 to destroy. @@ -22,10 +22,10 @@ Plan: 0 to add, 1 to change, 0 to destroy. ~ crossprovider:index/testRes:TestRes: (update) [id=id] [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] - ~ stringProp: "val1" => "val2" + ~ prop: "val1" => "val2" Resources: ~ 1 to update 1 unchanged `, - detailedDiff: map[string]interface{}{"stringProp": map[string]interface{}{"kind": "UPDATE"}}, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE"}}, } diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalComputed/removed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalComputed/removed.golden index 70b2c0ae5..8a0ae1c46 100644 --- a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalComputed/removed.golden +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalComputed/removed.golden @@ -1,5 +1,5 @@ tests.testOutput{ - initialValue: valast.Ptr("val1"), changeValue: nil, + initialValue: valast.Ptr("val1"), changeValue: valast.Ptr(""), tfOut: ` No changes. Your infrastructure matches the configuration. diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalComputed/unchanged_empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalComputed/unchanged_empty.golden index 53d2a9794..a55e0790a 100644 --- a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalComputed/unchanged_empty.golden +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalComputed/unchanged_empty.golden @@ -1,5 +1,5 @@ tests.testOutput{ - initialValue: nil, changeValue: nil, + initialValue: valast.Ptr(""), changeValue: valast.Ptr(""), tfOut: ` No changes. Your infrastructure matches the configuration. diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalComputedForceNew/added.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalComputedForceNew/added.golden index 5e666e16a..360c94faa 100644 --- a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalComputedForceNew/added.golden +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalComputedForceNew/added.golden @@ -1,5 +1,5 @@ tests.testOutput{ - initialValue: nil, changeValue: valast.Ptr("val1"), + initialValue: valast.Ptr(""), changeValue: valast.Ptr("val1"), tfOut: ` Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols: @@ -9,8 +9,8 @@ Terraform will perform the following actions: # crossprovider_test_res.example must be replaced +/- resource "crossprovider_test_res" "example" { - ~ id = "id" -> (known after apply) - ~ string_prop = "computed" -> "val1" # forces replacement + ~ id = "id" -> (known after apply) + ~ prop = "computed" -> "val1" # forces replacement } Plan: 1 to add, 0 to change, 1 to destroy. @@ -22,10 +22,10 @@ Plan: 1 to add, 0 to change, 1 to destroy. +-crossprovider:index/testRes:TestRes: (replace) [id=id] [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] - ~ stringProp: "computed" => "val1" + ~ prop: "computed" => "val1" Resources: +-1 to replace 1 unchanged `, - detailedDiff: map[string]interface{}{"stringProp": map[string]interface{}{"kind": "UPDATE_REPLACE"}}, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE_REPLACE"}}, } diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalComputedForceNew/changed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalComputedForceNew/changed.golden index 552a8d8b9..81ed8eb9b 100644 --- a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalComputedForceNew/changed.golden +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalComputedForceNew/changed.golden @@ -9,8 +9,8 @@ Terraform will perform the following actions: # crossprovider_test_res.example must be replaced +/- resource "crossprovider_test_res" "example" { - ~ id = "id" -> (known after apply) - ~ string_prop = "val1" -> "val2" # forces replacement + ~ id = "id" -> (known after apply) + ~ prop = "val1" -> "val2" # forces replacement } Plan: 1 to add, 0 to change, 1 to destroy. @@ -22,10 +22,10 @@ Plan: 1 to add, 0 to change, 1 to destroy. +-crossprovider:index/testRes:TestRes: (replace) [id=id] [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] - ~ stringProp: "val1" => "val2" + ~ prop: "val1" => "val2" Resources: +-1 to replace 1 unchanged `, - detailedDiff: map[string]interface{}{"stringProp": map[string]interface{}{"kind": "UPDATE_REPLACE"}}, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE_REPLACE"}}, } diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalComputedForceNew/removed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalComputedForceNew/removed.golden index 70b2c0ae5..8a0ae1c46 100644 --- a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalComputedForceNew/removed.golden +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalComputedForceNew/removed.golden @@ -1,5 +1,5 @@ tests.testOutput{ - initialValue: valast.Ptr("val1"), changeValue: nil, + initialValue: valast.Ptr("val1"), changeValue: valast.Ptr(""), tfOut: ` No changes. Your infrastructure matches the configuration. diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalComputedForceNew/unchanged_empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalComputedForceNew/unchanged_empty.golden index 53d2a9794..a55e0790a 100644 --- a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalComputedForceNew/unchanged_empty.golden +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalComputedForceNew/unchanged_empty.golden @@ -1,5 +1,5 @@ tests.testOutput{ - initialValue: nil, changeValue: nil, + initialValue: valast.Ptr(""), changeValue: valast.Ptr(""), tfOut: ` No changes. Your infrastructure matches the configuration. diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalDefault/added.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalDefault/added.golden index a84c2c706..020e01e29 100644 --- a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalDefault/added.golden +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalDefault/added.golden @@ -1,5 +1,5 @@ tests.testOutput{ - initialValue: nil, changeValue: valast.Ptr("val1"), + initialValue: valast.Ptr(""), changeValue: valast.Ptr("val1"), tfOut: ` Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols: @@ -9,8 +9,8 @@ Terraform will perform the following actions: # crossprovider_test_res.example will be updated in-place ~ resource "crossprovider_test_res" "example" { - id = "newid" - ~ string_prop = "default" -> "val1" + id = "newid" + + prop = "val1" } Plan: 0 to add, 1 to change, 0 to destroy. @@ -22,10 +22,10 @@ Plan: 0 to add, 1 to change, 0 to destroy. ~ crossprovider:index/testRes:TestRes: (update) [id=newid] [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] - ~ stringProp: "default" => "val1" + + prop: "val1" Resources: ~ 1 to update 1 unchanged `, - detailedDiff: map[string]interface{}{"stringProp": map[string]interface{}{"kind": "UPDATE"}}, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE"}}, } diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalDefault/changed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalDefault/changed.golden index d32fc8650..3f412d2d5 100644 --- a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalDefault/changed.golden +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalDefault/changed.golden @@ -9,8 +9,8 @@ Terraform will perform the following actions: # crossprovider_test_res.example will be updated in-place ~ resource "crossprovider_test_res" "example" { - id = "newid" - ~ string_prop = "val1" -> "val2" + id = "newid" + ~ prop = "val1" -> "val2" } Plan: 0 to add, 1 to change, 0 to destroy. @@ -22,10 +22,10 @@ Plan: 0 to add, 1 to change, 0 to destroy. ~ crossprovider:index/testRes:TestRes: (update) [id=newid] [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] - ~ stringProp: "val1" => "val2" + ~ prop: "val1" => "val2" Resources: ~ 1 to update 1 unchanged `, - detailedDiff: map[string]interface{}{"stringProp": map[string]interface{}{"kind": "UPDATE"}}, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE"}}, } diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalDefault/removed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalDefault/removed.golden index 86cdb286d..6d6cd3873 100644 --- a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalDefault/removed.golden +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalDefault/removed.golden @@ -1,5 +1,5 @@ tests.testOutput{ - initialValue: valast.Ptr("val1"), changeValue: nil, + initialValue: valast.Ptr("val1"), changeValue: valast.Ptr(""), tfOut: ` Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols: @@ -9,8 +9,8 @@ Terraform will perform the following actions: # crossprovider_test_res.example will be updated in-place ~ resource "crossprovider_test_res" "example" { - id = "newid" - ~ string_prop = "val1" -> "default" + id = "newid" + - prop = "val1" -> null } Plan: 0 to add, 1 to change, 0 to destroy. @@ -22,10 +22,10 @@ Plan: 0 to add, 1 to change, 0 to destroy. ~ crossprovider:index/testRes:TestRes: (update) [id=newid] [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] - ~ stringProp: "val1" => "default" + - prop: "val1" Resources: ~ 1 to update 1 unchanged `, - detailedDiff: map[string]interface{}{"stringProp": map[string]interface{}{"kind": "UPDATE"}}, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE"}}, } diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalDefault/unchanged_empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalDefault/unchanged_empty.golden index 53d2a9794..a55e0790a 100644 --- a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalDefault/unchanged_empty.golden +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalDefault/unchanged_empty.golden @@ -1,5 +1,5 @@ tests.testOutput{ - initialValue: nil, changeValue: nil, + initialValue: valast.Ptr(""), changeValue: valast.Ptr(""), tfOut: ` No changes. Your infrastructure matches the configuration. diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalDefaultForceNew/added.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalDefaultForceNew/added.golden index 30db3713f..009b6d471 100644 --- a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalDefaultForceNew/added.golden +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalDefaultForceNew/added.golden @@ -1,5 +1,5 @@ tests.testOutput{ - initialValue: nil, changeValue: valast.Ptr("val1"), + initialValue: valast.Ptr(""), changeValue: valast.Ptr("val1"), tfOut: ` Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols: @@ -9,8 +9,8 @@ Terraform will perform the following actions: # crossprovider_test_res.example must be replaced +/- resource "crossprovider_test_res" "example" { - ~ id = "newid" -> (known after apply) - ~ string_prop = "default" -> "val1" # forces replacement + ~ id = "newid" -> (known after apply) + + prop = "val1" # forces replacement } Plan: 1 to add, 0 to change, 1 to destroy. @@ -22,10 +22,10 @@ Plan: 1 to add, 0 to change, 1 to destroy. +-crossprovider:index/testRes:TestRes: (replace) [id=newid] [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] - ~ stringProp: "default" => "val1" + + prop: "val1" Resources: +-1 to replace 1 unchanged `, - detailedDiff: map[string]interface{}{"stringProp": map[string]interface{}{"kind": "UPDATE_REPLACE"}}, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE_REPLACE"}}, } diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalDefaultForceNew/changed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalDefaultForceNew/changed.golden index fadba5320..58402aee8 100644 --- a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalDefaultForceNew/changed.golden +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalDefaultForceNew/changed.golden @@ -9,8 +9,8 @@ Terraform will perform the following actions: # crossprovider_test_res.example must be replaced +/- resource "crossprovider_test_res" "example" { - ~ id = "newid" -> (known after apply) - ~ string_prop = "val1" -> "val2" # forces replacement + ~ id = "newid" -> (known after apply) + ~ prop = "val1" -> "val2" # forces replacement } Plan: 1 to add, 0 to change, 1 to destroy. @@ -22,10 +22,10 @@ Plan: 1 to add, 0 to change, 1 to destroy. +-crossprovider:index/testRes:TestRes: (replace) [id=newid] [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] - ~ stringProp: "val1" => "val2" + ~ prop: "val1" => "val2" Resources: +-1 to replace 1 unchanged `, - detailedDiff: map[string]interface{}{"stringProp": map[string]interface{}{"kind": "UPDATE_REPLACE"}}, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE_REPLACE"}}, } diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalDefaultForceNew/removed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalDefaultForceNew/removed.golden index 52d848fa6..deef631dd 100644 --- a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalDefaultForceNew/removed.golden +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalDefaultForceNew/removed.golden @@ -1,5 +1,5 @@ tests.testOutput{ - initialValue: valast.Ptr("val1"), changeValue: nil, + initialValue: valast.Ptr("val1"), changeValue: valast.Ptr(""), tfOut: ` Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols: @@ -9,8 +9,8 @@ Terraform will perform the following actions: # crossprovider_test_res.example must be replaced +/- resource "crossprovider_test_res" "example" { - ~ id = "newid" -> (known after apply) - ~ string_prop = "val1" -> "default" # forces replacement + ~ id = "newid" -> (known after apply) + - prop = "val1" -> null # forces replacement } Plan: 1 to add, 0 to change, 1 to destroy. @@ -22,10 +22,10 @@ Plan: 1 to add, 0 to change, 1 to destroy. +-crossprovider:index/testRes:TestRes: (replace) [id=newid] [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] - ~ stringProp: "val1" => "default" + - prop: "val1" Resources: +-1 to replace 1 unchanged `, - detailedDiff: map[string]interface{}{"stringProp": map[string]interface{}{"kind": "UPDATE_REPLACE"}}, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE_REPLACE"}}, } diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalDefaultForceNew/unchanged_empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalDefaultForceNew/unchanged_empty.golden index 53d2a9794..a55e0790a 100644 --- a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalDefaultForceNew/unchanged_empty.golden +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalDefaultForceNew/unchanged_empty.golden @@ -1,5 +1,5 @@ tests.testOutput{ - initialValue: nil, changeValue: nil, + initialValue: valast.Ptr(""), changeValue: valast.Ptr(""), tfOut: ` No changes. Your infrastructure matches the configuration. diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalForceNew/added.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalForceNew/added.golden index 49c6d9d18..009b6d471 100644 --- a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalForceNew/added.golden +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalForceNew/added.golden @@ -1,5 +1,5 @@ tests.testOutput{ - initialValue: nil, changeValue: valast.Ptr("val1"), + initialValue: valast.Ptr(""), changeValue: valast.Ptr("val1"), tfOut: ` Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols: @@ -9,8 +9,8 @@ Terraform will perform the following actions: # crossprovider_test_res.example must be replaced +/- resource "crossprovider_test_res" "example" { - ~ id = "newid" -> (known after apply) - + string_prop = "val1" # forces replacement + ~ id = "newid" -> (known after apply) + + prop = "val1" # forces replacement } Plan: 1 to add, 0 to change, 1 to destroy. @@ -22,10 +22,10 @@ Plan: 1 to add, 0 to change, 1 to destroy. +-crossprovider:index/testRes:TestRes: (replace) [id=newid] [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] - + stringProp: "val1" + + prop: "val1" Resources: +-1 to replace 1 unchanged `, - detailedDiff: map[string]interface{}{"stringProp": map[string]interface{}{"kind": "ADD_REPLACE"}}, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE_REPLACE"}}, } diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalForceNew/changed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalForceNew/changed.golden index fadba5320..58402aee8 100644 --- a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalForceNew/changed.golden +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalForceNew/changed.golden @@ -9,8 +9,8 @@ Terraform will perform the following actions: # crossprovider_test_res.example must be replaced +/- resource "crossprovider_test_res" "example" { - ~ id = "newid" -> (known after apply) - ~ string_prop = "val1" -> "val2" # forces replacement + ~ id = "newid" -> (known after apply) + ~ prop = "val1" -> "val2" # forces replacement } Plan: 1 to add, 0 to change, 1 to destroy. @@ -22,10 +22,10 @@ Plan: 1 to add, 0 to change, 1 to destroy. +-crossprovider:index/testRes:TestRes: (replace) [id=newid] [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] - ~ stringProp: "val1" => "val2" + ~ prop: "val1" => "val2" Resources: +-1 to replace 1 unchanged `, - detailedDiff: map[string]interface{}{"stringProp": map[string]interface{}{"kind": "UPDATE_REPLACE"}}, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE_REPLACE"}}, } diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalForceNew/removed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalForceNew/removed.golden index fe77717fd..deef631dd 100644 --- a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalForceNew/removed.golden +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalForceNew/removed.golden @@ -1,5 +1,5 @@ tests.testOutput{ - initialValue: valast.Ptr("val1"), changeValue: nil, + initialValue: valast.Ptr("val1"), changeValue: valast.Ptr(""), tfOut: ` Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols: @@ -9,8 +9,8 @@ Terraform will perform the following actions: # crossprovider_test_res.example must be replaced +/- resource "crossprovider_test_res" "example" { - ~ id = "newid" -> (known after apply) - - string_prop = "val1" -> null # forces replacement + ~ id = "newid" -> (known after apply) + - prop = "val1" -> null # forces replacement } Plan: 1 to add, 0 to change, 1 to destroy. @@ -22,10 +22,10 @@ Plan: 1 to add, 0 to change, 1 to destroy. +-crossprovider:index/testRes:TestRes: (replace) [id=newid] [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] - - stringProp: "val1" + - prop: "val1" Resources: +-1 to replace 1 unchanged `, - detailedDiff: map[string]interface{}{"stringProp": map[string]interface{}{"kind": "DELETE_REPLACE"}}, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE_REPLACE"}}, } diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalForceNew/unchanged_empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalForceNew/unchanged_empty.golden index 53d2a9794..a55e0790a 100644 --- a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalForceNew/unchanged_empty.golden +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/optionalForceNew/unchanged_empty.golden @@ -1,5 +1,5 @@ tests.testOutput{ - initialValue: nil, changeValue: nil, + initialValue: valast.Ptr(""), changeValue: valast.Ptr(""), tfOut: ` No changes. Your infrastructure matches the configuration. diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/required/added.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/required/added.golden new file mode 100644 index 000000000..020e01e29 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/required/added.golden @@ -0,0 +1,31 @@ +tests.testOutput{ + initialValue: valast.Ptr(""), changeValue: valast.Ptr("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" + + prop = "val1" + } + +Plan: 0 to add, 1 to change, 0 to destroy. + +`, + 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: "val1" +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/required/changed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/required/changed.golden index d32fc8650..3f412d2d5 100644 --- a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/required/changed.golden +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/required/changed.golden @@ -9,8 +9,8 @@ Terraform will perform the following actions: # crossprovider_test_res.example will be updated in-place ~ resource "crossprovider_test_res" "example" { - id = "newid" - ~ string_prop = "val1" -> "val2" + id = "newid" + ~ prop = "val1" -> "val2" } Plan: 0 to add, 1 to change, 0 to destroy. @@ -22,10 +22,10 @@ Plan: 0 to add, 1 to change, 0 to destroy. ~ crossprovider:index/testRes:TestRes: (update) [id=newid] [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] - ~ stringProp: "val1" => "val2" + ~ prop: "val1" => "val2" Resources: ~ 1 to update 1 unchanged `, - detailedDiff: map[string]interface{}{"stringProp": map[string]interface{}{"kind": "UPDATE"}}, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE"}}, } diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/required/removed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/required/removed.golden new file mode 100644 index 000000000..6d6cd3873 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/required/removed.golden @@ -0,0 +1,31 @@ +tests.testOutput{ + initialValue: valast.Ptr("val1"), changeValue: valast.Ptr(""), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: + ~ 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 = "val1" -> 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: "val1" +Resources: + ~ 1 to update + 1 unchanged +`, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE"}}, +} diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/required/unchanged_empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/required/unchanged_empty.golden new file mode 100644 index 000000000..a55e0790a --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/required/unchanged_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: valast.Ptr(""), changeValue: valast.Ptr(""), + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing 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/TestSDKv2DetailedDiffString/requiredForceNew/added.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/requiredForceNew/added.golden new file mode 100644 index 000000000..009b6d471 --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/requiredForceNew/added.golden @@ -0,0 +1,31 @@ +tests.testOutput{ + initialValue: valast.Ptr(""), changeValue: valast.Ptr("val1"), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- create replacement and then destroy + +Terraform will perform the following actions: + + # crossprovider_test_res.example must be replaced ++/- resource "crossprovider_test_res" "example" { + ~ id = "newid" -> (known after apply) + + prop = "val1" # forces replacement + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + + prop: "val1" +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/TestSDKv2DetailedDiffString/requiredForceNew/changed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/requiredForceNew/changed.golden index fadba5320..58402aee8 100644 --- a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/requiredForceNew/changed.golden +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/requiredForceNew/changed.golden @@ -9,8 +9,8 @@ Terraform will perform the following actions: # crossprovider_test_res.example must be replaced +/- resource "crossprovider_test_res" "example" { - ~ id = "newid" -> (known after apply) - ~ string_prop = "val1" -> "val2" # forces replacement + ~ id = "newid" -> (known after apply) + ~ prop = "val1" -> "val2" # forces replacement } Plan: 1 to add, 0 to change, 1 to destroy. @@ -22,10 +22,10 @@ Plan: 1 to add, 0 to change, 1 to destroy. +-crossprovider:index/testRes:TestRes: (replace) [id=newid] [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] - ~ stringProp: "val1" => "val2" + ~ prop: "val1" => "val2" Resources: +-1 to replace 1 unchanged `, - detailedDiff: map[string]interface{}{"stringProp": map[string]interface{}{"kind": "UPDATE_REPLACE"}}, + detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE_REPLACE"}}, } diff --git a/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/requiredForceNew/removed.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/requiredForceNew/removed.golden new file mode 100644 index 000000000..deef631dd --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/requiredForceNew/removed.golden @@ -0,0 +1,31 @@ +tests.testOutput{ + initialValue: valast.Ptr("val1"), changeValue: valast.Ptr(""), + tfOut: ` +Terraform used the selected providers to generate the following execution +plan. Resource actions are indicated with the following symbols: ++/- 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 = "val1" -> null # forces replacement + } + +Plan: 1 to add, 0 to change, 1 to destroy. + +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] + +-crossprovider:index/testRes:TestRes: (replace) + [id=newid] + [urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] + - prop: "val1" +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/TestSDKv2DetailedDiffString/requiredForceNew/unchanged_empty.golden b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/requiredForceNew/unchanged_empty.golden new file mode 100644 index 000000000..a55e0790a --- /dev/null +++ b/pkg/tests/diff_test/testdata/TestSDKv2DetailedDiffString/requiredForceNew/unchanged_empty.golden @@ -0,0 +1,15 @@ +tests.testOutput{ + initialValue: valast.Ptr(""), changeValue: valast.Ptr(""), + tfOut: ` +No changes. Your infrastructure matches the configuration. + +Terraform has compared your real infrastructure against your configuration +and found no differences, so no changes are needed. +`, + pulumiOut: `Previewing update (test): + pulumi:pulumi:Stack: (same) + [urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] +Resources: + 2 unchanged +`, +}