Skip to content

Commit 59b6163

Browse files
authored
chore: update tests to use blueprint test framework (#70)
* chore: update tests to use blueprint test framework * keep sa
1 parent e94ccfb commit 59b6163

File tree

19 files changed

+795
-153
lines changed

19 files changed

+795
-153
lines changed

.kitchen.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# Make will use bash instead of sh
1919
SHELL := /usr/bin/env bash
2020

21-
DOCKER_TAG_VERSION_DEVELOPER_TOOLS := 1.0
21+
DOCKER_TAG_VERSION_DEVELOPER_TOOLS := 1.4
2222
DOCKER_IMAGE_DEVELOPER_TOOLS := cft/developer-tools
2323
REGISTRY_URL := gcr.io/cloud-foundation-cicd
2424

build/int.cloudbuild.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@ steps:
2323
- 'TF_VAR_billing_account=$_BILLING_ACCOUNT'
2424
- id: create
2525
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
26-
args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do create']
26+
args: ['/bin/bash', '-c', 'cft test run all --stage init --verbose']
2727
- id: converge
2828
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
29-
args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do converge']
29+
args: ['/bin/bash', '-c', 'cft test run all --stage apply --verbose']
3030
- id: verify
3131
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
32-
args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do verify']
32+
args: ['/bin/bash', '-c', 'cft test run all --stage verify --verbose']
3333
- id: destroy
3434
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
35-
args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do destroy']
35+
args: ['/bin/bash', '-c', 'cft test run all --stage teardown --verbose']
3636
tags:
3737
- 'ci'
3838
- 'integration'
3939
substitutions:
4040
_DOCKER_IMAGE_DEVELOPER_TOOLS: 'cft/developer-tools'
41-
_DOCKER_TAG_VERSION_DEVELOPER_TOOLS: '1.0'
41+
_DOCKER_TAG_VERSION_DEVELOPER_TOOLS: '1.4'

build/lint.cloudbuild.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ tags:
2121
- 'lint'
2222
substitutions:
2323
_DOCKER_IMAGE_DEVELOPER_TOOLS: 'cft/developer-tools'
24-
_DOCKER_TAG_VERSION_DEVELOPER_TOOLS: '1.0'
24+
_DOCKER_TAG_VERSION_DEVELOPER_TOOLS: '1.4'
Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2021 Google LLC
1+
# Copyright 2022 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -12,15 +12,9 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
name: pubsub_scheduled
16-
depends:
17-
- name: inspec-gcp
18-
git: https://github.com/inspec/inspec-gcp.git
19-
tag: v0.10.0
20-
attributes:
21-
- name: project_id
22-
required: true
23-
type: string
24-
- name: name
25-
required: true
26-
type: string
15+
apiVersion: blueprints.cloud.google.com/v1alpha1
16+
kind: BlueprintTest
17+
metadata:
18+
name: logs-slack-alerts
19+
spec:
20+
skip: true

examples/pubsub_scheduled/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ More information is in the [root readme](../../README.md#app-engine).
1111
| Name | Description | Type | Default | Required |
1212
|------|-------------|------|---------|:--------:|
1313
| project\_id | The project ID to host the network in | `string` | n/a | yes |
14-
| region | The region the project is in (App Engine specific) | `string` | `"us-central1"` | no |
1514

1615
## Outputs
1716

examples/pubsub_scheduled/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ module "pubsub_scheduled_example" {
2727
function_entry_point = "doSomething"
2828
function_source_directory = "${path.module}/function_source"
2929
function_name = "testfunction-${random_pet.main.id}"
30-
region = var.region
30+
region = "us-central1"
3131
topic_name = "pubsub_example_topic_${random_pet.main.id}"
3232
}

examples/pubsub_scheduled/variables.tf

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,3 @@ variable "project_id" {
1919
description = "The project ID to host the network in"
2020
}
2121

22-
variable "region" {
23-
type = string
24-
description = "The region the project is in (App Engine specific)"
25-
default = "us-central1"
26-
}

examples/pubsub_scheduled_multiple/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,5 @@ More information is in the [root readme](../../README.md#app-engine).
1919
|------|-------------|
2020
| name | The name of the job created |
2121
| project\_id | The project ID |
22-
| scheduler\_job | An existing Cloud Scheduler job instance |
2322

2423
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

examples/pubsub_scheduled_multiple/outputs.tf

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,3 @@ output "project_id" {
2323
value = var.project_id
2424
description = "The project ID"
2525
}
26-
27-
output "scheduler_job" {
28-
value = module.pubsub_scheduled_1.scheduler_job
29-
description = "An existing Cloud Scheduler job instance"
30-
}
31-

0 commit comments

Comments
 (0)