-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SDKv2 Diff tests for MaxItemsOne sets (#2839)
This PR adds Diff tests for MaxItemsOne sets for the SDKv2 bridge. fixes #2789
- Loading branch information
1 parent
9357cbf
commit 3c7db4e
Showing
51 changed files
with
1,442 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
...ff_test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute/added.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
tests.testOutput{ | ||
initialValue: &[]string{}, | ||
changeValue: &[]string{"value"}, | ||
tfOut: ` | ||
Terraform used the selected providers to generate the following execution | ||
plan. Resource actions are indicated with the following symbols: | ||
~ update in-place | ||
|
||
Terraform will perform the following actions: | ||
|
||
# crossprovider_test_res.example will be updated in-place | ||
~ resource "crossprovider_test_res" "example" { | ||
id = "newid" | ||
+ prop = [ | ||
+ "value", | ||
] | ||
} | ||
|
||
Plan: 0 to add, 1 to change, 0 to destroy. | ||
|
||
`, | ||
pulumiOut: `Previewing update (test): | ||
pulumi:pulumi:Stack: (same) | ||
[urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] | ||
~ crossprovider:index/testRes:TestRes: (update) | ||
[id=newid] | ||
[urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] | ||
+ prop: "value" | ||
Resources: | ||
~ 1 to update | ||
1 unchanged | ||
`, | ||
detailedDiff: map[string]interface{}{"prop": map[string]interface{}{}}, | ||
} |
16 changes: 16 additions & 0 deletions
16
.../TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute/changed_empty_to_null.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
tests.testOutput{ | ||
initialValue: &[]string{}, | ||
changeValue: nil, | ||
tfOut: ` | ||
No changes. Your infrastructure matches the configuration. | ||
|
||
Terraform has compared your real infrastructure against your configuration | ||
and found no differences, so no changes are needed. | ||
`, | ||
pulumiOut: `Previewing update (test): | ||
pulumi:pulumi:Stack: (same) | ||
[urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] | ||
Resources: | ||
2 unchanged | ||
`, | ||
} |
37 changes: 37 additions & 0 deletions
37
...tdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute/changed_non-null.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
tests.testOutput{ | ||
initialValue: &[]string{ | ||
"value", | ||
}, | ||
changeValue: &[]string{"value1"}, | ||
tfOut: ` | ||
Terraform used the selected providers to generate the following execution | ||
plan. Resource actions are indicated with the following symbols: | ||
~ update in-place | ||
|
||
Terraform will perform the following actions: | ||
|
||
# crossprovider_test_res.example will be updated in-place | ||
~ resource "crossprovider_test_res" "example" { | ||
id = "newid" | ||
~ prop = [ | ||
- "value", | ||
+ "value1", | ||
] | ||
} | ||
|
||
Plan: 0 to add, 1 to change, 0 to destroy. | ||
|
||
`, | ||
pulumiOut: `Previewing update (test): | ||
pulumi:pulumi:Stack: (same) | ||
[urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] | ||
~ crossprovider:index/testRes:TestRes: (update) | ||
[id=newid] | ||
[urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] | ||
~ prop: "value" => "value1" | ||
Resources: | ||
~ 1 to update | ||
1 unchanged | ||
`, | ||
detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "UPDATE"}}, | ||
} |
36 changes: 36 additions & 0 deletions
36
...stSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute/changed_non-null_to_null.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
tests.testOutput{ | ||
initialValue: &[]string{ | ||
"value", | ||
}, | ||
changeValue: nil, | ||
tfOut: ` | ||
Terraform used the selected providers to generate the following execution | ||
plan. Resource actions are indicated with the following symbols: | ||
~ update in-place | ||
|
||
Terraform will perform the following actions: | ||
|
||
# crossprovider_test_res.example will be updated in-place | ||
~ resource "crossprovider_test_res" "example" { | ||
id = "newid" | ||
~ prop = [ | ||
- "value", | ||
] | ||
} | ||
|
||
Plan: 0 to add, 1 to change, 0 to destroy. | ||
|
||
`, | ||
pulumiOut: `Previewing update (test): | ||
pulumi:pulumi:Stack: (same) | ||
[urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] | ||
~ crossprovider:index/testRes:TestRes: (update) | ||
[id=newid] | ||
[urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] | ||
- prop: "value" | ||
Resources: | ||
~ 1 to update | ||
1 unchanged | ||
`, | ||
detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "DELETE"}}, | ||
} |
15 changes: 15 additions & 0 deletions
15
.../TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute/changed_null_to_empty.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
tests.testOutput{ | ||
initialValue: nil, changeValue: &[]string{}, | ||
tfOut: ` | ||
No changes. Your infrastructure matches the configuration. | ||
|
||
Terraform has compared your real infrastructure against your configuration | ||
and found no differences, so no changes are needed. | ||
`, | ||
pulumiOut: `Previewing update (test): | ||
pulumi:pulumi:Stack: (same) | ||
[urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] | ||
Resources: | ||
2 unchanged | ||
`, | ||
} |
35 changes: 35 additions & 0 deletions
35
...stSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute/changed_null_to_non-null.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
tests.testOutput{ | ||
initialValue: nil, changeValue: &[]string{ | ||
"value", | ||
}, | ||
tfOut: ` | ||
Terraform used the selected providers to generate the following execution | ||
plan. Resource actions are indicated with the following symbols: | ||
~ update in-place | ||
|
||
Terraform will perform the following actions: | ||
|
||
# crossprovider_test_res.example will be updated in-place | ||
~ resource "crossprovider_test_res" "example" { | ||
id = "newid" | ||
+ prop = [ | ||
+ "value", | ||
] | ||
} | ||
|
||
Plan: 0 to add, 1 to change, 0 to destroy. | ||
|
||
`, | ||
pulumiOut: `Previewing update (test): | ||
pulumi:pulumi:Stack: (same) | ||
[urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] | ||
~ crossprovider:index/testRes:TestRes: (update) | ||
[id=newid] | ||
[urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] | ||
+ prop: "value" | ||
Resources: | ||
~ 1 to update | ||
1 unchanged | ||
`, | ||
detailedDiff: map[string]interface{}{"prop": map[string]interface{}{}}, | ||
} |
36 changes: 36 additions & 0 deletions
36
..._test/testdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute/removed.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
tests.testOutput{ | ||
initialValue: &[]string{ | ||
"value", | ||
}, | ||
changeValue: &[]string{}, | ||
tfOut: ` | ||
Terraform used the selected providers to generate the following execution | ||
plan. Resource actions are indicated with the following symbols: | ||
~ update in-place | ||
|
||
Terraform will perform the following actions: | ||
|
||
# crossprovider_test_res.example will be updated in-place | ||
~ resource "crossprovider_test_res" "example" { | ||
id = "newid" | ||
~ prop = [ | ||
- "value", | ||
] | ||
} | ||
|
||
Plan: 0 to add, 1 to change, 0 to destroy. | ||
|
||
`, | ||
pulumiOut: `Previewing update (test): | ||
pulumi:pulumi:Stack: (same) | ||
[urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] | ||
~ crossprovider:index/testRes:TestRes: (update) | ||
[id=newid] | ||
[urn=urn:pulumi:test::project::crossprovider:index/testRes:TestRes::example] | ||
- prop: "value" | ||
Resources: | ||
~ 1 to update | ||
1 unchanged | ||
`, | ||
detailedDiff: map[string]interface{}{"prop": map[string]interface{}{"kind": "DELETE"}}, | ||
} |
16 changes: 16 additions & 0 deletions
16
...stdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute/unchanged_empty.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
tests.testOutput{ | ||
initialValue: &[]string{}, | ||
changeValue: &[]string{}, | ||
tfOut: ` | ||
No changes. Your infrastructure matches the configuration. | ||
|
||
Terraform has compared your real infrastructure against your configuration | ||
and found no differences, so no changes are needed. | ||
`, | ||
pulumiOut: `Previewing update (test): | ||
pulumi:pulumi:Stack: (same) | ||
[urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] | ||
Resources: | ||
2 unchanged | ||
`, | ||
} |
18 changes: 18 additions & 0 deletions
18
...ta/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute/unchanged_non-empty.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
tests.testOutput{ | ||
initialValue: &[]string{ | ||
"value", | ||
}, | ||
changeValue: &[]string{"value"}, | ||
tfOut: ` | ||
No changes. Your infrastructure matches the configuration. | ||
|
||
Terraform has compared your real infrastructure against your configuration | ||
and found no differences, so no changes are needed. | ||
`, | ||
pulumiOut: `Previewing update (test): | ||
pulumi:pulumi:Stack: (same) | ||
[urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] | ||
Resources: | ||
2 unchanged | ||
`, | ||
} |
15 changes: 15 additions & 0 deletions
15
...estdata/TestSDKv2DetailedDiffSetMaxItemsOne/max_items_one_attribute/unchanged_null.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
tests.testOutput{ | ||
initialValue: nil, changeValue: nil, | ||
tfOut: ` | ||
No changes. Your infrastructure matches the configuration. | ||
|
||
Terraform has compared your real infrastructure against your configuration | ||
and found no differences, so no changes are needed. | ||
`, | ||
pulumiOut: `Previewing update (test): | ||
pulumi:pulumi:Stack: (same) | ||
[urn=urn:pulumi:test::project::pulumi:pulumi:Stack::project-test] | ||
Resources: | ||
2 unchanged | ||
`, | ||
} |
Oops, something went wrong.