Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Add 2024 versions to tests #660

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
9aa532f
Enable mysql_native_password for MySQL 8.2+
laurent-indermuehle Jul 16, 2024
a009515
Enable mysql_native_password for MySQL 8.2+
laurent-indermuehle Jul 17, 2024
a98482d
Fix connection to MySQL 8 since Ubuntu 20.04 update
laurent-indermuehle Jul 17, 2024
123acca
Fix variable propagation to the sub-sub-shell
laurent-indermuehle Jul 17, 2024
036e4c2
Fix newlines
laurent-indermuehle Jul 17, 2024
46ff4af
Fix incomplete test suite
laurent-indermuehle Jul 17, 2024
217f2a2
Cut mysqlclient form the documentation
laurent-indermuehle Jul 17, 2024
c3fb4b6
Fix variable syntax mistakenly copied from Make
laurent-indermuehle Jul 17, 2024
f0493b5
Fix bad substitution
laurent-indermuehle Jul 17, 2024
e810f4a
Fix syntax error in conditional expression
laurent-indermuehle Jul 17, 2024
01b432a
Cut tests for Python 3.12 not supported by ansible-test
laurent-indermuehle Jul 17, 2024
e69cda7
Upgrade integration controller to ubuntu2204 by removing python
laurent-indermuehle Jul 18, 2024
8cb40e1
Cut tests for EoL MariaDB 10.4
laurent-indermuehle Jul 18, 2024
54d55a7
Reduce number of test in the matrix
laurent-indermuehle Jul 18, 2024
751830c
Cut support for intermediate LTS
laurent-indermuehle Jul 18, 2024
f1e6d05
Add missing exclude for a PyMySQL version and mysqlclient name
laurent-indermuehle Jul 18, 2024
8bbefcf
Fix python command not found with ansible-devel and add the debug
laurent-indermuehle Jul 18, 2024
783b76c
Disable retry-on-error
laurent-indermuehle Jul 18, 2024
f1597c9
Add back the python version in the unit tests titles
laurent-indermuehle Jul 18, 2024
609599a
Cut python from the integration tests title
laurent-indermuehle Jul 18, 2024
7ba7832
Enhance jobs title readability
laurent-indermuehle Jul 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
230 changes: 120 additions & 110 deletions .github/workflows/ansible-test-plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on: # yamllint disable-line rule:truthy

jobs:
sanity:
name: "Sanity (Ansible: ${{ matrix.ansible }})"
name: "Sanity (${{ matrix.ansible }})"
runs-on: ubuntu-22.04
strategy:
matrix:
Expand All @@ -35,8 +35,10 @@ jobs:
testing-type: sanity
pull-request-change-detection: true

# Use this to chose which version of Python vs Ansible to test:
# https://docs.ansible.com/ansible/latest/reference_appendices/release_and_maintenance.html#ansible-core-control-node-python-support
integration:
name: "Integration (Python: ${{ matrix.python }}, Ansible: ${{ matrix.ansible }}, DB: ${{ matrix.db_engine_name }} ${{ matrix.db_engine_version }}, connector: ${{ matrix.connector_name }} ${{ matrix.connector_version }})"
name: "Integration (${{ matrix.ansible }}, DB: ${{ matrix.db_engine_name }} ${{ matrix.db_engine_version }}, connector: ${{ matrix.connector_name }} ${{ matrix.connector_version }})"
runs-on: ubuntu-22.04
strategy:
fail-fast: false
Expand All @@ -50,142 +52,117 @@ jobs:
- mysql
- mariadb
db_engine_version:
- 5.7.40
- 8.0.31
- 10.4.27
- 10.5.18
- 10.6.11
python:
- '3.8'
- '3.9'
- '3.10'
- '8.0.38'
- '8.4.1'
- '10.5.25'
- '10.11.8'
connector_name:
- pymysql
- mysqlclient
connector_version:
- 0.7.11
- 0.9.3
- 1.0.2
- 2.0.1
- 2.0.3
- 2.1.1
- '0.9.3'
- '1.0.2'
- '1.1.1'
- '2.0.1'
- '2.0.3'
- '2.1.1'
Comment on lines +63 to +68
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- '0.9.3'
- '1.0.2'
- '1.1.1'
- '2.0.1'
- '2.0.3'
- '2.1.1'
- '0.9.3'
- '1.0.2'
- '1.1.1'
- '2.0.1'
- '2.0.3'
- '2.1.1'

can we also apply same oldest-supported-and-newest strategy here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Best way to install PyMySQL is to use the distribution's package manager.
The version depends on the will of the APT/RPM maintainers:

  • Ubuntu 22.04 : 1.0.2
  • RHEL8 : 0.10.1
  • RHEL9 : 1.1.1
  • Fedora39 : 1.1.0-3 and 1.1.1-1

So we can't say: "This 1.0.2 bug was fixed in 1.1.1, please update", if their distribution doesn't provide such package.

We won't save that many VMs anyway. And PyMySQL is not updated that often: https://pypi.org/project/PyMySQL/#history


include:

# RHEL8 context
- connector_name: pymysql
connector_version: '0.10.1'
ansible: stable-2.16
db_engine_name: mariadb
db_engine_version: '10.11.8'

# RHEL9 context
# - connector_name: pymysql
# connector_version: '1.1.1'
# ansible: stable-2.17
# db_engine_name: mariadb
# db_engine_version: '10.11.8'
# This tests is already included in the matrix, no need repeating

exclude:
- db_engine_name: mysql
db_engine_version: 10.4.27

- db_engine_name: mysql
db_engine_version: 10.5.18
db_engine_version: '10.5.25'

- db_engine_name: mysql
db_engine_version: 10.6.11
db_engine_version: '10.11.8'

- db_engine_name: mariadb
db_engine_version: 5.7.40
db_engine_version: '8.0.38'

- db_engine_name: mariadb
db_engine_version: 8.0.31
db_engine_version: '8.4.1'

- connector_name: pymysql
connector_version: 2.0.1
connector_version: '2.0.1'

- connector_name: pymysql
connector_version: 2.0.3
connector_version: '2.0.3'

- connector_name: pymysql
connector_version: 2.1.1
connector_version: '2.1.1'

- connector_name: mysqlclient
connector_version: 0.7.11
connector_version: '0.9.3'

- connector_name: mysqlclient
connector_version: 0.9.3
connector_version: '1.0.2'

- connector_name: mysqlclient
connector_version: 1.0.2
connector_version: '1.1.1'

- db_engine_name: mariadb
connector_version: 0.7.11

- db_engine_version: 5.7.40
python: '3.9'

- db_engine_version: 5.7.40
python: '3.10'

- db_engine_version: 5.7.40
ansible: stable-2.15
- db_engine_version: '8.0.38'
ansible: stable-2.17

- db_engine_version: 5.7.40
ansible: stable-2.16
- db_engine_version: '10.5.25'
ansible: stable-2.17

- db_engine_version: 5.7.40
- db_engine_version: '8.0.38'
ansible: devel

- db_engine_version: 8.0.31
python: '3.8'

- db_engine_version: 10.4.27
python: '3.10'

- db_engine_version: 10.4.27
- db_engine_version: '10.5.25'
ansible: devel

- db_engine_version: 10.6.11
python: '3.8'
- db_engine_version: '8.4.1'
connector_version: '0.9.3'

- db_engine_version: 10.6.11
python: '3.9'
- db_engine_version: '8.4.1'
connector_version: '1.0.2'

- python: '3.8'
connector_version: 1.0.2

- python: '3.8'
connector_version: 2.0.3

- python: '3.8'
connector_version: 2.1.1

- python: '3.9'
connector_version: 0.7.11

- python: '3.9'
connector_version: 1.0.2

- python: '3.9'
connector_version: 2.0.1

- python: '3.9'
connector_version: 2.1.1

- python: '3.10'
connector_version: 0.7.11
- db_engine_version: '8.4.1'
connector_version: '2.0.1'

- python: '3.10'
connector_version: 0.9.3
- db_engine_version: '8.4.1'
connector_version: '2.0.3'

- python: '3.10'
connector_version: 2.0.1
- db_engine_version: '10.11.8'
connector_version: '0.9.3'

- python: '3.10'
connector_version: 2.0.3
- db_engine_version: '10.11.8'
connector_version: '1.0.2'

- python: '3.8'
ansible: stable-2.16
- db_engine_version: '10.11.8'
connector_version: '2.0.1'

- python: '3.8'
ansible: stable-2.17
- db_engine_version: '10.11.8'
connector_version: '2.0.1'

- python: '3.8'
ansible: devel
- db_engine_version: '10.11.8'
ansible: stable-2.15

- python: '3.9'
ansible: stable-2.16
- db_engine_version: '8.4.1'
ansible: stable-2.15

- python: '3.9'
ansible: stable-2.17
- connector_version: '1.1.1'
db_engine_version: '8.0.38'

- python: '3.9'
ansible: devel
- connector_version: '1.1.1'
db_engine_version: '10.5.25'

services:
db_primary:
Expand Down Expand Up @@ -238,9 +215,22 @@ jobs:

- name: Restart MySQL server with settings for replication
run: |
docker exec ${{ job.services.db_primary.id }} bash -c 'echo -e [mysqld]\\nserver-id=1\\nlog-bin=/var/lib/mysql/primary-bin > /etc/mysql/conf.d/replication.cnf'
docker exec ${{ job.services.db_replica1.id }} bash -c 'echo -e [mysqld]\\nserver-id=2\\nlog-bin=/var/lib/mysql/replica1-bin > /etc/mysql/conf.d/replication.cnf'
docker exec ${{ job.services.db_replica2.id }} bash -c 'echo -e [mysqld]\\nserver-id=3\\nlog-bin=/var/lib/mysql/replica2-bin > /etc/mysql/conf.d/replication.cnf'
db_ver="${{ matrix.db_engine_version }}"
maj="${db_ver%.*.*}"
maj_min="${db_ver%.*}"
min="${maj_min#*.}"
if [[ "${{ matrix.db_engine_name }}" == "mysql" && "$maj" -eq 8 && "$min" -ge 2 ]]; then
prima_conf='[mysqld]\\nserver-id=1\\nlog-bin=/var/lib/mysql/primary-bin\\nmysql-native-password=1'
repl1_conf='[mysqld]\\nserver-id=2\\nlog-bin=/var/lib/mysql/replica1-bin\\nmysql-native-password=1'
repl2_conf='[mysqld]\\nserver-id=3\\nlog-bin=/var/lib/mysql/replica2-bin\\nmysql-native-password=1'
else
prima_conf='[mysqld]\\nserver-id=1\\nlog-bin=/var/lib/mysql/primary-bin'
repl1_conf='[mysqld]\\nserver-id=2\\nlog-bin=/var/lib/mysql/replica1-bin'
repl2_conf='[mysqld]\\nserver-id=3\\nlog-bin=/var/lib/mysql/replica2-bin'
fi
docker exec -e cnf=$prima_conf ${{ job.services.db_primary.id }} bash -c 'echo -e ${cnf//\\n/\n} > /etc/mysql/conf.d/replication.cnf'
docker exec -e cnf=$repl1_conf ${{ job.services.db_replica1.id }} bash -c 'echo -e ${cnf//\\n/\n} > /etc/mysql/conf.d/replication.cnf'
docker exec -e cnf=$repl2_conf ${{ job.services.db_replica2.id }} bash -c 'echo -e ${cnf//\\n/\n} > /etc/mysql/conf.d/replication.cnf'
docker restart -t 30 ${{ job.services.db_primary.id }}
docker restart -t 30 ${{ job.services.db_replica1.id }}
docker restart -t 30 ${{ job.services.db_replica2.id }}
Expand All @@ -255,10 +245,10 @@ jobs:
- name: >-
Perform integration testing against
Ansible version ${{ matrix.ansible }}
under Python ${{ matrix.python }}
uses: ansible-community/ansible-test-gh-action@release/v1
with:
ansible-core-version: ${{ matrix.ansible }}
docker-image: ubuntu2204
pre-test-cmd: >-
echo Setting db_engine_name to "${{ matrix.db_engine_name }}"...;
echo -n "${{ matrix.db_engine_name }}"
Expand All @@ -277,19 +267,15 @@ jobs:
echo -n "${{ matrix.connector_version }}"
> tests/integration/connector_version;

echo Setting Python version to "${{ matrix.python }}"...;
echo -n "${{ matrix.python }}"
> tests/integration/python;

echo Setting Ansible version to "${{ matrix.ansible }}"...;
echo -n "${{ matrix.ansible }}"
> tests/integration/ansible
target-python-version: ${{ matrix.python }}
testing-type: integration
integration-retry-on-error: false

units:
runs-on: ubuntu-22.04
name: Units (Ⓐ${{ matrix.ansible }})
name: Units (Ⓐ${{ matrix.ansible }}, Python${{ matrix.python }})
strategy:
# As soon as the first unit test fails,
# cancel the others to free up the CI queue
Expand All @@ -301,22 +287,46 @@ jobs:
- stable-2.17
- devel
python:
- 3.8
- 3.9
- '3.8'
- '3.9'
- '3.10'
- '3.11'
exclude:
- python: '3.8'
ansible: stable-2.15
- python: '3.8'
ansible: stable-2.16

- python: '3.8'
ansible: stable-2.17

- python: '3.8'
ansible: devel

- python: '3.9'
ansible: stable-2.15

- python: '3.9'
ansible: stable-2.17

- python: '3.9'
ansible: devel

- python: '3.10'
ansible: stable-2.15

- python: '3.10'
ansible: stable-2.16

- python: '3.11'
ansible: stable-2.15

- python: '3.11'
ansible: stable-2.16

steps:
- name: >-
Perform unit testing against
Ansible version ${{ matrix.ansible }}
Ansible version ${{ matrix.ansible }} and
python version ${{ matrix.python }}
uses: ansible-community/ansible-test-gh-action@release/v1
with:
ansible-core-version: ${{ matrix.ansible }}
Expand Down
Loading
Loading