Add integrations tests

This commit is contained in:
Laurent Indermuehle 2024-11-15 16:55:47 +01:00
parent 9cf17827d2
commit 32e6e9e8c1
No known key found for this signature in database
GPG key ID: 93FA944C9F34DD09

View file

@ -36,33 +36,62 @@
# ================================== Tests ============================== # ================================== Tests ==============================
- name: Mysql_info users_info | Collect all databases fields - name: Mysql_info users_info | Collect all non-empty databases fields
community.mysql.mysql_info: community.mysql.mysql_info:
filter: filter:
- databases - databases
register: result register: result
# failed_when: failed_when:
# - TODO - >
result.databases['db_tables_count_1'].size != 16384 or
result.databases['db_tables_count_1'].tables != 1 or
result.databases['db_tables_count_2'].size != 32768 or
result.databases['db_tables_count_2'].tables != 2 or
'db_tables_count_empty' in result.databases | dict2items
| map(attribute='key')
- name: Mysql_info users_info | Collect all databases fields except db_size - name: Mysql_info users_info | Collect all databases fields except db_size
community.mysql.mysql_info: community.mysql.mysql_info:
filter: filter:
- databases - databases
exclude_fileds: exclude_fields:
- db_size - db_size
register: result register: result
# failed_when: failed_when:
# - TODO - >
result.databases['db_tables_count_1'].size is defined or
result.databases['db_tables_count_2'].size is defined or
'db_tables_count_empty' in result.databases | dict2items
| map(attribute='key')
- name: Mysql_info users_info | Collect all databases fields except db_table_count - name: Mysql_info users_info | Collect all databases fields except tables
community.mysql.mysql_info: community.mysql.mysql_info:
filter: filter:
- databases - databases
exclude_fileds: exclude_fields:
- db_table_count - db_table_count
register: result register: result
# failed_when: failed_when:
# - TODO - >
result.databases['db_tables_count_1'].tables is defined or
result.databases['db_tables_count_2'].tables is defined or
'db_tables_count_empty' in result.databases | dict2items
| map(attribute='key')
- name: Mysql_info users_info | Collect all databases even empty ones
community.mysql.mysql_info:
filter:
- databases
return_empty_dbs: true
register: result
failed_when:
- >
result.databases['db_tables_count_1'].size != 16384 or
result.databases['db_tables_count_1'].tables != 1 or
result.databases['db_tables_count_2'].size != 32768 or
result.databases['db_tables_count_2'].tables != 2 or
result.databases['db_tables_count_empty'].size != 0 or
result.databases['db_tables_count_empty'].tables != 0
# ================================== Cleanup ============================ # ================================== Cleanup ============================