mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-29 10:21:01 -06:00
core: add missing ResourceState types in context tests
Previously the Type of a ResourceState was generally ignored, but we're now starting to use it to figure out which providers are needed to support the resources in state so our tests need to set it accurately in order to get the expected result.
This commit is contained in:
parent
25a6d8f471
commit
8bfc6e7b1c
@ -7919,6 +7919,7 @@ func TestContext2Apply_targetedWithTaintedInState(t *testing.T) {
|
||||
Path: rootModulePath,
|
||||
Resources: map[string]*ResourceState{
|
||||
"aws_instance.ifailedprovisioners": &ResourceState{
|
||||
Type: "aws_instance",
|
||||
Primary: &InstanceState{
|
||||
ID: "ifailedprovisioners",
|
||||
Tainted: true,
|
||||
@ -8046,6 +8047,7 @@ func TestContext2Apply_ignoreChangesWithDep(t *testing.T) {
|
||||
Path: rootModulePath,
|
||||
Resources: map[string]*ResourceState{
|
||||
"aws_instance.foo.0": &ResourceState{
|
||||
Type: "aws_instance",
|
||||
Primary: &InstanceState{
|
||||
ID: "i-abc123",
|
||||
Attributes: map[string]string{
|
||||
@ -8055,6 +8057,7 @@ func TestContext2Apply_ignoreChangesWithDep(t *testing.T) {
|
||||
},
|
||||
},
|
||||
"aws_instance.foo.1": &ResourceState{
|
||||
Type: "aws_instance",
|
||||
Primary: &InstanceState{
|
||||
ID: "i-bcd234",
|
||||
Attributes: map[string]string{
|
||||
@ -8064,6 +8067,7 @@ func TestContext2Apply_ignoreChangesWithDep(t *testing.T) {
|
||||
},
|
||||
},
|
||||
"aws_eip.foo.0": &ResourceState{
|
||||
Type: "aws_instance",
|
||||
Primary: &InstanceState{
|
||||
ID: "eip-abc123",
|
||||
Attributes: map[string]string{
|
||||
@ -8073,6 +8077,7 @@ func TestContext2Apply_ignoreChangesWithDep(t *testing.T) {
|
||||
},
|
||||
},
|
||||
"aws_eip.foo.1": &ResourceState{
|
||||
Type: "aws_instance",
|
||||
Primary: &InstanceState{
|
||||
ID: "eip-bcd234",
|
||||
Attributes: map[string]string{
|
||||
|
@ -2950,6 +2950,7 @@ func TestContext2Plan_ignoreChanges(t *testing.T) {
|
||||
Path: rootModulePath,
|
||||
Resources: map[string]*ResourceState{
|
||||
"aws_instance.foo": &ResourceState{
|
||||
Type: "aws_instance",
|
||||
Primary: &InstanceState{
|
||||
ID: "bar",
|
||||
Attributes: map[string]string{"ami": "ami-abcd1234"},
|
||||
|
@ -605,7 +605,7 @@ func TestContext2Refresh_dataOrphan(t *testing.T) {
|
||||
Path: rootModulePath,
|
||||
Resources: map[string]*ResourceState{
|
||||
"data.null_data_source.bar": &ResourceState{
|
||||
Type: "foo",
|
||||
Type: "null_data_source",
|
||||
Primary: &InstanceState{
|
||||
ID: "foo",
|
||||
},
|
||||
@ -894,6 +894,7 @@ func TestContext2Refresh_orphanModule(t *testing.T) {
|
||||
Path: rootModulePath,
|
||||
Resources: map[string]*ResourceState{
|
||||
"aws_instance.foo": &ResourceState{
|
||||
Type: "aws_instance",
|
||||
Primary: &InstanceState{
|
||||
ID: "i-abc123",
|
||||
Attributes: map[string]string{
|
||||
@ -912,6 +913,7 @@ func TestContext2Refresh_orphanModule(t *testing.T) {
|
||||
Path: append(rootModulePath, "child"),
|
||||
Resources: map[string]*ResourceState{
|
||||
"aws_instance.bar": &ResourceState{
|
||||
Type: "aws_instance",
|
||||
Primary: &InstanceState{
|
||||
ID: "i-bcd234",
|
||||
Attributes: map[string]string{
|
||||
@ -938,6 +940,7 @@ func TestContext2Refresh_orphanModule(t *testing.T) {
|
||||
Path: append(rootModulePath, "child", "grandchild"),
|
||||
Resources: map[string]*ResourceState{
|
||||
"aws_instance.baz": &ResourceState{
|
||||
Type: "aws_instance",
|
||||
Primary: &InstanceState{
|
||||
ID: "i-cde345",
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user