remove depends_on from helper test shims

This commit is contained in:
James Bardin 2020-05-14 15:57:16 -04:00
parent 756e889697
commit a286ef6d9c
2 changed files with 0 additions and 40 deletions

View File

@ -87,10 +87,6 @@ func shimNewState(newState *states.State, providers map[string]terraform.Resourc
resState.Primary.Meta["schema_version"] = i.Current.SchemaVersion resState.Primary.Meta["schema_version"] = i.Current.SchemaVersion
} }
for _, dep := range i.Current.DependsOn {
resState.Dependencies = append(resState.Dependencies, dep.String())
}
// convert the indexes to the old style flapmap indexes // convert the indexes to the old style flapmap indexes
idx := "" idx := ""
switch key.(type) { switch key.(type) {

View File

@ -31,15 +31,6 @@ func TestStateShim(t *testing.T) {
Status: states.ObjectReady, Status: states.ObjectReady,
AttrsFlat: map[string]string{"id": "foo", "bazzle": "dazzle"}, AttrsFlat: map[string]string{"id": "foo", "bazzle": "dazzle"},
SchemaVersion: 7, SchemaVersion: 7,
DependsOn: []addrs.Referenceable{
addrs.ResourceInstance{
Resource: addrs.Resource{
Mode: 'M',
Type: "test_thing",
Name: "baz",
},
},
},
}, },
addrs.AbsProviderConfig{ addrs.AbsProviderConfig{
Provider: addrs.NewDefaultProvider("test"), Provider: addrs.NewDefaultProvider("test"),
@ -55,7 +46,6 @@ func TestStateShim(t *testing.T) {
&states.ResourceInstanceObjectSrc{ &states.ResourceInstanceObjectSrc{
Status: states.ObjectReady, Status: states.ObjectReady,
AttrsFlat: map[string]string{"id": "baz", "bazzle": "dazzle"}, AttrsFlat: map[string]string{"id": "baz", "bazzle": "dazzle"},
DependsOn: []addrs.Referenceable{},
}, },
addrs.AbsProviderConfig{ addrs.AbsProviderConfig{
Provider: addrs.NewDefaultProvider("test"), Provider: addrs.NewDefaultProvider("test"),
@ -74,7 +64,6 @@ func TestStateShim(t *testing.T) {
&states.ResourceInstanceObjectSrc{ &states.ResourceInstanceObjectSrc{
Status: states.ObjectReady, Status: states.ObjectReady,
AttrsJSON: []byte(`{"id": "bar", "fuzzle":"wuzzle"}`), AttrsJSON: []byte(`{"id": "bar", "fuzzle":"wuzzle"}`),
DependsOn: []addrs.Referenceable{},
}, },
addrs.AbsProviderConfig{ addrs.AbsProviderConfig{
Provider: addrs.NewDefaultProvider("test"), Provider: addrs.NewDefaultProvider("test"),
@ -90,15 +79,6 @@ func TestStateShim(t *testing.T) {
&states.ResourceInstanceObjectSrc{ &states.ResourceInstanceObjectSrc{
Status: states.ObjectReady, Status: states.ObjectReady,
AttrsJSON: []byte(`{"id": "bar", "fizzle":"wizzle"}`), AttrsJSON: []byte(`{"id": "bar", "fizzle":"wizzle"}`),
DependsOn: []addrs.Referenceable{
addrs.ResourceInstance{
Resource: addrs.Resource{
Mode: 'D',
Type: "test_data_thing",
Name: "foo",
},
},
},
}, },
addrs.AbsProviderConfig{ addrs.AbsProviderConfig{
Provider: addrs.NewDefaultProvider("test"), Provider: addrs.NewDefaultProvider("test"),
@ -116,15 +96,6 @@ func TestStateShim(t *testing.T) {
&states.ResourceInstanceObjectSrc{ &states.ResourceInstanceObjectSrc{
Status: states.ObjectReady, Status: states.ObjectReady,
AttrsFlat: map[string]string{"id": "old", "fizzle": "wizzle"}, AttrsFlat: map[string]string{"id": "old", "fizzle": "wizzle"},
DependsOn: []addrs.Referenceable{
addrs.ResourceInstance{
Resource: addrs.Resource{
Mode: 'D',
Type: "test_data_thing",
Name: "foo",
},
},
},
}, },
addrs.AbsProviderConfig{ addrs.AbsProviderConfig{
Provider: addrs.NewDefaultProvider("test"), Provider: addrs.NewDefaultProvider("test"),
@ -141,7 +112,6 @@ func TestStateShim(t *testing.T) {
&states.ResourceInstanceObjectSrc{ &states.ResourceInstanceObjectSrc{
Status: states.ObjectReady, Status: states.ObjectReady,
AttrsFlat: map[string]string{"id": "0", "bazzle": "dazzle"}, AttrsFlat: map[string]string{"id": "0", "bazzle": "dazzle"},
DependsOn: []addrs.Referenceable{},
}, },
addrs.AbsProviderConfig{ addrs.AbsProviderConfig{
Provider: addrs.NewDefaultProvider("test"), Provider: addrs.NewDefaultProvider("test"),
@ -157,7 +127,6 @@ func TestStateShim(t *testing.T) {
&states.ResourceInstanceObjectSrc{ &states.ResourceInstanceObjectSrc{
Status: states.ObjectTainted, Status: states.ObjectTainted,
AttrsFlat: map[string]string{"id": "1", "bazzle": "dazzle"}, AttrsFlat: map[string]string{"id": "1", "bazzle": "dazzle"},
DependsOn: []addrs.Referenceable{},
}, },
addrs.AbsProviderConfig{ addrs.AbsProviderConfig{
Provider: addrs.NewDefaultProvider("test"), Provider: addrs.NewDefaultProvider("test"),
@ -174,7 +143,6 @@ func TestStateShim(t *testing.T) {
&states.ResourceInstanceObjectSrc{ &states.ResourceInstanceObjectSrc{
Status: states.ObjectReady, Status: states.ObjectReady,
AttrsJSON: []byte(`{"id": "single", "bazzle":"dazzle"}`), AttrsJSON: []byte(`{"id": "single", "bazzle":"dazzle"}`),
DependsOn: []addrs.Referenceable{},
}, },
addrs.AbsProviderConfig{ addrs.AbsProviderConfig{
Provider: addrs.NewDefaultProvider("test"), Provider: addrs.NewDefaultProvider("test"),
@ -223,7 +191,6 @@ func TestStateShim(t *testing.T) {
"schema_version": 7, "schema_version": 7,
}, },
}, },
Dependencies: []string{"test_thing.baz"},
}, },
}, },
}, },
@ -249,7 +216,6 @@ func TestStateShim(t *testing.T) {
}, },
}, },
}, },
Dependencies: []string{"data.test_data_thing.foo"},
}, },
"data.test_data_thing.foo": &terraform.ResourceState{ "data.test_data_thing.foo": &terraform.ResourceState{
Type: "test_data_thing", Type: "test_data_thing",
@ -386,7 +352,6 @@ func TestShimLegacyState(t *testing.T) {
&states.ResourceInstanceObjectSrc{ &states.ResourceInstanceObjectSrc{
Status: states.ObjectReady, Status: states.ObjectReady,
AttrsFlat: map[string]string{"id": "baz", "bazzle": "dazzle"}, AttrsFlat: map[string]string{"id": "baz", "bazzle": "dazzle"},
DependsOn: []addrs.Referenceable{},
Dependencies: []addrs.ConfigResource{}, Dependencies: []addrs.ConfigResource{},
}, },
addrs.AbsProviderConfig{ addrs.AbsProviderConfig{
@ -404,7 +369,6 @@ func TestShimLegacyState(t *testing.T) {
&states.ResourceInstanceObjectSrc{ &states.ResourceInstanceObjectSrc{
Status: states.ObjectReady, Status: states.ObjectReady,
AttrsFlat: map[string]string{"id": "bar", "fizzle": "wizzle"}, AttrsFlat: map[string]string{"id": "bar", "fizzle": "wizzle"},
DependsOn: []addrs.Referenceable{},
Dependencies: []addrs.ConfigResource{}, Dependencies: []addrs.ConfigResource{},
}, },
addrs.AbsProviderConfig{ addrs.AbsProviderConfig{