Require a provider zone to be set in tests (#2720)

<!-- This change is generated by MagicModules. -->
/cc @rileykarson
This commit is contained in:
The Magician 2018-12-20 10:24:24 -08:00 committed by Nathan McKinley
parent 9f33f7bda7
commit f8dec8bcfd

View File

@ -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) {