community.mysql/Makefile
Laurent Indermuehle 8d43f9e573
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!
2023-01-06 14:14:35 +01:00

41 lines
1.5 KiB
Makefile

.PHONY: test-integration
test-integration:
echo -n mysql:8.0.22 > tests/integration/db_engine_version
echo -n pymysql==0.9.3 > tests/integration/connector
podman run \
--detach \
--name primary \
--env MARIADB_ROOT_PASSWORD=msandbox \
--env MYSQL_ROOT_PASSWORD=msandbox \
--network podman \
--publish 3307:3306 \
--health-cmd 'mysqladmin ping -P 3306 -pmsandbox | grep alive || exit 1' \
mysql:8.0.22
podman run \
--detach \
--name replica1 \
--env MARIADB_ROOT_PASSWORD=msandbox \
--env MYSQL_ROOT_PASSWORD=msandbox \
--network podman \
--publish 3308:3306 \
--health-cmd 'mysqladmin ping -P 3306 -pmsandbox | grep alive || exit 1' \
mysql:8.0.22
podman run \
--detach \
--name replica2 \
--env MARIADB_ROOT_PASSWORD=msandbox \
--env MYSQL_ROOT_PASSWORD=msandbox \
--network podman \
--publish 3309:3306 \
--health-cmd 'mysqladmin ping -P 3306 -pmsandbox | grep alive || exit 1' \
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
rm tests/integration/db_engine_version
rm tests/integration/connector
podman stop --time 0 --ignore primary
podman stop --time 0 --ignore replica1
podman stop --time 0 --ignore replica2
podman rm --ignore primary
podman rm --ignore replica1
podman rm --ignore replica2