Port stable 1 ci changes (#423) (#424)

* 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

(cherry picked from commit 61586ae4cc)
This commit is contained in:
Laurent Indermühle 2022-08-17 11:30:34 +02:00 committed by GitHub
commit 8968f51533
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 61 additions and 38 deletions

View file

@ -45,12 +45,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

@ -176,8 +176,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
@ -210,10 +210,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 using deprecated stopslave choice
@ -228,7 +230,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
@ -239,5 +246,6 @@
- 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'