From fe1e4d8e87134fadb0615cc13048596d4828da42 Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Mon, 10 Sep 2018 16:32:11 -0700 Subject: [PATCH] core: In all tests, prevent go-spew from using fmt.Stringer impls --- terraform/terraform_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/terraform/terraform_test.go b/terraform/terraform_test.go index dd42c22f64..49ad4a8354 100644 --- a/terraform/terraform_test.go +++ b/terraform/terraform_test.go @@ -11,6 +11,7 @@ import ( "sync" "testing" + "github.com/davecgh/go-spew/spew" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/convert" @@ -50,6 +51,13 @@ func TestMain(m *testing.M) { // Always DeepCopy the Diff on every Plan during a test contextTestDeepCopyOnPlan = true + // We have fmt.Stringer implementations on lots of objects that hide + // details that we very often want to see in tests, so we just disable + // spew's use of String methods globally on the assumption that spew + // usage implies an intent to see the raw values and ignore any + // abstractions. + spew.Config.DisableMethods = true + os.Exit(m.Run()) }