mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-07-24 13:50:26 -07:00
[PR #514/e2aa655 backport][stable-2] Fix issues and documentation with integration tests after merge of #490 (#521)
* Fix issues and documentation with integration tests after merge of #490. (#514)
* Fix explanation about containers images
* Add definitive URI to the containers images
* Document that new images must be set as public
* Document makefile options possible values
* Document that any mysql and mariadb tag can be use
* Add computation of docker_image path
* Refactor pre-command to separate commands for cleaner GHA output
* Refactor to use GHA test matrix
* Cut docker_image from documentation since it's now automatic
* Document how to use run_all_test.py to display the test matrix
(cherry picked from commit e2aa655762
)
* Add changelog fragment
This commit is contained in:
parent
530e6c3d9c
commit
c30a2e5c99
42 changed files with 640 additions and 534 deletions
42
Makefile
42
Makefile
|
@ -11,12 +11,32 @@ ifdef continue_on_errors
|
|||
_continue_on_errors = --retry-on-error --continue-on-error
|
||||
endif
|
||||
|
||||
|
||||
db_ver_tuple := $(subst ., , $(db_engine_version))
|
||||
db_engine_version_flat := $(word 1, $(db_ver_tuple))$(word 2, $(db_ver_tuple))
|
||||
|
||||
con_ver_tuple := $(subst ., , $(connector_version))
|
||||
connector_version_flat := $(word 1, $(con_ver_tuple))$(word 2, $(con_ver_tuple))$(word 3, $(con_ver_tuple))
|
||||
|
||||
py_ver_tuple := $(subst ., , $(python))
|
||||
python_version_flat := $(word 1, $(py_ver_tuple))$(word 2, $(py_ver_tuple))
|
||||
|
||||
ifeq ($(db_engine_version_flat), 57)
|
||||
db_client := my57
|
||||
else
|
||||
db_client := $(db_engine_name)
|
||||
endif
|
||||
|
||||
|
||||
.PHONY: test-integration
|
||||
test-integration:
|
||||
echo -n $(db_engine_version) > tests/integration/db_engine_version
|
||||
echo -n $(connector) > tests/integration/connector
|
||||
echo -n $(python) > tests/integration/python
|
||||
echo -n $(ansible) > tests/integration/ansible
|
||||
@echo -n $(db_engine_name) > tests/integration/db_engine_name
|
||||
@echo -n $(db_engine_version) > tests/integration/db_engine_version
|
||||
@echo -n $(connector_name) > tests/integration/connector_name
|
||||
@echo -n $(connector_version) > tests/integration/connector_version
|
||||
@echo -n $(python) > tests/integration/python
|
||||
@echo -n $(ansible) > tests/integration/ansible
|
||||
|
||||
# Create podman network for systems missing it. Error can be ignored
|
||||
podman network create podman || true
|
||||
podman run \
|
||||
|
@ -28,7 +48,7 @@ test-integration:
|
|||
--network podman \
|
||||
--publish 3307:3306 \
|
||||
--health-cmd 'mysqladmin ping -P 3306 -pmsandbox | grep alive || exit 1' \
|
||||
docker.io/library/$(db_engine_version) \
|
||||
docker.io/library/$(db_engine_name):$(db_engine_version) \
|
||||
mysqld
|
||||
podman run \
|
||||
--detach \
|
||||
|
@ -39,7 +59,7 @@ test-integration:
|
|||
--network podman \
|
||||
--publish 3308:3306 \
|
||||
--health-cmd 'mysqladmin ping -P 3306 -pmsandbox | grep alive || exit 1' \
|
||||
docker.io/library/$(db_engine_version) \
|
||||
docker.io/library/$(db_engine_name):$(db_engine_version) \
|
||||
mysqld
|
||||
podman run \
|
||||
--detach \
|
||||
|
@ -50,7 +70,7 @@ test-integration:
|
|||
--network podman \
|
||||
--publish 3309:3306 \
|
||||
--health-cmd 'mysqladmin ping -P 3306 -pmsandbox | grep alive || exit 1' \
|
||||
docker.io/library/$(db_engine_version) \
|
||||
docker.io/library/$(db_engine_name):$(db_engine_version) \
|
||||
mysqld
|
||||
# Setup replication and restart containers
|
||||
podman exec primary bash -c 'echo -e [mysqld]\\nserver-id=1\\nlog-bin=/var/lib/mysql/primary-bin > /etc/mysql/conf.d/replication.cnf'
|
||||
|
@ -69,9 +89,13 @@ test-integration:
|
|||
source .venv/$(ansible)/bin/activate
|
||||
python$(local_python_version) -m ensurepip
|
||||
python$(local_python_version) -m pip install --disable-pip-version-check https://github.com/ansible/ansible/archive/$(ansible).tar.gz
|
||||
-set -x; ansible-test integration $(target) -v --color --coverage --diff --docker $(docker_image) --docker-network podman $(_continue_on_errors) $(_keep_containers_alive) --python $(python); set +x
|
||||
-set -x; ansible-test integration $(target) -v --color --coverage --diff \
|
||||
--docker ghcr.io/ansible-collections/community.mysql/test-container-$(db_client)-py$(python_version_flat)-$(connector_name)$(connector_version_flat):latest \
|
||||
--docker-network podman $(_continue_on_errors) $(_keep_containers_alive) --python $(python); set +x
|
||||
rm tests/integration/db_engine_name
|
||||
rm tests/integration/db_engine_version
|
||||
rm tests/integration/connector
|
||||
rm tests/integration/connector_name
|
||||
rm tests/integration/connector_version
|
||||
rm tests/integration/python
|
||||
rm tests/integration/ansible
|
||||
ifndef keep_containers_alive
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue