Skip to content

Commit

Permalink
Make TestAccCloudRunV2Job_cloudrunv2JobRunJobExample test beta-only (
Browse files Browse the repository at this point in the history
#11114) (#18690)

[upstream:ed5ea59cbf5a8cf9ed189a5d24e16b1d595d24da]

Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored Jul 10, 2024
1 parent aa24070 commit 12f3731
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 42 deletions.
3 changes: 3 additions & 0 deletions .changelog/11114.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:none

```
Original file line number Diff line number Diff line change
Expand Up @@ -428,48 +428,6 @@ resource "google_secret_manager_secret_iam_member" "secret-access" {
`, context)
}

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

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

acctest.VcrTest(t, resource.TestCase{
PreCheck: func() { acctest.AccTestPreCheck(t) },
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
CheckDestroy: testAccCheckCloudRunV2JobDestroyProducer(t),
Steps: []resource.TestStep{
{
Config: testAccCloudRunV2Job_cloudrunv2JobRunJobExample(context),
},
{
ResourceName: "google_cloud_run_v2_job.default",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"annotations", "labels", "location", "name", "terraform_labels"},
},
},
})
}

func testAccCloudRunV2Job_cloudrunv2JobRunJobExample(context map[string]interface{}) string {
return acctest.Nprintf(`
resource "google_cloud_run_v2_job" "default" {
name = "tf-test-cloudrun-job%{random_suffix}"
location = "us-central1"
start_execution_token = "start-once-created"
template {
template {
containers {
image = "us-docker.pkg.dev/cloudrun/container/job"
}
}
}
}
`, context)
}

func testAccCheckCloudRunV2JobDestroyProducer(t *testing.T) func(s *terraform.State) error {
return func(s *terraform.State) error {
for name, rs := range s.RootModule().Resources {
Expand Down
1 change: 1 addition & 0 deletions website/docs/r/cloud_run_v2_job.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ resource "google_cloud_run_v2_job" "default" {

```hcl
resource "google_cloud_run_v2_job" "default" {
provider = google-beta
name = "cloudrun-job"
location = "us-central1"
start_execution_token = "start-once-created"
Expand Down

0 comments on commit 12f3731

Please sign in to comment.