mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-08-03 04:34:27 -07:00
Disable tests for pymysql newer than 0.10.0 because the behavior changed
This commit is contained in:
parent
05a986df1a
commit
54f5805798
2 changed files with 14 additions and 6 deletions
|
@ -363,21 +363,27 @@
|
||||||
- name: Assert that create table IF NOT EXISTS is not changed with pymysql
|
- name: Assert that create table IF NOT EXISTS is not changed with pymysql
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
# PyMySQL driver throws a warning, so the following is correct
|
# PyMySQL driver throws a warning for version before 0.10.0
|
||||||
- result is not changed
|
- result is not changed
|
||||||
when:
|
when:
|
||||||
- connector_name == 'pymysql'
|
- connector_name == 'pymysql'
|
||||||
|
- connector_version is version('0.10.0', '<')
|
||||||
|
|
||||||
# Issue https://github.com/ansible-collections/community.mysql/issues/268
|
# Issue https://github.com/ansible-collections/community.mysql/issues/268
|
||||||
- name: Assert that create table IF NOT EXISTS is changed with mysqlclient
|
- name: Assert that create table IF NOT EXISTS is changed with mysqlclient
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
# Mysqlclient 2.0.1, driver throws nothing with mysql, so it's
|
# Mysqlclient 2.0.1 and pymysql 0.10.0+ drivers throws no warning,
|
||||||
# impossible to figure out if the state was changed or not.
|
# so it's impossible to figure out if the state was changed or not.
|
||||||
# We assume that it was for DDL queries by default in the code
|
# We assume that it was for DDL queries by default in the code
|
||||||
- result is changed
|
- result is changed
|
||||||
when:
|
when:
|
||||||
- connector_name == 'mysqlclient'
|
- >
|
||||||
|
connector_name == 'mysqlclient'
|
||||||
|
or (
|
||||||
|
connector_name == 'pymysql'
|
||||||
|
and connector_version is version('0.10.0', '>')
|
||||||
|
)
|
||||||
|
|
||||||
- name: Drop db {{ test_db }}
|
- name: Drop db {{ test_db }}
|
||||||
mysql_query:
|
mysql_query:
|
||||||
|
|
|
@ -247,13 +247,14 @@
|
||||||
fail_on_error: true
|
fail_on_error: true
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
# mysqlclient 2.0.1 always return "changed"
|
# mysqlclient 2.0.1 and pymysql 0.10.0+ always return "changed"
|
||||||
- name: Assert that startreplica is not changed
|
- name: Assert that startreplica is not changed
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- result is not changed
|
- result is not changed
|
||||||
when:
|
when:
|
||||||
- connector_name == 'pymysql'
|
- connector_name == 'pymysql'
|
||||||
|
- connector_version is version('0.10.0', '<')
|
||||||
|
|
||||||
# Test stopreplica mode:
|
# Test stopreplica mode:
|
||||||
- name: Stop replica
|
- name: Stop replica
|
||||||
|
@ -274,7 +275,7 @@
|
||||||
timeout: 2
|
timeout: 2
|
||||||
|
|
||||||
# Test stopreplica mode:
|
# Test stopreplica mode:
|
||||||
# mysqlclient 2.0.1 always return "changed"
|
# mysqlclient 2.0.1 and pymysql 0.10.0+ always return "changed"
|
||||||
- name: Stop replica that is no longer running
|
- name: Stop replica that is no longer running
|
||||||
mysql_replication:
|
mysql_replication:
|
||||||
<<: *mysql_params
|
<<: *mysql_params
|
||||||
|
@ -289,6 +290,7 @@
|
||||||
- result is not changed
|
- result is not changed
|
||||||
when:
|
when:
|
||||||
- connector_name == 'pymysql'
|
- connector_name == 'pymysql'
|
||||||
|
- connector_version is version('0.10.0', '<')
|
||||||
|
|
||||||
# master / slave related choices were removed in 3.0.0
|
# master / slave related choices were removed in 3.0.0
|
||||||
# https://github.com/ansible-collections/community.mysql/pull/252
|
# https://github.com/ansible-collections/community.mysql/pull/252
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue