From f8dec8bcfd36d9746b3f88d60c442f9c1c028a25 Mon Sep 17 00:00:00 2001 From: The Magician Date: Thu, 20 Dec 2018 10:24:24 -0800 Subject: [PATCH] Require a provider zone to be set in tests (#2720) /cc @rileykarson --- google/provider_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/google/provider_test.go b/google/provider_test.go index e3b34308..d738ea9b 100644 --- a/google/provider_test.go +++ b/google/provider_test.go @@ -35,6 +35,12 @@ var regionEnvVars = []string{ "CLOUDSDK_COMPUTE_REGION", } +var zoneEnvVars = []string{ + "GOOGLE_ZONE", + "GCLOUD_ZONE", + "CLOUDSDK_COMPUTE_ZONE", +} + var orgEnvVars = []string{ "GOOGLE_ORG", } @@ -97,6 +103,10 @@ func testAccPreCheck(t *testing.T) { if v := multiEnvSearch(regionEnvVars); v != "us-central1" { t.Fatalf("One of %s must be set to us-central1 for acceptance tests", strings.Join(regionEnvVars, ", ")) } + + if v := multiEnvSearch(zoneEnvVars); v != "us-central1-a" { + t.Fatalf("One of %s must be set to us-central1-a for acceptance tests", strings.Join(zoneEnvVars, ", ")) + } } func TestProvider_getRegionFromZone(t *testing.T) {