mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-28 01:41:48 -06:00
Merge pull request #22837 from hashicorp/jbardin/test-timeouts
don't lose track of private data in the ACC tests
This commit is contained in:
commit
0dd4b3bfcb
@ -646,12 +646,7 @@ resource "test_resource_nested_set" "foo" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
`),
|
`),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(),
|
||||||
func(s *terraform.State) error {
|
|
||||||
fmt.Println(s)
|
|
||||||
return nil
|
|
||||||
},
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
@ -14,6 +14,11 @@ func testResourceTimeout() *schema.Resource {
|
|||||||
Update: testResourceTimeoutUpdate,
|
Update: testResourceTimeoutUpdate,
|
||||||
Delete: testResourceTimeoutDelete,
|
Delete: testResourceTimeoutDelete,
|
||||||
|
|
||||||
|
// Due to the schema version also being stashed in the private/meta
|
||||||
|
// data, we need to ensure that it does not overwrite the map
|
||||||
|
// containing the timeouts.
|
||||||
|
SchemaVersion: 1,
|
||||||
|
|
||||||
Timeouts: &schema.ResourceTimeout{
|
Timeouts: &schema.ResourceTimeout{
|
||||||
Create: schema.DefaultTimeout(time.Second),
|
Create: schema.DefaultTimeout(time.Second),
|
||||||
Update: schema.DefaultTimeout(time.Second),
|
Update: schema.DefaultTimeout(time.Second),
|
||||||
|
@ -81,9 +81,10 @@ func shimNewState(newState *states.State, providers map[string]terraform.Resourc
|
|||||||
}
|
}
|
||||||
|
|
||||||
if i.Current.SchemaVersion != 0 {
|
if i.Current.SchemaVersion != 0 {
|
||||||
resState.Primary.Meta = map[string]interface{}{
|
if resState.Primary.Meta == nil {
|
||||||
"schema_version": i.Current.SchemaVersion,
|
resState.Primary.Meta = map[string]interface{}{}
|
||||||
}
|
}
|
||||||
|
resState.Primary.Meta["schema_version"] = i.Current.SchemaVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, dep := range i.Current.Dependencies {
|
for _, dep := range i.Current.Dependencies {
|
||||||
|
Loading…
Reference in New Issue
Block a user