Replace DP example tests with the new one.
This commit is contained in:
parent
577fbf1cc3
commit
30b18374fb
|
@ -14,13 +14,12 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
module "test-environment" {
|
module "test" {
|
||||||
source = "../../../../../examples/data-solutions/data-platform-foundations/01-environment"
|
source = "../../../../../examples/data-solutions/dp-foundation/"
|
||||||
billing_account_id = var.billing_account
|
organization = { domain : "example.com" }
|
||||||
root_node = var.root_node
|
project_create = {
|
||||||
}
|
billing_account_id = "123456-123456-123456"
|
||||||
|
parent = "folders/12345678"
|
||||||
module "test-resources" {
|
}
|
||||||
source = "../../../../../examples/data-solutions/data-platform-foundations/02-resources"
|
prefix = "prefix"
|
||||||
project_ids = module.test-environment.project_ids
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,13 +14,27 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
variable "billing_account" {
|
variable "organization" {
|
||||||
type = string
|
type = object({
|
||||||
default = "123456-123456-123456"
|
domain = string
|
||||||
|
})
|
||||||
|
default = {
|
||||||
|
domain = "example.com"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "root_node" {
|
variable "prefix" {
|
||||||
description = "The resource name of the parent Folder or Organization. Must be of the form folders/folder_id or organizations/org_id."
|
type = string
|
||||||
type = string
|
default = "prefix"
|
||||||
default = "folders/12345678"
|
}
|
||||||
|
|
||||||
|
variable "project_create" {
|
||||||
|
type = object({
|
||||||
|
billing_account_id = string
|
||||||
|
parent = string
|
||||||
|
})
|
||||||
|
default = {
|
||||||
|
billing_account_id = "123456-123456-123456"
|
||||||
|
parent = "folders/12345678"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,8 +12,16 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
|
||||||
|
import os
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
|
||||||
|
FIXTURES_DIR = os.path.join(os.path.dirname(__file__), 'fixture')
|
||||||
|
|
||||||
|
|
||||||
def test_resources(e2e_plan_runner):
|
def test_resources(e2e_plan_runner):
|
||||||
"Test that plan works and the numbers of resources is as expected."
|
"Test that plan works and the numbers of resources is as expected."
|
||||||
modules, resources = e2e_plan_runner()
|
modules, resources = e2e_plan_runner(FIXTURES_DIR)
|
||||||
assert len(modules) == 6
|
assert len(modules) == 37
|
||||||
assert len(resources) == 53
|
assert len(resources) == 280
|
||||||
|
|
|
@ -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.
|
|
|
@ -1,25 +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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
module "test" {
|
|
||||||
source = "../../../../../examples/data-solutions/dp-foundation/"
|
|
||||||
organization = { domain : "example.com" }
|
|
||||||
project_create = {
|
|
||||||
billing_account_id = "123456-123456-123456"
|
|
||||||
parent = "folders/12345678"
|
|
||||||
}
|
|
||||||
prefix = "prefix"
|
|
||||||
}
|
|
|
@ -1,40 +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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
variable "organization" {
|
|
||||||
type = object({
|
|
||||||
domain = string
|
|
||||||
})
|
|
||||||
default = {
|
|
||||||
domain = "example.com"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "prefix" {
|
|
||||||
type = string
|
|
||||||
default = "prefix"
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "project_create" {
|
|
||||||
type = object({
|
|
||||||
billing_account_id = string
|
|
||||||
parent = string
|
|
||||||
})
|
|
||||||
default = {
|
|
||||||
billing_account_id = "123456-123456-123456"
|
|
||||||
parent = "folders/12345678"
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,27 +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.
|
|
||||||
|
|
||||||
|
|
||||||
import os
|
|
||||||
import pytest
|
|
||||||
|
|
||||||
|
|
||||||
FIXTURES_DIR = os.path.join(os.path.dirname(__file__), 'fixture')
|
|
||||||
|
|
||||||
|
|
||||||
def test_resources(e2e_plan_runner):
|
|
||||||
"Test that plan works and the numbers of resources is as expected."
|
|
||||||
modules, resources = e2e_plan_runner(FIXTURES_DIR)
|
|
||||||
assert len(modules) == 37
|
|
||||||
assert len(resources) == 280
|
|
Loading…
Reference in New Issue