From fcd6be97338c1b27152eee886f78e36ee1085f32 Mon Sep 17 00:00:00 2001 From: Julio Castillo Date: Fri, 14 Jan 2022 14:25:00 +0100 Subject: [PATCH] Fix gcs_to_bq_with_dataflow tests --- .../gcs-to-bq-with-dataflow/variables.tf | 1 + .../gcs_to_bq_with_dataflow/fixture/main.tf | 12 +++++---- .../fixture/variables.tf | 25 +++++++++---------- .../gcs_to_bq_with_dataflow/test_plan.py | 4 +-- 4 files changed, 22 insertions(+), 20 deletions(-) diff --git a/examples/data-solutions/gcs-to-bq-with-dataflow/variables.tf b/examples/data-solutions/gcs-to-bq-with-dataflow/variables.tf index 78a6f4bf..55b04b38 100644 --- a/examples/data-solutions/gcs-to-bq-with-dataflow/variables.tf +++ b/examples/data-solutions/gcs-to-bq-with-dataflow/variables.tf @@ -16,6 +16,7 @@ variable "prefix" { description = "Unique prefix used for resource names. Not used for project if 'project_create' is null." type = string + default = null } variable "project_create" { diff --git a/tests/examples/data_solutions/gcs_to_bq_with_dataflow/fixture/main.tf b/tests/examples/data_solutions/gcs_to_bq_with_dataflow/fixture/main.tf index 9f6d72c8..51397d9f 100644 --- a/tests/examples/data_solutions/gcs_to_bq_with_dataflow/fixture/main.tf +++ b/tests/examples/data_solutions/gcs_to_bq_with_dataflow/fixture/main.tf @@ -15,9 +15,11 @@ */ module "test" { - source = "../../../../../examples/data-solutions/gcs-to-bq-with-dataflow/" - billing_account = var.billing_account - project_kms_name = var.project_kms_name - project_service_name = var.project_service_name - root_node = var.root_node + source = "../../../../../examples/data-solutions/gcs-to-bq-with-dataflow/" + prefix = var.prefix + project_id = var.project_id + project_create = { + billing_account_id = var.billing_account_id + parent = var.parent + } } diff --git a/tests/examples/data_solutions/gcs_to_bq_with_dataflow/fixture/variables.tf b/tests/examples/data_solutions/gcs_to_bq_with_dataflow/fixture/variables.tf index 53157297..89ad9081 100644 --- a/tests/examples/data_solutions/gcs_to_bq_with_dataflow/fixture/variables.tf +++ b/tests/examples/data_solutions/gcs_to_bq_with_dataflow/fixture/variables.tf @@ -14,23 +14,22 @@ * limitations under the License. */ -variable "billing_account" { - type = string - default = "123456-123456-123456" +variable "billing_account_id" { + default = "012345-678901-234567" } -variable "root_node" { - description = "The resource name of the parent Folder or Organization. Must be of the form folders/folder_id or organizations/org_id." - type = string - default = "folders/12345678" +variable "parent" { + default = "folders/01234567890" } -variable "project_service_name" { - type = string - default = "project-srv" +variable "prefix" { + default = "fabric" } -variable "project_kms_name" { - type = string - default = "project-kms" +variable "project_id" { + default = "gcs-to-bq" +} + +variable "region" { + default = "europe-west1" } diff --git a/tests/examples/data_solutions/gcs_to_bq_with_dataflow/test_plan.py b/tests/examples/data_solutions/gcs_to_bq_with_dataflow/test_plan.py index 6bf52ab3..39bf3d04 100644 --- a/tests/examples/data_solutions/gcs_to_bq_with_dataflow/test_plan.py +++ b/tests/examples/data_solutions/gcs_to_bq_with_dataflow/test_plan.py @@ -15,5 +15,5 @@ def test_resources(e2e_plan_runner): "Test that plan works and the numbers of resources is as expected." modules, resources = e2e_plan_runner() - assert len(modules) == 14 - assert len(resources) == 61 + assert len(modules) == 12 + assert len(resources) == 57