From 073beb90a6371219884fae9bcddfc6dddb1c718e Mon Sep 17 00:00:00 2001 From: James Bardin Date: Wed, 14 Oct 2020 09:10:37 -0400 Subject: [PATCH] re-enable and fix module variable tests A few tests were inadvertently renamed, causing them to be be skipped. For some reason this is not caught by the `vet` pass that happens during normal testing. --- terraform/node_module_variable_test.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/terraform/node_module_variable_test.go b/terraform/node_module_variable_test.go index 209da4f24..f0d74c11f 100644 --- a/terraform/node_module_variable_test.go +++ b/terraform/node_module_variable_test.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform/configs" ) -func TestnodeModuleVariablePath(t *testing.T) { +func TestNodeModuleVariablePath(t *testing.T) { n := &nodeModuleVariable{ Addr: addrs.RootModuleInstance.InputVariable("foo"), Config: &configs.Variable{ @@ -27,7 +27,7 @@ func TestnodeModuleVariablePath(t *testing.T) { } } -func TestnodeModuleVariableReferenceableName(t *testing.T) { +func TestNodeModuleVariableReferenceableName(t *testing.T) { n := &nodeExpandModuleVariable{ Addr: addrs.InputVariable{Name: "foo"}, Config: &configs.Variable{ @@ -47,7 +47,7 @@ func TestnodeModuleVariableReferenceableName(t *testing.T) { { gotSelfPath, gotReferencePath := n.ReferenceOutside() - wantSelfPath := addrs.RootModuleInstance.Child("child", addrs.NoKey) + wantSelfPath := addrs.RootModuleInstance wantReferencePath := addrs.RootModuleInstance if got, want := gotSelfPath.String(), wantSelfPath.String(); got != want { t.Errorf("wrong self path\ngot: %s\nwant: %s", got, want) @@ -59,9 +59,10 @@ func TestnodeModuleVariableReferenceableName(t *testing.T) { } -func TestnodeModuleVariableReference(t *testing.T) { +func TestNodeModuleVariableReference(t *testing.T) { n := &nodeExpandModuleVariable{ - Addr: addrs.InputVariable{Name: "foo"}, + Addr: addrs.InputVariable{Name: "foo"}, + Module: addrs.RootModule.Child("bar"), Config: &configs.Variable{ Name: "foo", }, @@ -84,9 +85,10 @@ func TestnodeModuleVariableReference(t *testing.T) { } } -func TestnodeModuleVariableReference_grandchild(t *testing.T) { +func TestNodeModuleVariableReference_grandchild(t *testing.T) { n := &nodeExpandModuleVariable{ - Addr: addrs.InputVariable{Name: "foo"}, + Addr: addrs.InputVariable{Name: "foo"}, + Module: addrs.RootModule.Child("bar"), Config: &configs.Variable{ Name: "foo", },