From b21c57d193d601ec096d17eb3fdfc8469b7f407a Mon Sep 17 00:00:00 2001 From: Christoph Grotz Date: Fri, 24 Feb 2023 17:41:53 +0000 Subject: [PATCH] moved to new test style --- .../networking/psc-glb-and-armor/README.md | 14 ++++++++ .../networking/psc-glb-and-armor/__init__.py | 13 -------- .../psc-glb-and-armor/fixture/main.tf | 21 ------------ .../psc-glb-and-armor/fixture/variables.tf | 33 ------------------- .../networking/psc-glb-and-armor/test_plan.py | 19 ----------- 5 files changed, 14 insertions(+), 86 deletions(-) delete mode 100644 tests/blueprints/networking/psc-glb-and-armor/__init__.py delete mode 100644 tests/blueprints/networking/psc-glb-and-armor/fixture/main.tf delete mode 100644 tests/blueprints/networking/psc-glb-and-armor/fixture/variables.tf delete mode 100644 tests/blueprints/networking/psc-glb-and-armor/test_plan.py diff --git a/blueprints/networking/psc-glb-and-armor/README.md b/blueprints/networking/psc-glb-and-armor/README.md index 11df26e5..e0d99641 100644 --- a/blueprints/networking/psc-glb-and-armor/README.md +++ b/blueprints/networking/psc-glb-and-armor/README.md @@ -107,3 +107,17 @@ The above command will delete the associated resources so there will be no billa | [zone](variables.tf#L45) | The GCP zone for the VM. | | | europe-west1-b | + + +## Test + +```hcl +module "psc-glb-and-armor-test" { + source = "./fabric/blueprints/networking/psc-glb-and-armor" + prefix = "test" + project_create = true + consumer_project_id = "project-1" + producer_project_id = "project-2" +} +# tftest modules=3 resources=31 +``` diff --git a/tests/blueprints/networking/psc-glb-and-armor/__init__.py b/tests/blueprints/networking/psc-glb-and-armor/__init__.py deleted file mode 100644 index 6d6d1266..00000000 --- a/tests/blueprints/networking/psc-glb-and-armor/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. diff --git a/tests/blueprints/networking/psc-glb-and-armor/fixture/main.tf b/tests/blueprints/networking/psc-glb-and-armor/fixture/main.tf deleted file mode 100644 index 0a19401a..00000000 --- a/tests/blueprints/networking/psc-glb-and-armor/fixture/main.tf +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -module "test" { - source = "../../../../../blueprints/networking/psc-glb-and-armor" - prefix = var.prefix - project_create = var.project_create - consumer_project_id = var.consumer_project_id - producer_project_id = var.producer_project_id -} diff --git a/tests/blueprints/networking/psc-glb-and-armor/fixture/variables.tf b/tests/blueprints/networking/psc-glb-and-armor/fixture/variables.tf deleted file mode 100644 index 5165531d..00000000 --- a/tests/blueprints/networking/psc-glb-and-armor/fixture/variables.tf +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -variable "producer_project_id" { - type = string - default = "project-1" -} - -variable "consumer_project_id" { - type = string - default = "project-2" -} - -variable "prefix" { - type = string - default = "test" -} - -variable "project_create" { - type = bool - default = true -} diff --git a/tests/blueprints/networking/psc-glb-and-armor/test_plan.py b/tests/blueprints/networking/psc-glb-and-armor/test_plan.py deleted file mode 100644 index 9bc8ff46..00000000 --- a/tests/blueprints/networking/psc-glb-and-armor/test_plan.py +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -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) == 2 - assert len(resources) == 7