Skip to content

Commit

Permalink
helper/resource/testing: allowing disabling Binary Testing via an Env…
Browse files Browse the repository at this point in the history
…ironment Variable

This allows us to roll this out by Service Package, rather than by individual Test Case
  • Loading branch information
tombuildsstuff authored and kmoe committed May 6, 2020
1 parent 9f7437c commit 0832446
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions helper/resource/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 0832446

Please sign in to comment.