Skip to content

Commit

Permalink
CI changes only. (#306)
Browse files Browse the repository at this point in the history
  • Loading branch information
modular-magician authored and nat-henderson committed Jan 3, 2019
1 parent 9ee90c1 commit 7b898d0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package google

import (
"fmt"
"strings"
"testing"

"github.com/hashicorp/terraform/helper/acctest"
Expand Down Expand Up @@ -71,10 +72,13 @@ resource "google_appengine_firewall_rule" "rule" {
}

func testAccCheckAppengineFirewallRuleDestroy(s *terraform.State) error {
for _, rs := range s.RootModule().Resources {
for name, rs := range s.RootModule().Resources {
if rs.Type != "google_appengine_firewall_rule" {
continue
}
if strings.HasPrefix(name, "data.") {
continue
}

config := testAccProvider.Meta().(*Config)

Expand Down
15 changes: 9 additions & 6 deletions google-beta/resource_compute_image_generated_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,17 @@ import (
func TestAccComputeImage_imageBasicExample(t *testing.T) {
t.Parallel()

context := map[string]interface{}{
"random_suffix": acctest.RandString(10),
}

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckComputeImageDestroy,
Steps: []resource.TestStep{
{
Config: testAccComputeImage_imageBasicExample(acctest.RandString(10)),
Config: testAccComputeImage_imageBasicExample(context),
},
{
ResourceName: "google_compute_image.example",
Expand All @@ -45,17 +49,16 @@ func TestAccComputeImage_imageBasicExample(t *testing.T) {
})
}

func testAccComputeImage_imageBasicExample(val string) string {
return fmt.Sprintf(`
func testAccComputeImage_imageBasicExample(context map[string]interface{}) string {
return Nprintf(`
resource "google_compute_image" "example" {
name = "example-image-%s"
name = "example-image-%{random_suffix}"
raw_disk {
source = "https://storage.googleapis.com/bosh-cpi-artifacts/bosh-stemcell-3262.4-google-kvm-ubuntu-trusty-go_agent-raw.tar.gz"
}
}
`, val,
)
`, context)
}

func testAccCheckComputeImageDestroy(s *terraform.State) error {
Expand Down

0 comments on commit 7b898d0

Please sign in to comment.