Port stable 1 ci changes (#423)

* Add changes from stable-1 integrations tests (PR 418)

* Refactor to use connectors' info declared in setup_mysql

* Fix 2nd replication stop marked changed by mysqlclient
This commit is contained in:
Laurent Indermühle 2022-08-16 09:15:50 +02:00 committed by GitHub
commit 61586ae4cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 61 additions and 38 deletions

View file

@ -55,12 +55,12 @@
- assert:
that:
- result is failed
when: connector.name.0 is search('pymysql')
when: connector_name is search('pymysql')
- assert:
that:
- result is succeeded
when: connector.name.0 is not search('pymysql')
when: connector_name is not search('pymysql')
- name: attempt connection with newly created user ignoring hostname
mysql_replication:

View file

@ -184,8 +184,8 @@
shell: "echo \"INSERT INTO {{ test_table }} (id) VALUES (1), (2), (3); FLUSH LOGS;\" | {{ mysql_command }} -P{{ mysql_primary_port }} {{ test_db }}"
- name: Small pause to be sure the bin log, which was flushed previously, reached the replica
pause:
seconds: 2
ansible.builtin.wait_for:
timeout: 2
# Test primary log pos has been changed:
- name: Get replica status
@ -218,10 +218,12 @@
fail_on_error: true
register: result
# mysqlclient 2.0.1 always return "changed"
- assert:
that:
- result is not changed
when: (pymysql_version.stdout | default('1000', true)) is version('0.9.3', '<=')
- result is not changed
when:
- connector_name == 'pymysql'
# Test stopreplica mode:
- name: Stop replica
@ -236,7 +238,12 @@
- result is changed
- result.queries == ["STOP SLAVE"] or result.queries == ["STOP REPLICA"]
- name: Pause for 2 seconds to let the replication stop
ansible.builtin.wait_for:
timeout: 2
# Test stopreplica mode:
# mysqlclient 2.0.1 always return "changed"
- name: Stop replica that is no longer running
mysql_replication:
<<: *mysql_params
@ -247,8 +254,9 @@
- assert:
that:
- result is not changed
when: (pymysql_version.stdout | default('1000', true)) is version('0.9.3', '<=')
- result is not changed
when:
- connector_name == 'pymysql'
# master / slave related choices were removed in 3.0.0
# https://github.com/ansible-collections/community.mysql/pull/252