Use a unique key when running project_metadata_item import tests (#274)

CI runs tests concurrently and will interfere with each other with the
current global key name.
This commit is contained in:
Joe Selman 2017-08-01 11:14:13 -07:00 committed by GitHub
parent 28f8931f0b
commit c6ae260d63

View File

@ -3,17 +3,20 @@ package google
import ( import (
"testing" "testing"
"github.com/hashicorp/terraform/helper/acctest"
"github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/helper/resource"
) )
func TestAccComputeProjectMetadataItem_importBasic(t *testing.T) { func TestAccComputeProjectMetadataItem_importBasic(t *testing.T) {
key := "myKey" + acctest.RandString(10)
resource.Test(t, resource.TestCase{ resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) }, PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders, Providers: testAccProviders,
CheckDestroy: testAccCheckProjectMetadataItemDestroy, CheckDestroy: testAccCheckProjectMetadataItemDestroy,
Steps: []resource.TestStep{ Steps: []resource.TestStep{
{ {
Config: testAccProjectMetadataItem_basic("myKey", "myValue"), Config: testAccProjectMetadataItem_basic(key, "myValue"),
}, },
{ {
ResourceName: "google_compute_project_metadata_item.foobar", ResourceName: "google_compute_project_metadata_item.foobar",