From 83bab2c125ee9388d54b1f1ab9b8abc92de575bf Mon Sep 17 00:00:00 2001 From: Michael Kochell Date: Thu, 17 Oct 2019 10:38:47 -0600 Subject: [PATCH] [MM-19102] Enable debug flag for plugin check tests (#12588) --- plugin/checker/main_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugin/checker/main_test.go b/plugin/checker/main_test.go index 82c01837fe..c05819b850 100644 --- a/plugin/checker/main_test.go +++ b/plugin/checker/main_test.go @@ -4,6 +4,7 @@ package main import ( + "os" "testing" "github.com/stretchr/testify/assert" @@ -35,6 +36,11 @@ func TestRunCheck(t *testing.T) { }, } + // Enable debug flag to have packagesdriver/sizes.go print stderr of `go list` command. + // We want to surface any error text that may exist in stderr of this command. + prevEnvValue := os.Getenv("GOPACKAGESPRINTGOLISTERRORS") + os.Setenv("GOPACKAGESPRINTGOLISTERRORS", "true") + for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { err := runCheck(tc.pkgPath) @@ -46,4 +52,5 @@ func TestRunCheck(t *testing.T) { } }) } + os.Setenv("GOPACKAGESPRINTGOLISTERRORS", prevEnvValue) }