fix missing symlink to mysql binaries for MariaDB 11+

This commit is contained in:
Laurent Indermuehle 2025-03-05 13:35:22 +01:00
parent 4b297b6eda
commit 65e385114d
No known key found for this signature in database
GPG key ID: 93FA944C9F34DD09
2 changed files with 29 additions and 15 deletions

View file

@ -54,8 +54,8 @@ jobs:
db_engine_version: db_engine_version:
- '8.0.38' - '8.0.38'
- '8.4.1' - '8.4.1'
- '10.5.25'
- '10.11.8' - '10.11.8'
- '11.4.5'
connector_name: connector_name:
- pymysql - pymysql
- mysqlclient - mysqlclient
@ -87,10 +87,10 @@ jobs:
exclude: exclude:
- db_engine_name: mysql - db_engine_name: mysql
db_engine_version: '10.5.25' db_engine_version: '10.11.8'
- db_engine_name: mysql - db_engine_name: mysql
db_engine_version: '10.11.8' db_engine_version: '11.4.5'
- db_engine_name: mariadb - db_engine_name: mariadb
db_engine_version: '8.0.38' db_engine_version: '8.0.38'
@ -119,13 +119,13 @@ jobs:
- db_engine_version: '8.0.38' - db_engine_version: '8.0.38'
ansible: stable-2.17 ansible: stable-2.17
- db_engine_version: '10.5.25' - db_engine_version: '10.11.8'
ansible: stable-2.17 ansible: stable-2.17
- db_engine_version: '8.0.38' - db_engine_version: '8.0.38'
ansible: devel ansible: devel
- db_engine_version: '10.5.25' - db_engine_version: '10.11.8'
ansible: devel ansible: devel
- db_engine_version: '8.4.1' - db_engine_version: '8.4.1'
@ -162,7 +162,10 @@ jobs:
db_engine_version: '8.0.38' db_engine_version: '8.0.38'
- connector_version: '1.1.1' - connector_version: '1.1.1'
db_engine_version: '10.5.25' db_engine_version: '10.11.8'
env:
HEALTH_CMD: ${{ matrix.db_engine_name == 'mysql' && 'mysqladmin' || 'mariadb-admin' }}
services: services:
db_primary: db_primary:
@ -175,7 +178,7 @@ jobs:
# We write our own health-cmd because the mariadb container does not # We write our own health-cmd because the mariadb container does not
# provide a healthcheck # provide a healthcheck
options: >- options: >-
--health-cmd "mysqladmin ping -P 3306 -pmsandbox |grep alive || exit 1" --health-cmd "${{ env.HEALTH_CMD }} ping -P 3306 -pmsandbox |grep alive || exit 1"
--health-start-period 10s --health-start-period 10s
--health-interval 10s --health-interval 10s
--health-timeout 5s --health-timeout 5s
@ -189,7 +192,7 @@ jobs:
ports: ports:
- 3308:3306 - 3308:3306
options: >- options: >-
--health-cmd "mysqladmin ping -P 3306 -pmsandbox |grep alive || exit 1" --health-cmd "${{ env.HEALTH_CMD }} ping -P 3306 -pmsandbox |grep alive || exit 1"
--health-start-period 10s --health-start-period 10s
--health-interval 10s --health-interval 10s
--health-timeout 5s --health-timeout 5s
@ -203,7 +206,7 @@ jobs:
ports: ports:
- 3309:3306 - 3309:3306
options: >- options: >-
--health-cmd "mysqladmin ping -P 3306 -pmsandbox |grep alive || exit 1" --health-cmd "${{ env.HEALTH_CMD }} ping -P 3306 -pmsandbox |grep alive || exit 1"
--health-start-period 10s --health-start-period 10s
--health-interval 10s --health-interval 10s
--health-timeout 5s --health-timeout 5s

View file

@ -11,6 +11,17 @@ ifdef continue_on_errors
_continue_on_errors = --continue-on-error _continue_on_errors = --continue-on-error
endif endif
# Set command variables based on database engine
# Required for MariaDB 11+ which no longer includes mysql named compatible
# executable symlinks
ifeq ($(db_engine_name),mysql)
_command = mysqld
_health_cmd = mysqladmin
else
_command = mariadbd
_health_cmd = mariadb-admin
endif
.PHONY: test-integration .PHONY: test-integration
test-integration: test-integration:
@echo -n $(db_engine_name) > tests/integration/db_engine_name @echo -n $(db_engine_name) > tests/integration/db_engine_name
@ -29,9 +40,9 @@ test-integration:
--env MYSQL_ROOT_PASSWORD=msandbox \ --env MYSQL_ROOT_PASSWORD=msandbox \
--network podman \ --network podman \
--publish 3307:3306 \ --publish 3307:3306 \
--health-cmd 'mysqladmin ping -P 3306 -pmsandbox | grep alive || exit 1' \ --health-cmd '$(_health_cmd) ping -P 3306 -pmsandbox | grep alive || exit 1' \
docker.io/library/$(db_engine_name):$(db_engine_version) \ docker.io/library/$(db_engine_name):$(db_engine_version) \
mysqld $(_command)
podman run \ podman run \
--detach \ --detach \
--replace \ --replace \
@ -40,9 +51,9 @@ test-integration:
--env MYSQL_ROOT_PASSWORD=msandbox \ --env MYSQL_ROOT_PASSWORD=msandbox \
--network podman \ --network podman \
--publish 3308:3306 \ --publish 3308:3306 \
--health-cmd 'mysqladmin ping -P 3306 -pmsandbox | grep alive || exit 1' \ --health-cmd '$(_health_cmd) ping -P 3306 -pmsandbox | grep alive || exit 1' \
docker.io/library/$(db_engine_name):$(db_engine_version) \ docker.io/library/$(db_engine_name):$(db_engine_version) \
mysqld $(_command)
podman run \ podman run \
--detach \ --detach \
--replace \ --replace \
@ -51,9 +62,9 @@ test-integration:
--env MYSQL_ROOT_PASSWORD=msandbox \ --env MYSQL_ROOT_PASSWORD=msandbox \
--network podman \ --network podman \
--publish 3309:3306 \ --publish 3309:3306 \
--health-cmd 'mysqladmin ping -P 3306 -pmsandbox | grep alive || exit 1' \ --health-cmd '$(_health_cmd) ping -P 3306 -pmsandbox | grep alive || exit 1' \
docker.io/library/$(db_engine_name):$(db_engine_version) \ docker.io/library/$(db_engine_name):$(db_engine_version) \
mysqld $(_command)
# Setup replication and restart containers using the same subshell to keep variables alive # Setup replication and restart containers using the same subshell to keep variables alive
db_ver=$(db_engine_version); \ db_ver=$(db_engine_version); \
maj="$${db_ver%.*.*}"; \ maj="$${db_ver%.*.*}"; \