Skip to content

Commit

Permalink
[blocked] Cloudrun beta implementation on alpha KNative
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
chrisst authored and modular-magician committed Jul 2, 2019
1 parent 6cd70ff commit 560603f
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions google/resource_cloudrun_service_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
package google

import (
"fmt"
"testing"

"github.com/hashicorp/terraform/helper/acctest"
"github.com/hashicorp/terraform/helper/resource"
)

func TestAccCloudrunService_cloudrunServiceUpdate(t *testing.T) {
t.Parallel()

project := getTestProjectFromEnv()
name := "tftest-cloudrun-" + acctest.RandString(6)

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccCloudrunService_cloudrunServiceUpdate(name, project, "10"),
},
{
ResourceName: "google_cloudrun_service.default",
ImportStateId: "us-central1/" + name,
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"metadata.0.resource_version"},
},
{
Config: testAccCloudrunService_cloudrunServiceUpdate(name, project, "50"),
},
{
ResourceName: "google_cloudrun_service.default",
ImportStateId: "us-central1/" + name,
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"metadata.0.resource_version"},
},
},
})
}

func testAccCloudrunService_cloudrunServiceUpdate(name, project, concurrency string) string {
return fmt.Sprintf(`
resource "google_cloudrun_service" "default" {
name = "%s"
location = "us-central1"
metadata {
namespace = "%s"
}
spec {
container {
image = "gcr.io/cloudrun/hello"
args = ["arrgs"]
}
container_concurrency = %s
}
}
`, name, project, concurrency)
}

0 comments on commit 560603f

Please sign in to comment.