From 96e69bb12254b7b0a344100bf528d088f4b34c2b Mon Sep 17 00:00:00 2001 From: tombuildsstuff Date: Tue, 5 May 2020 08:33:21 +0200 Subject: [PATCH] helper/resource/testing: allowing disabling Binary Testing via an Environment Variable This allows us to roll this out by Service Package, rather than by individual Test Case --- helper/resource/testing.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/helper/resource/testing.go b/helper/resource/testing.go index 13ac7078e4d..1f63e615d29 100644 --- a/helper/resource/testing.go +++ b/helper/resource/testing.go @@ -261,6 +261,7 @@ func runSweeperWithRegion(region string, s *Sweeper, sweepers map[string]*Sweepe } const TestEnvVar = "TF_ACC" +const TestDisableBinaryTestingFlagEnvVar = "TF_DISABLE_BINARY_TESTING" // TestProvider can be implemented by any ResourceProvider to provide custom // reset functionality at the start of an acceptance test. @@ -549,6 +550,14 @@ func Test(t TestT, c TestCase) { TestEnvVar)) return } + if v := os.Getenv(TestDisableBinaryTestingFlagEnvVar); v != "" { + b, err := strconv.ParseBool(v) + if err != nil { + t.Error(fmt.Errorf("Error parsing EnvVar %q value %q: %s", TestDisableBinaryTestingFlagEnvVar, v, err)) + } + + c.DisableBinaryDriver = b + } logWriter, err := LogOutput(t) if err != nil {