Remove required env var, fix test names.
We no longer need to set an env var (yaaay!) and our test names use camelCase not snake_case, though that confusion is understandable.
This commit is contained in:
parent
f5ff3b987d
commit
be17d7ac12
|
@ -78,10 +78,6 @@ func testAccPreCheck(t *testing.T) {
|
||||||
if v := os.Getenv("GOOGLE_XPN_HOST_PROJECT"); v == "" {
|
if v := os.Getenv("GOOGLE_XPN_HOST_PROJECT"); v == "" {
|
||||||
t.Fatal("GOOGLE_XPN_HOST_PROJECT must be set for acceptance tests")
|
t.Fatal("GOOGLE_XPN_HOST_PROJECT must be set for acceptance tests")
|
||||||
}
|
}
|
||||||
|
|
||||||
if v := os.Getenv("GOOGLE_COMPUTE_DISK_SNAPSHOT_URI"); v == "" {
|
|
||||||
t.Fatal("GOOGLE_COMPUTE_DISK_SNAPSHOT_URI must be set for acceptance tests")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestProvider_getRegionFromZone(t *testing.T) {
|
func TestProvider_getRegionFromZone(t *testing.T) {
|
||||||
|
|
|
@ -31,7 +31,7 @@ func TestAccComputeDisk_basic(t *testing.T) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestAccComputeDisk_from_snapshot_uri(t *testing.T) {
|
func TestAccComputeDisk_fromSnapshotURI(t *testing.T) {
|
||||||
diskName := fmt.Sprintf("tf-test-%s", acctest.RandString(10))
|
diskName := fmt.Sprintf("tf-test-%s", acctest.RandString(10))
|
||||||
firstDiskName := 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))
|
snapshotName := fmt.Sprintf("tf-test-%s", acctest.RandString(10))
|
||||||
|
@ -45,7 +45,7 @@ func TestAccComputeDisk_from_snapshot_uri(t *testing.T) {
|
||||||
CheckDestroy: testAccCheckComputeDiskDestroy,
|
CheckDestroy: testAccCheckComputeDiskDestroy,
|
||||||
Steps: []resource.TestStep{
|
Steps: []resource.TestStep{
|
||||||
resource.TestStep{
|
resource.TestStep{
|
||||||
Config: testAccComputeDisk_from_snapshot_uri(firstDiskName, snapshotName, diskName, xpn_host),
|
Config: testAccComputeDisk_fromSnapshotURI(firstDiskName, snapshotName, diskName, xpn_host),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckComputeDiskExists(
|
testAccCheckComputeDiskExists(
|
||||||
"google_compute_disk.seconddisk", &disk),
|
"google_compute_disk.seconddisk", &disk),
|
||||||
|
@ -155,7 +155,7 @@ resource "google_compute_disk" "foobar" {
|
||||||
}`, diskName)
|
}`, diskName)
|
||||||
}
|
}
|
||||||
|
|
||||||
func testAccComputeDisk_from_snapshot_uri(firstDiskName string, snapshotName string, diskName string, xpn_host string) string {
|
func testAccComputeDisk_fromSnapshotURI(firstDiskName, snapshotName, diskName, xpn_host string) string {
|
||||||
return fmt.Sprintf(`
|
return fmt.Sprintf(`
|
||||||
resource "google_compute_disk" "foobar" {
|
resource "google_compute_disk" "foobar" {
|
||||||
name = "%s"
|
name = "%s"
|
||||||
|
|
Loading…
Reference in New Issue