Skip to content

Commit bff9ef1

Browse files
Fix the failing tests TestAccBigQueryJob_bigqueryJobCopy* (#10520) (#7297)
[upstream:a63881aee1ba6d956d3d79d2b7e70bf0fda64f02] Signed-off-by: Modular Magician <[email protected]>
1 parent 3ce786d commit bff9ef1

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

google-beta/services/bigquery/resource_bigquery_job_generated_test.go

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -490,9 +490,13 @@ func TestAccBigQueryJob_bigqueryJobCopyExample(t *testing.T) {
490490

491491
func testAccBigQueryJob_bigqueryJobCopyExample(context map[string]interface{}) string {
492492
return acctest.Nprintf(`
493+
locals {
494+
count = 2
495+
}
496+
493497
resource "google_bigquery_table" "source" {
494498
deletion_protection = false
495-
count = length(google_bigquery_dataset.source)
499+
count = local.count
496500
497501
dataset_id = google_bigquery_dataset.source[count.index].dataset_id
498502
table_id = "tf_test_job_copy%{random_suffix}_${count.index}_table"
@@ -519,7 +523,7 @@ EOF
519523
}
520524
521525
resource "google_bigquery_dataset" "source" {
522-
count = 2
526+
count = local.count
523527
524528
dataset_id = "tf_test_job_copy%{random_suffix}_${count.index}_dataset"
525529
friendly_name = "test"
@@ -645,9 +649,13 @@ func TestAccBigQueryJob_bigqueryJobCopyTableReferenceExample(t *testing.T) {
645649

646650
func testAccBigQueryJob_bigqueryJobCopyTableReferenceExample(context map[string]interface{}) string {
647651
return acctest.Nprintf(`
652+
locals {
653+
count = 2
654+
}
655+
648656
resource "google_bigquery_table" "source" {
649657
deletion_protection = false
650-
count = length(google_bigquery_dataset.source)
658+
count = local.count
651659
652660
dataset_id = google_bigquery_dataset.source[count.index].dataset_id
653661
table_id = "tf_test_job_copy%{random_suffix}_${count.index}_table"
@@ -671,10 +679,12 @@ resource "google_bigquery_table" "source" {
671679
}
672680
]
673681
EOF
682+
683+
depends_on = [google_bigquery_dataset.source]
674684
}
675685
676686
resource "google_bigquery_dataset" "source" {
677-
count = 2
687+
count = local.count
678688
679689
dataset_id = "tf_test_job_copy%{random_suffix}_${count.index}_dataset"
680690
friendly_name = "test"

website/docs/r/bigquery_job.html.markdown

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,9 +304,13 @@ resource "google_bigquery_job" "job" {
304304

305305

306306
```hcl
307+
locals {
308+
count = 2
309+
}
310+
307311
resource "google_bigquery_table" "source" {
308312
deletion_protection = false
309-
count = length(google_bigquery_dataset.source)
313+
count = local.count
310314
311315
dataset_id = google_bigquery_dataset.source[count.index].dataset_id
312316
table_id = "job_copy_${count.index}_table"
@@ -333,7 +337,7 @@ EOF
333337
}
334338
335339
resource "google_bigquery_dataset" "source" {
336-
count = 2
340+
count = local.count
337341
338342
dataset_id = "job_copy_${count.index}_dataset"
339343
friendly_name = "test"

0 commit comments

Comments
 (0)