mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
terraform: more tests
This commit is contained in:
parent
daf66357f6
commit
f7bed9a2f9
@ -181,7 +181,6 @@ func TestContext2Plan_moduleInputFromVar(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
func TestContext2Plan_moduleMultiVar(t *testing.T) {
|
func TestContext2Plan_moduleMultiVar(t *testing.T) {
|
||||||
m := testModule(t, "plan-module-multi-var")
|
m := testModule(t, "plan-module-multi-var")
|
||||||
p := testProvider("aws")
|
p := testProvider("aws")
|
||||||
@ -205,6 +204,7 @@ func TestContext2Plan_moduleMultiVar(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
func TestContextPlan_moduleOrphans(t *testing.T) {
|
func TestContextPlan_moduleOrphans(t *testing.T) {
|
||||||
m := testModule(t, "plan-modules-remove")
|
m := testModule(t, "plan-modules-remove")
|
||||||
p := testProvider("aws")
|
p := testProvider("aws")
|
||||||
|
@ -28,9 +28,16 @@ func (t *ResourceCountTransformer) Transform(g *Graph) error {
|
|||||||
// For each count, build and add the node
|
// For each count, build and add the node
|
||||||
nodes := make([]dag.Vertex, count)
|
nodes := make([]dag.Vertex, count)
|
||||||
for i := 0; i < count; i++ {
|
for i := 0; i < count; i++ {
|
||||||
|
// Set the index. If our count is 1 we special case it so that
|
||||||
|
// we handle the "resource.0" and "resource" boundary properly.
|
||||||
|
index := i
|
||||||
|
if count == 1 {
|
||||||
|
index = -1
|
||||||
|
}
|
||||||
|
|
||||||
// Save the node for later so we can do connections
|
// Save the node for later so we can do connections
|
||||||
nodes[i] = &graphNodeExpandedResource{
|
nodes[i] = &graphNodeExpandedResource{
|
||||||
Index: i,
|
Index: index,
|
||||||
Resource: t.Resource,
|
Resource: t.Resource,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -146,7 +153,7 @@ func (n *graphNodeExpandedResource) EvalTree() EvalNode {
|
|||||||
|
|
||||||
// stateId is the name used for the state key
|
// stateId is the name used for the state key
|
||||||
func (n *graphNodeExpandedResource) stateId() string {
|
func (n *graphNodeExpandedResource) stateId() string {
|
||||||
if n.Index == 0 {
|
if n.Index == -1 {
|
||||||
return n.Resource.Id()
|
return n.Resource.Id()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user