mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-10-01 16:21:06 +00:00
the XPN_* env. variable is no longer mandatory (#760)
Since this variable is only used for 3 tests, it doesn't make sense to declare it as mandatory in the test config. Therefore, concerned tests are now skipped if the variable is absent.
This commit is contained in:
parent
aa63af1fc3
commit
ecdb1de297
@ -70,10 +70,6 @@ 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 := 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) {
|
||||
|
@ -90,6 +90,8 @@ func TestAccComputeDisk_update(t *testing.T) {
|
||||
func TestAccComputeDisk_fromSnapshot(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
skipIfEnvNotSet(t, "GOOGLE_XPN_HOST_PROJECT")
|
||||
|
||||
diskName := fmt.Sprintf("tf-test-%s", acctest.RandString(10))
|
||||
firstDiskName := fmt.Sprintf("tf-test-%s", acctest.RandString(10))
|
||||
snapshotName := fmt.Sprintf("tf-test-%s", acctest.RandString(10))
|
||||
|
@ -178,6 +178,8 @@ func TestAccComputeInstanceTemplate_subnet_custom(t *testing.T) {
|
||||
func TestAccComputeInstanceTemplate_subnet_xpn(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
skipIfEnvNotSet(t, "GOOGLE_XPN_HOST_PROJECT")
|
||||
|
||||
var instanceTemplate compute.InstanceTemplate
|
||||
var xpn_host = os.Getenv("GOOGLE_XPN_HOST_PROJECT")
|
||||
|
||||
|
@ -587,6 +587,8 @@ func TestAccComputeInstance_subnet_custom(t *testing.T) {
|
||||
func TestAccComputeInstance_subnet_xpn(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
skipIfEnvNotSet(t, "GOOGLE_XPN_HOST_PROJECT")
|
||||
|
||||
var instance compute.Instance
|
||||
var instanceName = fmt.Sprintf("instance-test-%s", acctest.RandString(10))
|
||||
var xpn_host = os.Getenv("GOOGLE_XPN_HOST_PROJECT")
|
||||
|
Loading…
Reference in New Issue
Block a user