provider/google: Moving the XPN EnvVar check into provider_test.go to stop failed build

This commit is contained in:
stack72 2016-12-13 19:29:23 +00:00
parent 4f256a54db
commit 9aebe3344a
No known key found for this signature in database
GPG Key ID: 8619A619B085CB16
2 changed files with 4 additions and 3 deletions

View File

@ -74,6 +74,10 @@ func testAccPreCheck(t *testing.T) {
if v := multiEnvSearch(regs); v != "us-central1" { if v := multiEnvSearch(regs); v != "us-central1" {
t.Fatalf("One of %s must be set to us-central1 for acceptance tests", strings.Join(regs, ", ")) t.Fatalf("One of %s must be set to us-central1 for acceptance tests", strings.Join(regs, ", "))
} }
if v := os.Getenv("GOOGLE_XPN_HOST_PROJECT"); v == "" {
t.Fatal("GOOGLE_XPN_HOST_PROJECT must be set for acceptance tests")
}
} }
func TestProvider_getRegionFromZone(t *testing.T) { func TestProvider_getRegionFromZone(t *testing.T) {

View File

@ -423,9 +423,6 @@ func TestAccComputeInstance_subnet_xpn(t *testing.T) {
var instance compute.Instance var instance compute.Instance
var instanceName = fmt.Sprintf("instance-test-%s", acctest.RandString(10)) var instanceName = fmt.Sprintf("instance-test-%s", acctest.RandString(10))
var xpn_host = os.Getenv("GOOGLE_XPN_HOST_PROJECT") var xpn_host = os.Getenv("GOOGLE_XPN_HOST_PROJECT")
if xpn_host == "" {
t.Fatal("GOOGLE_XPN_HOST_PROJECT must be set for TestAccComputeInstance_subnet_xpn test")
}
resource.Test(t, resource.TestCase{ resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) }, PreCheck: func() { testAccPreCheck(t) },