From dc0ec11ec92df586c883d7de3b597c6b858e6dbb Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 22 Jul 2014 19:43:09 -0700 Subject: [PATCH] command: fix tests --- command/apply_test.go | 4 ++-- command/command_test.go | 1 + terraform/context.go | 10 ++++++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/command/apply_test.go b/command/apply_test.go index 3d73b6140..aeea86414 100644 --- a/command/apply_test.go +++ b/command/apply_test.go @@ -487,7 +487,7 @@ func TestApply_vars(t *testing.T) { actual = v.(string) } - return nil, nil + return &terraform.ResourceDiff{}, nil } args := []string{ @@ -530,7 +530,7 @@ func TestApply_varFile(t *testing.T) { actual = v.(string) } - return nil, nil + return &terraform.ResourceDiff{}, nil } args := []string{ diff --git a/command/command_test.go b/command/command_test.go index 0f231ba90..b1541f406 100644 --- a/command/command_test.go +++ b/command/command_test.go @@ -85,6 +85,7 @@ func testStateFile(t *testing.T, s *terraform.State) string { func testProvider() *terraform.MockResourceProvider { p := new(terraform.MockResourceProvider) + p.DiffReturn = &terraform.ResourceDiff{} p.RefreshFn = func( s *terraform.ResourceState) (*terraform.ResourceState, error) { return s, nil diff --git a/terraform/context.go b/terraform/context.go index 24710cc11..1e3acc0d4 100644 --- a/terraform/context.go +++ b/terraform/context.go @@ -490,8 +490,9 @@ func (c *Context) applyWalkFn() depgraph.WalkFunc { // If this happened, then the diff above returned a bad diff. if diff == nil { return fmt.Errorf( - "%s: diff became nil during Apply. This is a bug with " + - "the resource provider. Please report a bug.") + "%s: diff became nil during Apply. This is a bug with "+ + "the resource provider. Please report a bug.", + r.Id) } // Delete id from the diff because it is dependent on @@ -506,8 +507,9 @@ func (c *Context) applyWalkFn() depgraph.WalkFunc { "\n\nDiff 2: %#v", r.Diff, diff) return fmt.Errorf( - "%s: diffs didn't match during apply. This is a " + - "bug with the resource provider, please report a bug.") + "%s: diffs didn't match during apply. This is a "+ + "bug with the resource provider, please report a bug.", + r.Id) } }