community.mysql/Makefile
Laurent Indermuehle 98ce2af28c
Refactor way tests info are passed from sed to file with lookup
The idea is to avoid modifying test targets from the workflow to prevent
ansible-test to think every tests needs to be run.
2023-01-05 19:04:51 +01:00

45 lines
1.7 KiB
Makefile

.PHONY: test-integration
test-integration:
echo "mysql:8.0.22" > tests/integration/db_engine_version
echo "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' \
--security-opt label=disable \
--volume ./tests/integration/targets/setup_mysql/replica1/:/etc/mysql/conf.d/ \
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' \
--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
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