update test strings

Match the new names output by the expander nodes
This commit is contained in:
James Bardin 2020-05-12 10:54:43 -04:00
parent 5cb6c86b32
commit 07c35dd4df
5 changed files with 88 additions and 88 deletions

View File

@ -757,20 +757,20 @@ const testApplyGraphBuilderStr = `
meta.count-boundary (EachMode fixup)
module.child (close)
test_object.other
module.child
module.child (close)
module.child.test_object.other
module.child (expand)
module.child.test_object.create
module.child.test_object.create (prepare state)
module.child.test_object.create (prepare state)
module.child
module.child.test_object.create (expand)
module.child.test_object.create (expand)
module.child (expand)
provider["registry.terraform.io/hashicorp/test"]
provisioner.test
module.child.test_object.other
module.child.test_object.create
module.child.test_object.other (prepare state)
module.child.test_object.other (prepare state)
module.child
module.child.test_object.other (expand)
module.child.test_object.other (expand)
module.child (expand)
provider["registry.terraform.io/hashicorp/test"]
provider["registry.terraform.io/hashicorp/test"]
provider["registry.terraform.io/hashicorp/test"] (close)
@ -784,13 +784,13 @@ root
provider["registry.terraform.io/hashicorp/test"] (close)
provisioner.test (close)
test_object.create
test_object.create (prepare state)
test_object.create (prepare state)
test_object.create (expand)
test_object.create (expand)
provider["registry.terraform.io/hashicorp/test"]
test_object.other
test_object.create
test_object.other (prepare state)
test_object.other (prepare state)
test_object.other (expand)
test_object.other (expand)
provider["registry.terraform.io/hashicorp/test"]
`
@ -803,14 +803,14 @@ provider["registry.terraform.io/hashicorp/test"] (close)
root
meta.count-boundary (EachMode fixup)
provider["registry.terraform.io/hashicorp/test"] (close)
test_object.A (prepare state)
test_object.A (expand)
provider["registry.terraform.io/hashicorp/test"]
test_object.A[1] (destroy)
provider["registry.terraform.io/hashicorp/test"]
test_object.B
test_object.A (prepare state)
test_object.A (expand)
test_object.A[1] (destroy)
test_object.B (prepare state)
test_object.B (prepare state)
test_object.B (expand)
test_object.B (expand)
provider["registry.terraform.io/hashicorp/test"]
`

View File

@ -126,26 +126,26 @@ func TestPlanGraphBuilder_dynamicBlock(t *testing.T) {
expected := strings.TrimSpace(`
meta.count-boundary (EachMode fixup)
provider["registry.terraform.io/hashicorp/test"]
test_thing.a
test_thing.b
test_thing.c
test_thing.a (expand)
test_thing.b (expand)
test_thing.c (expand)
provider["registry.terraform.io/hashicorp/test"]
provider["registry.terraform.io/hashicorp/test"] (close)
provider["registry.terraform.io/hashicorp/test"]
test_thing.a
test_thing.b
test_thing.c
test_thing.a (expand)
test_thing.b (expand)
test_thing.c (expand)
root
meta.count-boundary (EachMode fixup)
provider["registry.terraform.io/hashicorp/test"] (close)
test_thing.a
test_thing.a (expand)
provider["registry.terraform.io/hashicorp/test"]
test_thing.b
test_thing.b (expand)
provider["registry.terraform.io/hashicorp/test"]
test_thing.c
test_thing.c (expand)
provider["registry.terraform.io/hashicorp/test"]
test_thing.a
test_thing.b
test_thing.a (expand)
test_thing.b (expand)
`)
if actual != expected {
t.Fatalf("expected:\n%s\n\ngot:\n%s", expected, actual)
@ -205,21 +205,21 @@ func TestPlanGraphBuilder_attrAsBlocks(t *testing.T) {
expected := strings.TrimSpace(`
meta.count-boundary (EachMode fixup)
provider["registry.terraform.io/hashicorp/test"]
test_thing.a
test_thing.b
test_thing.a (expand)
test_thing.b (expand)
provider["registry.terraform.io/hashicorp/test"]
provider["registry.terraform.io/hashicorp/test"] (close)
provider["registry.terraform.io/hashicorp/test"]
test_thing.a
test_thing.b
test_thing.a (expand)
test_thing.b (expand)
root
meta.count-boundary (EachMode fixup)
provider["registry.terraform.io/hashicorp/test"] (close)
test_thing.a
test_thing.a (expand)
provider["registry.terraform.io/hashicorp/test"]
test_thing.b
test_thing.b (expand)
provider["registry.terraform.io/hashicorp/test"]
test_thing.a
test_thing.a (expand)
`)
if actual != expected {
t.Fatalf("expected:\n%s\n\ngot:\n%s", expected, actual)
@ -293,41 +293,41 @@ func TestPlanGraphBuilder_forEach(t *testing.T) {
}
const testPlanGraphBuilderStr = `
aws_instance.web
aws_security_group.firewall
aws_instance.web (expand)
aws_security_group.firewall (expand)
provider["registry.terraform.io/hashicorp/aws"]
var.foo
aws_load_balancer.weblb
aws_instance.web
aws_load_balancer.weblb (expand)
aws_instance.web (expand)
provider["registry.terraform.io/hashicorp/aws"]
aws_security_group.firewall
aws_security_group.firewall (expand)
provider["registry.terraform.io/hashicorp/aws"]
local.instance_id
aws_instance.web
local.instance_id (expand)
aws_instance.web (expand)
meta.count-boundary (EachMode fixup)
aws_instance.web
aws_load_balancer.weblb
aws_security_group.firewall
local.instance_id
openstack_floating_ip.random
output.instance_id
aws_instance.web (expand)
aws_load_balancer.weblb (expand)
aws_security_group.firewall (expand)
local.instance_id (expand)
openstack_floating_ip.random (expand)
output.instance_id (expand)
provider["registry.terraform.io/hashicorp/aws"]
provider["registry.terraform.io/hashicorp/openstack"]
var.foo
openstack_floating_ip.random
openstack_floating_ip.random (expand)
provider["registry.terraform.io/hashicorp/openstack"]
output.instance_id
local.instance_id
output.instance_id (expand)
local.instance_id (expand)
provider["registry.terraform.io/hashicorp/aws"]
openstack_floating_ip.random
openstack_floating_ip.random (expand)
provider["registry.terraform.io/hashicorp/aws"] (close)
aws_instance.web
aws_load_balancer.weblb
aws_security_group.firewall
aws_instance.web (expand)
aws_load_balancer.weblb (expand)
aws_security_group.firewall (expand)
provider["registry.terraform.io/hashicorp/aws"]
provider["registry.terraform.io/hashicorp/openstack"]
provider["registry.terraform.io/hashicorp/openstack"] (close)
openstack_floating_ip.random
openstack_floating_ip.random (expand)
provider["registry.terraform.io/hashicorp/openstack"]
root
meta.count-boundary (EachMode fixup)
@ -336,35 +336,35 @@ root
var.foo
`
const testPlanGraphBuilderForEachStr = `
aws_instance.bar
aws_instance.bar (expand)
provider["registry.terraform.io/hashicorp/aws"]
aws_instance.bar2
aws_instance.bar2 (expand)
provider["registry.terraform.io/hashicorp/aws"]
aws_instance.bat
aws_instance.boo
aws_instance.bat (expand)
aws_instance.boo (expand)
provider["registry.terraform.io/hashicorp/aws"]
aws_instance.baz
aws_instance.baz (expand)
provider["registry.terraform.io/hashicorp/aws"]
aws_instance.boo
aws_instance.boo (expand)
provider["registry.terraform.io/hashicorp/aws"]
aws_instance.foo
aws_instance.foo (expand)
provider["registry.terraform.io/hashicorp/aws"]
meta.count-boundary (EachMode fixup)
aws_instance.bar
aws_instance.bar2
aws_instance.bat
aws_instance.baz
aws_instance.boo
aws_instance.foo
aws_instance.bar (expand)
aws_instance.bar2 (expand)
aws_instance.bat (expand)
aws_instance.baz (expand)
aws_instance.boo (expand)
aws_instance.foo (expand)
provider["registry.terraform.io/hashicorp/aws"]
provider["registry.terraform.io/hashicorp/aws"]
provider["registry.terraform.io/hashicorp/aws"] (close)
aws_instance.bar
aws_instance.bar2
aws_instance.bat
aws_instance.baz
aws_instance.boo
aws_instance.foo
aws_instance.bar (expand)
aws_instance.bar2 (expand)
aws_instance.bat (expand)
aws_instance.baz (expand)
aws_instance.boo (expand)
aws_instance.foo (expand)
provider["registry.terraform.io/hashicorp/aws"]
root
meta.count-boundary (EachMode fixup)

View File

@ -58,13 +58,13 @@ provider["registry.terraform.io/hashicorp/test"] (close) - *terraform.graphNodeC
data.test_object.foo[1] (deposed 00000001) - *terraform.NodePlanDeposedResourceInstanceObject
data.test_object.foo[2] - *terraform.NodeRefreshableManagedResourceInstance
data.test_object.foo[2] (deposed 00000001) - *terraform.NodePlanDeposedResourceInstanceObject
test_object.foo - *terraform.nodeExpandRefreshableManagedResource
test_object.foo (expand) - *terraform.nodeExpandRefreshableManagedResource
test_object.foo[0] (deposed 00000001) - *terraform.NodePlanDeposedResourceInstanceObject
test_object.foo[1] (deposed 00000001) - *terraform.NodePlanDeposedResourceInstanceObject
test_object.foo[2] (deposed 00000001) - *terraform.NodePlanDeposedResourceInstanceObject
root - *terraform.nodeCloseModule
provider["registry.terraform.io/hashicorp/test"] (close) - *terraform.graphNodeCloseProvider
test_object.foo - *terraform.nodeExpandRefreshableManagedResource
test_object.foo (expand) - *terraform.nodeExpandRefreshableManagedResource
provider["registry.terraform.io/hashicorp/test"] - *terraform.NodeApplyableProvider
test_object.foo[0] (deposed 00000001) - *terraform.NodePlanDeposedResourceInstanceObject
provider["registry.terraform.io/hashicorp/test"] - *terraform.NodeApplyableProvider

View File

@ -58,10 +58,10 @@ func TestModuleVariableTransformer_nested(t *testing.T) {
}
const testTransformModuleVarBasicStr = `
module.child.var.value
module.child.var.value (expand)
`
const testTransformModuleVarNestedStr = `
module.child.module.child.var.value
module.child.var.value
module.child.module.child.var.value (expand)
module.child.var.value (expand)
`

View File

@ -118,12 +118,12 @@ func TestTargetsTransformer_downstream(t *testing.T) {
// outputs that descend from it are also targeted.
expected := strings.TrimSpace(`
module.child.module.grandchild.aws_instance.foo
module.child.module.grandchild.output.id
module.child.module.grandchild.output.id (expand)
module.child.module.grandchild.aws_instance.foo
module.child.output.grandchild_id
module.child.module.grandchild.output.id
output.grandchild_id
module.child.output.grandchild_id
module.child.output.grandchild_id (expand)
module.child.module.grandchild.output.id (expand)
output.grandchild_id (expand)
module.child.output.grandchild_id (expand)
`)
if actual != expected {
t.Fatalf("bad:\n\nexpected:\n%s\n\ngot:\n%s\n", expected, actual)
@ -189,12 +189,12 @@ func TestTargetsTransformer_wholeModule(t *testing.T) {
// outputs that descend from it are also targeted.
expected := strings.TrimSpace(`
module.child.module.grandchild.aws_instance.foo
module.child.module.grandchild.output.id
module.child.module.grandchild.output.id (expand)
module.child.module.grandchild.aws_instance.foo
module.child.output.grandchild_id
module.child.module.grandchild.output.id
output.grandchild_id
module.child.output.grandchild_id
module.child.output.grandchild_id (expand)
module.child.module.grandchild.output.id (expand)
output.grandchild_id (expand)
module.child.output.grandchild_id (expand)
`)
if actual != expected {
t.Fatalf("bad:\n\nexpected:\n%s\n\ngot:\n%s\n", expected, actual)