fix: upgrade ansible version, address test and lint errors

This commit is contained in:
Chris Hawk 2023-11-17 16:39:42 -08:00
commit 08ada5354d
216 changed files with 4394 additions and 4262 deletions

View file

@ -13,7 +13,7 @@
#
# ----------------------------------------------------------------------------
# Pre-test setup
- name: create a instance
- name: Create a instance
google.cloud.gcp_spanner_instance:
name: instance-database
display_name: My Spanner Instance
@ -26,7 +26,7 @@
service_account_file: "{{ gcp_cred_file | default(omit) }}"
state: present
register: instance
- name: delete a database
- name: Delete a database
google.cloud.gcp_spanner_database:
name: webstore
instance: "{{ instance }}"
@ -35,7 +35,7 @@
service_account_file: "{{ gcp_cred_file | default(omit) }}"
state: absent
#----------------------------------------------------------
- name: create a database
- name: Create a database
google.cloud.gcp_spanner_database:
name: webstore
instance: "{{ instance }}"
@ -44,8 +44,8 @@
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 database was created
@ -62,7 +62,7 @@
# that:
# - results['resources'] | map(attribute='name') | select("match", ".*webstore.*") | list | length == 1
# ----------------------------------------------------------------------------
- name: create a database that already exists
- name: Create a database that already exists
google.cloud.gcp_spanner_database:
name: webstore
instance: "{{ instance }}"
@ -71,12 +71,12 @@
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 database
- name: Delete a database
google.cloud.gcp_spanner_database:
name: webstore
instance: "{{ instance }}"
@ -85,8 +85,8 @@
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
# commented out due to a flakey List endpoint
@ -107,7 +107,7 @@
# that:
# - results['resources'] | map(attribute='name') | select("match", ".*webstore.*") | list | length == 0
# ----------------------------------------------------------------------------
- name: delete a database that does not exist
- name: Delete a database that does not exist
google.cloud.gcp_spanner_database:
name: webstore
instance: "{{ instance }}"
@ -116,14 +116,14 @@
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
#---------------------------------------------------------
# Post-test teardown
# If errors happen, don't crash the playbook!
- name: delete a instance
- name: Delete a instance
google.cloud.gcp_spanner_instance:
name: instance-database
display_name: My Spanner Instance

View file

@ -1,2 +1,3 @@
---
- include_tasks: autogen.yml
- name: Generated tests
ansible.builtin.include_tasks: autogen.yml