Add healthcheck to MariaDB before starting the tests

This prevent the first test to fail because the db isn't ready yet.
This commit is contained in:
Laurent Indermuehle 2022-12-09 14:09:07 +01:00
parent 5bd358e553
commit d781636f32
No known key found for this signature in database
GPG key ID: 93FA944C9F34DD09

View file

@ -1,4 +1,14 @@
.PHONY: test-integration-ansible-2-11-python-3-8-mariadb-10-5
test-integration-ansible-2-11-python-3-8-mariadb-10-5:
podman run --detach --name mariadb105 --env MARIADB_ROOT_PASSWORD=msandbox --publish 3307:3306 mariadb:10.5
ansible-test integration --docker --python 3.8 test_mysql_user
.PHONY: test-integration-mariadb-10-5
test-integration-mariadb-10-5:
podman run \
--detach \
--name mariadb105 \
--env MARIADB_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 test_mysql_db --venv
podman stop --time 0 --ignore mariadb105
podman rm --ignore mariadb105