Skip to content

Commit

Permalink
Fix the failing tests TestAccBigQueryJob_bigqueryJobCopy* (#10520) (#…
Browse files Browse the repository at this point in the history
…17970)

[upstream:a63881aee1ba6d956d3d79d2b7e70bf0fda64f02]

Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored Apr 26, 2024
1 parent f358149 commit b21e8ec
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
18 changes: 14 additions & 4 deletions google/services/bigquery/resource_bigquery_job_generated_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -490,9 +490,13 @@ func TestAccBigQueryJob_bigqueryJobCopyExample(t *testing.T) {

func testAccBigQueryJob_bigqueryJobCopyExample(context map[string]interface{}) string {
return acctest.Nprintf(`
locals {
count = 2
}
resource "google_bigquery_table" "source" {
deletion_protection = false
count = length(google_bigquery_dataset.source)
count = local.count
dataset_id = google_bigquery_dataset.source[count.index].dataset_id
table_id = "tf_test_job_copy%{random_suffix}_${count.index}_table"
Expand All @@ -519,7 +523,7 @@ EOF
}
resource "google_bigquery_dataset" "source" {
count = 2
count = local.count
dataset_id = "tf_test_job_copy%{random_suffix}_${count.index}_dataset"
friendly_name = "test"
Expand Down Expand Up @@ -645,9 +649,13 @@ func TestAccBigQueryJob_bigqueryJobCopyTableReferenceExample(t *testing.T) {

func testAccBigQueryJob_bigqueryJobCopyTableReferenceExample(context map[string]interface{}) string {
return acctest.Nprintf(`
locals {
count = 2
}
resource "google_bigquery_table" "source" {
deletion_protection = false
count = length(google_bigquery_dataset.source)
count = local.count
dataset_id = google_bigquery_dataset.source[count.index].dataset_id
table_id = "tf_test_job_copy%{random_suffix}_${count.index}_table"
Expand All @@ -671,10 +679,12 @@ resource "google_bigquery_table" "source" {
}
]
EOF
depends_on = [google_bigquery_dataset.source]
}
resource "google_bigquery_dataset" "source" {
count = 2
count = local.count
dataset_id = "tf_test_job_copy%{random_suffix}_${count.index}_dataset"
friendly_name = "test"
Expand Down
8 changes: 6 additions & 2 deletions website/docs/r/bigquery_job.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,13 @@ resource "google_bigquery_job" "job" {


```hcl
locals {
count = 2
}
resource "google_bigquery_table" "source" {
deletion_protection = false
count = length(google_bigquery_dataset.source)
count = local.count
dataset_id = google_bigquery_dataset.source[count.index].dataset_id
table_id = "job_copy_${count.index}_table"
Expand All @@ -333,7 +337,7 @@ EOF
}
resource "google_bigquery_dataset" "source" {
count = 2
count = local.count
dataset_id = "job_copy_${count.index}_dataset"
friendly_name = "test"
Expand Down

0 comments on commit b21e8ec

Please sign in to comment.