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 (
"testing"
"github.com/hashicorp/terraform/helper/acctest"
"github.com/hashicorp/terraform/helper/resource"
)
func TestAccComputeProjectMetadataItem_importBasic(t *testing.T) {
key := "myKey" + acctest.RandString(10)
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckProjectMetadataItemDestroy,
Steps: []resource.TestStep{
{
Config: testAccProjectMetadataItem_basic("myKey", "myValue"),
Config: testAccProjectMetadataItem_basic(key, "myValue"),
},
{
ResourceName: "google_compute_project_metadata_item.foobar",