From 656115387b1d63905b3e3c44cb7657868fe73bd3 Mon Sep 17 00:00:00 2001 From: Chris Marchesi Date: Fri, 23 Jun 2017 17:37:51 -0700 Subject: [PATCH] core: Simplify TestNodeRefreshableManagedResourceEvalTree_scaleOut This should make things a bit more clear as to what we are doing in the EvalTree scale-out test - ensuring that we get the correct eval sequence for a node with no state through EvalTree. --- terraform/node_resource_refresh_test.go | 56 +------------------------ 1 file changed, 1 insertion(+), 55 deletions(-) diff --git a/terraform/node_resource_refresh_test.go b/terraform/node_resource_refresh_test.go index 5a542a9fe..2c9f69219 100644 --- a/terraform/node_resource_refresh_test.go +++ b/terraform/node_resource_refresh_test.go @@ -157,10 +157,6 @@ root - terraform.graphNodeRoot } func TestNodeRefreshableManagedResourceEvalTree_scaleOut(t *testing.T) { - var provider ResourceProvider - var state *InstanceState - var resourceConfig *ResourceConfig - addr, err := ParseResourceAddress("aws_instance.foo[2]") if err != nil { t.Fatalf("bad: %s", err) @@ -176,57 +172,7 @@ func TestNodeRefreshableManagedResourceEvalTree_scaleOut(t *testing.T) { } actual := n.EvalTree() - - expected := &EvalSequence{ - Nodes: []EvalNode{ - &EvalInterpolate{ - Config: n.Config.RawConfig.Copy(), - Resource: &Resource{ - Name: addr.Name, - Type: addr.Type, - CountIndex: addr.Index, - }, - Output: &resourceConfig, - }, - &EvalGetProvider{ - Name: n.ProvidedBy()[0], - Output: &provider, - }, - &EvalValidateResource{ - Provider: &provider, - Config: &resourceConfig, - ResourceName: n.Config.Name, - ResourceType: n.Config.Type, - ResourceMode: n.Config.Mode, - IgnoreWarnings: true, - }, - &EvalReadState{ - Name: addr.stateId(), - Output: &state, - }, - &EvalDiff{ - Name: addr.stateId(), - Info: &InstanceInfo{ - Id: addr.stateId(), - Type: addr.Type, - ModulePath: normalizeModulePath(addr.Path), - }, - Config: &resourceConfig, - Resource: n.Config, - Provider: &provider, - State: &state, - OutputState: &state, - Stub: true, - }, - &EvalWriteState{ - Name: addr.stateId(), - ResourceType: n.Config.Type, - Provider: n.Config.Provider, - Dependencies: n.StateReferences(), - State: &state, - }, - }, - } + expected := n.evalTreeManagedResourceNoState() if !reflect.DeepEqual(expected, actual) { t.Fatalf("Expected:\n\n%s\nGot:\n\n%s\n", spew.Sdump(expected), spew.Sdump(actual))