Generalize mysql and mariadb version based on container name

This way we can split db_engine and db_version and simplify tests.
Also this is mandatory to use the matrix.db_engine_version as the
image name for our services containers.
This commit is contained in:
Laurent Indermuehle 2023-01-04 14:14:13 +01:00
commit b821db97c5
No known key found for this signature in database
GPG key ID: 93FA944C9F34DD09
13 changed files with 158 additions and 190 deletions

View file

@ -15,8 +15,7 @@ on:
env:
mysql_version_file: "tests/integration/targets/setup_mysql/defaults/main.yml"
connector_version_file: "tests/integration/targets/setup_mysql/vars/main.yml"
config_file: "tests/integration/targets/setup_mysql/defaults/main.yml"
jobs:
# sanity:
@ -44,13 +43,12 @@ jobs:
strategy:
fail-fast: false
matrix:
# db_engine_version:
# - mysql_5.7.31
# - mysql_8.0.22
# - mariadb_10.3.34
# # When adding later versions below,
# # also change the "Set MariaDB URL sub dir" task
# - mariadb_10.8.3
db_engine_version:
# - mysql:5.7.40
- mysql:8.0.22
# - mariadb:10.4.24
# - mariadb:10.5.18
# - mariadb:10.8.3
ansible:
# - stable-2.12
# - stable-2.13
@ -88,10 +86,9 @@ jobs:
services:
db_primary:
# image: mariadb:10.5
image: mysql:8.0.22
image: ${{ matrix.db_engine_version }}
env:
# MARIADB_ROOT_PASSWORD: msandbox
MARIADB_ROOT_PASSWORD: msandbox
MYSQL_ROOT_PASSWORD: msandbox
ports:
- 3307:3306
@ -106,10 +103,9 @@ jobs:
# --health-timeout 5s
# --health-retries 6
db_replica1:
# image: mariadb:10.5
image: mysql:8.0.22
image: ${{ matrix.db_engine_version }}
env:
# MARIADB_ROOT_PASSWORD: msandbox
MARIADB_ROOT_PASSWORD: msandbox
MYSQL_ROOT_PASSWORD: msandbox
ports:
- 3308:3306
@ -122,10 +118,9 @@ jobs:
# --health-timeout 5s
# --health-retries 6
db_replica2:
# image: mariadb:10.5
image: mysql:8.0.22
image: ${{ matrix.db_engine_version }}
env:
# MARIADB_ROOT_PASSWORD: msandbox
MARIADB_ROOT_PASSWORD: msandbox
MYSQL_ROOT_PASSWORD: msandbox
ports:
- 3309:3306
@ -147,8 +142,10 @@ jobs:
with:
ansible-core-version: ${{ matrix.ansible }}
pre-test-cmd: >-
>&2 echo Setting db_engine_version to ${{ matrix.db_engine_version }}...;
sed -i 's/^db_engine_version:.*/db_engine_version: [${{ matrix.db_engine_version }}]/' ${{ env.config_file }}
>&2 echo Setting Connector version to ${{ matrix.connector }}...;
sed -i 's/^python_packages:.*/python_packages: [${{ matrix.connector }}]/' ${{ env.connector_version_file }}
sed -i 's/^python_packages:.*/python_packages: [${{ matrix.connector }}]/' ${{ env.config_file }}
target-python-version: ${{ matrix.python }}
testing-type: integration