mirror of
https://github.com/ansible-collections/google.cloud.git
synced 2025-07-29 08:01:31 -07:00
fix: upgrade ansible version, address test and lint errors
This commit is contained in:
parent
c15b47250d
commit
08ada5354d
216 changed files with 4394 additions and 4262 deletions
|
@ -13,18 +13,18 @@
|
|||
#
|
||||
# ----------------------------------------------------------------------------
|
||||
# Pre-test setup
|
||||
- name: delete a metric
|
||||
- name: Delete a metric
|
||||
google.cloud.gcp_logging_metric:
|
||||
name: "{{ resource_name }}"
|
||||
filter: resource.type=gae_app AND severity>=ERROR
|
||||
metric_descriptor:
|
||||
metric_kind: DELTA
|
||||
value_type: DISTRIBUTION
|
||||
unit: '1'
|
||||
unit: "1"
|
||||
labels:
|
||||
- key: mass
|
||||
value_type: STRING
|
||||
description: amount of matter
|
||||
- key: mass
|
||||
value_type: STRING
|
||||
description: amount of matter
|
||||
value_extractor: EXTRACT(jsonPayload.request)
|
||||
label_extractors:
|
||||
mass: EXTRACT(jsonPayload.request)
|
||||
|
@ -38,18 +38,18 @@
|
|||
service_account_file: "{{ gcp_cred_file | default(omit) }}"
|
||||
state: absent
|
||||
#----------------------------------------------------------
|
||||
- name: create a metric
|
||||
- name: Create a metric
|
||||
google.cloud.gcp_logging_metric:
|
||||
name: "{{ resource_name }}"
|
||||
filter: resource.type=gae_app AND severity>=ERROR
|
||||
metric_descriptor:
|
||||
metric_kind: DELTA
|
||||
value_type: DISTRIBUTION
|
||||
unit: '1'
|
||||
unit: "1"
|
||||
labels:
|
||||
- key: mass
|
||||
value_type: STRING
|
||||
description: amount of matter
|
||||
- key: mass
|
||||
value_type: STRING
|
||||
description: amount of matter
|
||||
value_extractor: EXTRACT(jsonPayload.request)
|
||||
label_extractors:
|
||||
mass: EXTRACT(jsonPayload.request)
|
||||
|
@ -63,35 +63,35 @@
|
|||
service_account_file: "{{ gcp_cred_file | default(omit) }}"
|
||||
state: present
|
||||
register: result
|
||||
- name: assert changed is true
|
||||
assert:
|
||||
- name: Assert changed is true
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- result.changed == true
|
||||
- name: verify that metric was created
|
||||
- name: Verify that metric was created
|
||||
google.cloud.gcp_logging_metric_info:
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file | default(omit) }}"
|
||||
scopes:
|
||||
- https://www.googleapis.com/auth/cloud-platform
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file | default(omit) }}"
|
||||
scopes:
|
||||
- https://www.googleapis.com/auth/cloud-platform
|
||||
register: results
|
||||
- name: verify that command succeeded
|
||||
assert:
|
||||
- name: Verify that command succeeded
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- results['resources'] | map(attribute='name') | select("match", ".*{{ resource_name }}.*") | list | length == 1
|
||||
# ----------------------------------------------------------------------------
|
||||
- name: create a metric that already exists
|
||||
- name: Create a metric that already exists
|
||||
google.cloud.gcp_logging_metric:
|
||||
name: "{{ resource_name }}"
|
||||
filter: resource.type=gae_app AND severity>=ERROR
|
||||
metric_descriptor:
|
||||
metric_kind: DELTA
|
||||
value_type: DISTRIBUTION
|
||||
unit: '1'
|
||||
unit: "1"
|
||||
labels:
|
||||
- key: mass
|
||||
value_type: STRING
|
||||
description: amount of matter
|
||||
- key: mass
|
||||
value_type: STRING
|
||||
description: amount of matter
|
||||
value_extractor: EXTRACT(jsonPayload.request)
|
||||
label_extractors:
|
||||
mass: EXTRACT(jsonPayload.request)
|
||||
|
@ -105,23 +105,23 @@
|
|||
service_account_file: "{{ gcp_cred_file | default(omit) }}"
|
||||
state: present
|
||||
register: result
|
||||
- name: assert changed is false
|
||||
assert:
|
||||
- name: Assert changed is false
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- result.changed == false
|
||||
#----------------------------------------------------------
|
||||
- name: delete a metric
|
||||
- name: Delete a metric
|
||||
google.cloud.gcp_logging_metric:
|
||||
name: "{{ resource_name }}"
|
||||
filter: resource.type=gae_app AND severity>=ERROR
|
||||
metric_descriptor:
|
||||
metric_kind: DELTA
|
||||
value_type: DISTRIBUTION
|
||||
unit: '1'
|
||||
unit: "1"
|
||||
labels:
|
||||
- key: mass
|
||||
value_type: STRING
|
||||
description: amount of matter
|
||||
- key: mass
|
||||
value_type: STRING
|
||||
description: amount of matter
|
||||
value_extractor: EXTRACT(jsonPayload.request)
|
||||
label_extractors:
|
||||
mass: EXTRACT(jsonPayload.request)
|
||||
|
@ -135,35 +135,35 @@
|
|||
service_account_file: "{{ gcp_cred_file | default(omit) }}"
|
||||
state: absent
|
||||
register: result
|
||||
- name: assert changed is true
|
||||
assert:
|
||||
- name: Assert changed is true
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- result.changed == true
|
||||
- name: verify that metric was deleted
|
||||
- name: Verify that metric was deleted
|
||||
google.cloud.gcp_logging_metric_info:
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file | default(omit) }}"
|
||||
scopes:
|
||||
- https://www.googleapis.com/auth/cloud-platform
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file | default(omit) }}"
|
||||
scopes:
|
||||
- https://www.googleapis.com/auth/cloud-platform
|
||||
register: results
|
||||
- name: verify that command succeeded
|
||||
assert:
|
||||
- name: Verify that command succeeded
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- results['resources'] | map(attribute='name') | select("match", ".*{{ resource_name }}.*") | list | length == 0
|
||||
# ----------------------------------------------------------------------------
|
||||
- name: delete a metric that does not exist
|
||||
- name: Delete a metric that does not exist
|
||||
google.cloud.gcp_logging_metric:
|
||||
name: "{{ resource_name }}"
|
||||
filter: resource.type=gae_app AND severity>=ERROR
|
||||
metric_descriptor:
|
||||
metric_kind: DELTA
|
||||
value_type: DISTRIBUTION
|
||||
unit: '1'
|
||||
unit: "1"
|
||||
labels:
|
||||
- key: mass
|
||||
value_type: STRING
|
||||
description: amount of matter
|
||||
- key: mass
|
||||
value_type: STRING
|
||||
description: amount of matter
|
||||
value_extractor: EXTRACT(jsonPayload.request)
|
||||
label_extractors:
|
||||
mass: EXTRACT(jsonPayload.request)
|
||||
|
@ -177,7 +177,7 @@
|
|||
service_account_file: "{{ gcp_cred_file | default(omit) }}"
|
||||
state: absent
|
||||
register: result
|
||||
- name: assert changed is false
|
||||
assert:
|
||||
- name: Assert changed is false
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- result.changed == false
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
---
|
||||
- include_tasks: autogen.yml
|
||||
- name: Generated tests
|
||||
ansible.builtin.include_tasks: autogen.yml
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue