Fix ansible-test unknown option

I copied blindly https://github.com/ansible-collections/community.sops/blob/main/.github/workflows/ansible-test.yml#L195
and forgot what ansible-test was expecting
This commit is contained in:
Laurent Indermuehle 2023-01-16 09:00:08 +01:00
parent 5bc5ed1cee
commit fbb0290e19
No known key found for this signature in database
GPG key ID: 93FA944C9F34DD09
4 changed files with 12 additions and 12 deletions

View file

@ -45,12 +45,12 @@ jobs:
db_engine_version: mysql:5.7.40
python: 3.8
connector: pymysql==0.7.11
docker_container: quay.io/mws/community-mysql-test-containers-my57-py38-mysqlclient201-pymysql0711:latest
docker_image: quay.io/mws/community-mysql-test-containers-my57-py38-mysqlclient201-pymysql0711:latest
- ansible: stable-2.12
db_engine_version: mysql:5.7.40
python: 3.8
connector: pymysql==0.9.3
docker_container: quay.io/mws/community-mysql-test-containers-my57-py38-pymysql093:latest
docker_image: quay.io/mws/community-mysql-test-containers-my57-py38-pymysql093:latest
# db_engine_version:
# - mysql:5.7.40
@ -169,7 +169,7 @@ jobs:
echo -n "${{ matrix.db_engine_version }}" > tests/integration/db_engine_version;
echo Setting Connector version to "${{ matrix.connector }}"...;
echo -n "${{ matrix.connector }}" > tests/integration/connector
docker_container: ${{ matrix.docker_container }}
docker-image: ${{ matrix.docker_image }}
target-python-version: ${{ matrix.python }}
testing-type: integration

View file

@ -14,7 +14,7 @@ Actually, the makefile only support Podman. I don't have tested with docker yet.
The Makefile accept the following options:
- ansible: Mandatory version of ansible to install in a venv to run ansible-test.
- docker_container:
- docker_image:
The container image to use to run our tests. Those images Dockerfile are in https://github.com/community.mysql-test-containers and then pushed to quay.io: E.G.:
`quay.io/mws/community-mysql-test-containers-my57-py38-mysqlclient201-pymysql0711:latest`. Look in the link above for a complete list of available containers. You can also look into `.github/workflows/ansible-test-plugins.yml`
Unfortunatly you must provide the right container_image yourself. And you still need to provides db_engine_version, python, etc... because ansible-test won't do black magic to try to detect what we expect. Explicit is better than implicit anyway.
@ -28,10 +28,10 @@ Examples:
```sh
# Run all targets
make ansible="stable-2.14" db_engine_version="mysql:5.7.40" connector="pymysql==0.7.10" python="3.8" docker_container="my57-py38-mysqlclient201-pymysql0711"
make ansible="stable-2.14" db_engine_version="mysql:5.7.40" connector="pymysql==0.7.10" python="3.8" docker_image="my57-py38-mysqlclient201-pymysql0711"
# A single target
make ansible="stable-2.14" db_engine_version="mysql:5.7.40" connector="pymysql==0.7.10" python="3.8" docker_container="my57-py38-mysqlclient201-pymysql0711" target="test_mysql_db"
make ansible="stable-2.14" db_engine_version="mysql:5.7.40" connector="pymysql==0.7.10" python="3.8" docker_image="my57-py38-mysqlclient201-pymysql0711" target="test_mysql_db"
```

View file

@ -50,9 +50,9 @@ test-integration:
python -m venv .venv/$(ansible)
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
-set -x; ansible-test integration $(target) -v --color --coverage --retry-on-error --continue-on-error --diff --docker $(docker_container) --docker-network podman --python $(python); set +x
# -set -x; ansible-test integration $(target) -v --color --coverage --retry-on-error --continue-on-error --diff --docker $(docker_container) --docker-network podman --python $(python); set +x
# -set -x; ansible-test integration $(target) -v --color --coverage --diff --docker $(docker_container) --docker-network podman --docker-terminate never --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 --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 --python $(python); set +x
# -set -x; ansible-test integration $(target) -v --color --coverage --diff --docker $(docker_image) --docker-network podman --docker-terminate never --python $(python); set +x
rm tests/integration/db_engine_version
rm tests/integration/connector
podman stop --time 0 --ignore primary

View file

@ -73,9 +73,9 @@ def main():
d = tests.get('db_engine_version')
p = tests.get('python')
c = tests.get('connector')
i = tests.get('docker_container')
make_cmd = f'make ansible="{a}" db_engine_version="{d}" python="{p}" connector="{c}" docker_container="{i}" test-integration'
print(f'Run tests for: Ansible: {a}, DB: {d}, Python: {p}, Connector: {c}, Image: {i}')
i = tests.get('docker_image')
make_cmd = f'make ansible="{a}" db_engine_version="{d}" python="{p}" connector="{c}" docker_image="{i}" test-integration'
print(f'Run tests for: Ansible: {a}, DB: {d}, Python: {p}, Connector: {c}, Docker image: {i}')
os.system(make_cmd)