Skip to content

Commit

Permalink
Re-record forceNew collection interactions with unknowns under detail…
Browse files Browse the repository at this point in the history
…ed diff v2 (#2516)

This re-records the tests in
#2515 under
detailed diff v2 to show the changes.

The new behaviour is more correct: When the parent of a known property
with ForceNew is changed to unknown we now mark the resource for
replacement. Both are guesses to the actual effect of the changes but
this one seems more likely.

stacked on https://github.com/pulumi/pulumi-terraform-bridge/pull/2515\

related to
#2496 (comment)
  • Loading branch information
VenelinMartinov authored Oct 28, 2024
1 parent 5b96472 commit 7dd77ef
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions pkg/tests/schema_pulumi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4163,7 +4163,8 @@ func TestMakeTerraformResultNilVsEmptyMap(t *testing.T) {

func TestUnknownCollectionForceNewDetailedDiff(t *testing.T) {
// TODO: Remove this once accurate bridge previews are rolled out
t.Setenv("PULUMI_TF_BRIDGE_ACCURATE_BRIDGE_PREVIEW", "false")
t.Setenv("PULUMI_TF_BRIDGE_ACCURATE_BRIDGE_PREVIEW", "true")

collectionForceNewResource := func(typ schema.ValueType) *schema.Resource {
return &schema.Resource{
Schema: map[string]*schema.Schema{
Expand Down Expand Up @@ -4383,7 +4384,7 @@ Resources:
[urn=urn:pulumi:test::test::pulumi:pulumi:Stack::test-test]
+ prov:index/aux:Aux: (create)
[urn=urn:pulumi:test::test::prov:index/aux:Aux::auxRes]
~ prov:index/test:Test: (update)
+-prov:index/test:Test: (replace)
[id=newid]
[urn=urn:pulumi:test::test::prov:index/test:Test::mainRes]
~ tests: [
Expand All @@ -4394,7 +4395,7 @@ Resources:
]
Resources:
+ 1 to create
~ 1 to update
+-1 to replace
2 changes. 1 unchanged
`))
})
Expand All @@ -4406,7 +4407,7 @@ Resources:
[urn=urn:pulumi:test::test::pulumi:pulumi:Stack::test-test]
+ prov:index/aux:Aux: (create)
[urn=urn:pulumi:test::test::prov:index/aux:Aux::auxRes]
~ prov:index/test:Test: (update)
+-prov:index/test:Test: (replace)
[id=newid]
[urn=urn:pulumi:test::test::prov:index/test:Test::mainRes]
- tests: [
Expand All @@ -4417,7 +4418,7 @@ Resources:
+ tests: output<string>
Resources:
+ 1 to create
~ 1 to update
+-1 to replace
2 changes. 1 unchanged
`))
})
Expand Down Expand Up @@ -4545,7 +4546,7 @@ Resources:
[urn=urn:pulumi:test::test::pulumi:pulumi:Stack::test-test]
+ prov:index/aux:Aux: (create)
[urn=urn:pulumi:test::test::prov:index/aux:Aux::auxRes]
~ prov:index/test:Test: (update)
+-prov:index/test:Test: (replace)
[id=newid]
[urn=urn:pulumi:test::test::prov:index/test:Test::mainRes]
~ tests: [
Expand All @@ -4556,7 +4557,7 @@ Resources:
]
Resources:
+ 1 to create
~ 1 to update
+-1 to replace
2 changes. 1 unchanged
`))
})
Expand All @@ -4568,7 +4569,7 @@ Resources:
[urn=urn:pulumi:test::test::pulumi:pulumi:Stack::test-test]
+ prov:index/aux:Aux: (create)
[urn=urn:pulumi:test::test::prov:index/aux:Aux::auxRes]
~ prov:index/test:Test: (update)
+-prov:index/test:Test: (replace)
[id=newid]
[urn=urn:pulumi:test::test::prov:index/test:Test::mainRes]
- tests: [
Expand All @@ -4579,7 +4580,7 @@ Resources:
+ tests: output<string>
Resources:
+ 1 to create
~ 1 to update
+-1 to replace
2 changes. 1 unchanged
`))
})
Expand Down

0 comments on commit 7dd77ef

Please sign in to comment.