From 5d9637ab1a8c7e387402a05229135e1b978261e2 Mon Sep 17 00:00:00 2001 From: Paul Hinze Date: Tue, 23 Feb 2016 10:24:53 -0600 Subject: [PATCH] core: Clean up test for issue #5254 --- terraform/context_apply_test.go | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/terraform/context_apply_test.go b/terraform/context_apply_test.go index 7c2769d29..ffb225107 100644 --- a/terraform/context_apply_test.go +++ b/terraform/context_apply_test.go @@ -3944,7 +3944,6 @@ func TestContext2Apply_issue5254(t *testing.T) { p.DiffFn = testDiffFn // Apply cleanly step 0 - t.Log("Applying Step 0") ctx := testContext2(t, &ContextOpts{ Module: testModule(t, "issue-5254/step-0"), Providers: map[string]ResourceProviderFactory{ @@ -3956,7 +3955,6 @@ func TestContext2Apply_issue5254(t *testing.T) { if err != nil { t.Fatalf("err: %s", err) } - t.Logf("Plan for Step 0: %s", plan) state, err := ctx.Apply() if err != nil { @@ -3964,8 +3962,6 @@ func TestContext2Apply_issue5254(t *testing.T) { } // Application success. Now make the modification and store a plan - println("Planning Step 1") - t.Log("Planning Step 1") ctx = testContext2(t, &ContextOpts{ Module: testModule(t, "issue-5254/step-1"), State: state, @@ -3990,11 +3986,6 @@ func TestContext2Apply_issue5254(t *testing.T) { t.Fatalf("err: %s", err) } - t.Logf("Plan for Step 1: %s", planFromFile) - - // Apply the plan - println("Applying Step 1 (from Plan)") - t.Log("Applying Step 1 (from plan)") ctx = planFromFile.Context(&ContextOpts{ Providers: map[string]ResourceProviderFactory{ "template": testProviderFuncFixed(p), @@ -4006,11 +3997,21 @@ func TestContext2Apply_issue5254(t *testing.T) { t.Fatalf("err: %s", err) } - /* - actual := strings.TrimSpace(state.String()) - expected := strings.TrimSpace(testTerraformApplyProviderAliasStr) - if actual != expected { - t.Fatalf("bad: \n%s", actual) - } - */ + actual := strings.TrimSpace(state.String()) + expected := strings.TrimSpace(` +template_file.child: + ID = foo + template = Hi + type = template_file + + Dependencies: + template_file.parent +template_file.parent: + ID = foo + template = Hi + type = template_file + `) + if actual != expected { + t.Fatalf("expected state: \n%s\ngot: \n%s", expected, actual) + } }