From 87acd3d3038985576f2ba5470c4b2535bc809d78 Mon Sep 17 00:00:00 2001 From: Laurent Indermuehle Date: Wed, 4 Jan 2023 17:14:27 +0100 Subject: [PATCH] Add static test with replication containers --- Makefile | 41 +++++++++++++++++++++++++++++++++-------- 1 file changed, 33 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index da34b83..acb9545 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,39 @@ -.PHONY: test-integration-mariadb-10-5 -test-integration-mariadb-10-5: +.PHONY: test-integration +test-integration: podman run \ --detach \ - --name mariadb105 \ + --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' \ - mariadb:10.5 - while ! podman healthcheck run mariadb105 && [[ "$$SECONDS" -lt 120 ]]; do sleep 1; done - -ansible-test integration --venv - podman stop --time 0 --ignore mariadb105 - podman rm --ignore mariadb105 + 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 \ + --server_id 2 + 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 \ + --server_id 3 + 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 + 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