provider/google: Moving the XPN EnvVar check into provider_test.go to stop failed build
This commit is contained in:
parent
4f256a54db
commit
9aebe3344a
|
@ -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) {
|
||||||
|
|
|
@ -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) },
|
||||||
|
|
Loading…
Reference in New Issue