From 73ee8f07c9251e1453a9c5f00a9791c8a06d33a7 Mon Sep 17 00:00:00 2001 From: Laurent Indermuehle Date: Tue, 17 Jan 2023 13:29:03 +0100 Subject: [PATCH] Add filter for issues resolved in newer version of mysqlclient --- .../tasks/mysql_query_initial.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tests/integration/targets/test_mysql_query/tasks/mysql_query_initial.yml b/tests/integration/targets/test_mysql_query/tasks/mysql_query_initial.yml index e8a85d8..129ab9a 100644 --- a/tests/integration/targets/test_mysql_query/tasks/mysql_query_initial.yml +++ b/tests/integration/targets/test_mysql_query/tasks/mysql_query_initial.yml @@ -339,22 +339,27 @@ register: result # Issue https://github.com/ansible-collections/community.mysql/issues/268 - - assert: + - name: "Assert that create table IF NOT EXISTS is not changed with pymysql \ + and mysqlclient > 2.0.1" + assert: that: # PyMySQL driver throws a warning, so the following is correct - result is not changed when: - connector_name == 'pymysql' + or (connector_name == 'mysqlclient' and connector_ver is version('2.0.1', '>')) # Issue https://github.com/ansible-collections/community.mysql/issues/268 - - assert: + - name: Assert that create table IF NOT EXISTS is changed with mysqlclient <=2.0.1 + assert: that: - # mysqlclient driver throws nothing, so it's impossible to figure out - # if the state was changed or not. - # We assume that it was for DDL queryes by default in the code + # Before mysqlclient 2.0.3, driver throws nothing, 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 - result is changed when: - connector_name == 'mysqlclient' + - connector_ver is version('2.0.1', '<=') - name: Drop db {{ test_db }} mysql_query: