Refactor the way server_id is set for replicas

The simple way is to add '--server-id 2' after the name of the image of
the container. But GHA doesn't let us do that. The idea of mount a file
from our repo doesn't work because the repo is check out later in the
workflow and I failed to find a pre-job hook. Then I realized that this
MySQL option is dynamic! So we will set that in the test target!
This commit is contained in:
Laurent Indermuehle 2023-01-06 14:14:35 +01:00
commit 8d43f9e573
No known key found for this signature in database
GPG key ID: 93FA944C9F34DD09
5 changed files with 17 additions and 18 deletions

View file

@ -19,8 +19,6 @@ test-integration:
--network podman \
--publish 3308:3306 \
--health-cmd 'mysqladmin ping -P 3306 -pmsandbox | grep alive || exit 1' \
--security-opt label=disable \
--volume ./tests/integration/targets/setup_mysql/replica1/:/etc/mysql/conf.d/ \
mysql:8.0.22
podman run \
--detach \
@ -30,8 +28,6 @@ test-integration:
--network podman \
--publish 3309:3306 \
--health-cmd 'mysqladmin ping -P 3306 -pmsandbox | grep alive || exit 1' \
--security-opt label=disable \
--volume ./tests/integration/targets/setup_mysql/replica2/:/etc/mysql/conf.d/ \
mysql:8.0.22
while ! podman healthcheck run primary && [[ "$$SECONDS" -lt 120 ]]; do sleep 1; done
-set -x; ansible-test integration -v --color --coverage --retry-on-error --continue-on-error --diff --docker --docker-network podman --python 3.8; set +x