mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-06-09 17:59:11 -07:00
Skip retry-on-error by default and add option to activate it on demand
This commit is contained in:
parent
cbc3721bc6
commit
31a41d1a09
2 changed files with 13 additions and 5 deletions
17
Makefile
17
Makefile
|
@ -1,5 +1,16 @@
|
||||||
SHELL := /bin/bash
|
SHELL := /bin/bash
|
||||||
|
|
||||||
|
# To tell ansible-test and Make to not kill the containers on failure or
|
||||||
|
# end of tests. Disabled by default.
|
||||||
|
ifdef keep_containers_alive
|
||||||
|
_keep_containers_alive = --docker-terminate never
|
||||||
|
endif
|
||||||
|
|
||||||
|
# This match what GitHub Action will do. Disabled by default.
|
||||||
|
ifdef continue_on_errors
|
||||||
|
_continue_on_errors = --retry-on-error --continue-on-error
|
||||||
|
endif
|
||||||
|
|
||||||
.PHONY: test-integration
|
.PHONY: test-integration
|
||||||
test-integration:
|
test-integration:
|
||||||
echo -n $(db_engine_version) > tests/integration/db_engine_version
|
echo -n $(db_engine_version) > tests/integration/db_engine_version
|
||||||
|
@ -52,11 +63,7 @@ test-integration:
|
||||||
python -m venv .venv/$(ansible)
|
python -m venv .venv/$(ansible)
|
||||||
source .venv/$(ansible)/bin/activate
|
source .venv/$(ansible)/bin/activate
|
||||||
python -m pip install --disable-pip-version-check --user https://github.com/ansible/ansible/archive/$(ansible).tar.gz ansible-test
|
python -m pip install --disable-pip-version-check --user https://github.com/ansible/ansible/archive/$(ansible).tar.gz ansible-test
|
||||||
ifdef keep_containers_alive
|
-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 --retry-on-error --continue-on-error --diff --docker $(docker_image) --docker-network podman --docker-terminate never --python $(python); set +x
|
|
||||||
else
|
|
||||||
-set -x; ansible-test integration $(target) -v --color --coverage --retry-on-error --continue-on-error --diff --docker $(docker_image) --docker-network podman --python $(python); set +x
|
|
||||||
endif
|
|
||||||
rm tests/integration/db_engine_version
|
rm tests/integration/db_engine_version
|
||||||
rm tests/integration/connector
|
rm tests/integration/connector
|
||||||
rm tests/integration/python
|
rm tests/integration/python
|
||||||
|
|
1
TESTS.md
1
TESTS.md
|
@ -22,6 +22,7 @@ The Makefile accept the following options:
|
||||||
- **python**: The python version to use in the controller.
|
- **python**: The python version to use in the controller.
|
||||||
- **target** : If omitted, all test targets will run. But you can limit the tests to a single target to speed up your tests.
|
- **target** : If omitted, all test targets will run. But you can limit the tests to a single target to speed up your tests.
|
||||||
- **keep_containers_alive**: This option keeps all tree databases containers and the ansible-test container alive at the end of tests or in case of failure. This is useful to enter one of the containers with `podman exec -it <container-name> bash` for debugging.
|
- **keep_containers_alive**: This option keeps all tree databases containers and the ansible-test container alive at the end of tests or in case of failure. This is useful to enter one of the containers with `podman exec -it <container-name> bash` for debugging.
|
||||||
|
- **continue_on_errors**: Tells ansible-test to retry on errors and also continue on errors. This is the way the GitHub Action's workflow runs the tests. If you develop a new target, this option can be used to validate that your tests cleanup everything so a new run can restart without errors like "Failed to create database x because it already exists".
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue