1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-03-22 05:09:12 +00:00

make integration tests more deterministic and fix typo

This commit is contained in:
Mariam Ahhttouche 2026-03-05 15:49:38 +01:00
parent 8c526794b7
commit d52fdc4c83

View file

@ -16,7 +16,7 @@
register: failed_install
ignore_errors: true
- name: Verify python 3.14 installation failed
- name: Verify Python 3.14 installation failed
assert:
that:
- failed_install.failed is true
@ -32,27 +32,27 @@
ignore_errors: true
register: check_python_314_exists
- name: Install python 3.14 in check mode
- name: Install Python 3.14 in check mode
uv_python:
version: 3.14
state: present
check_mode: true
register: install_check_mode
- name: Verify python 3.14 installation in check mode
- name: Verify Python 3.14 installation in check mode
assert:
that:
- install_check_mode.changed == check_python_314_exists.failed
- install_check_mode.failed is false
- install_check_mode.python_versions | length >= 1
- name: Install python 3.14
- name: Install Python 3.14
uv_python:
version: 3.14
state: present
register: install_python
- name: Verify python 3.14 installation
- name: Verify Python 3.14 installation
assert:
that:
- install_python.changed == check_python_314_exists.failed
@ -60,13 +60,13 @@
- install_python.python_versions | length >= 1
- install_python.python_paths | length >= 1
- name: Re-install python 3.14
- name: Re-install Python 3.14
uv_python:
version: 3.14
state: present
register: reinstall_python
- name: Verify python 3.14 re-installation
- name: Verify Python 3.14 re-installation
assert:
that:
- reinstall_python.changed is false
@ -74,53 +74,62 @@
- reinstall_python.python_versions | length >= 1
- reinstall_python.python_paths | length >= 1
- name: Install python 3.13.5
- name: Check if Python 3.13.5 exists already
command: uv python find 3.13.5
ignore_errors: true
register: check_python_3135_exists
- name: Check if Python
command: uv python list
ignore_errors: true
- name: Install Python 3.13.5
uv_python:
version: 3.13.5
register: install_python
- name: Verify python 3.13.5 installation
- name: Verify Python 3.13.5 installation
assert:
that:
- install_python.changed is true
- install_python.changed == check_python_3135_exists.failed
- install_python.failed is false
- '"3.13.5" in install_python.python_versions'
- install_python.python_paths | length >= 1
- name: Re-install python 3.13.5
- name: Re-install Python 3.13.5
uv_python:
version: 3.13.5
state: present
register: reinstall_python
- name: Verify python 3.13.5 installation
- name: Verify Python 3.13.5 installation
assert:
that:
- reinstall_python.changed is false
- reinstall_python.failed is false
- '"3.13.5" in reinstall_python.python_versions'
- name: Remove uninstalled python 3.10 # removes latest patch version for 3.10 if exists
- name: Remove uninstalled Python 3.10 # removes latest patch version for 3.10 if exists
uv_python:
version: "3.10"
state: absent
register: remove_python
- name: Verify python 3.10 deletion
- name: Verify Python 3.10 deletion
assert:
that:
- remove_python.changed is false
- remove_python.failed is false
- remove_python.python_versions | length == 0
- name: Remove python 3.13.5 in check mode
- name: Remove Python 3.13.5 in check mode
uv_python:
version: 3.13.5
state: absent
check_mode: true
register: remove_python_in_check_mode
- name: Verify python 3.13.5 deletion in check mode
- name: Verify Python 3.13.5 deletion in check mode
assert:
that:
- remove_python_in_check_mode.changed is true
@ -128,13 +137,13 @@
- '"3.13.5" in remove_python_in_check_mode.python_versions'
- remove_python_in_check_mode.python_paths | length >= 1
- name: Remove python 3.13.5
- name: Remove Python 3.13.5
uv_python:
version: 3.13.5
state: absent
register: remove_python
- name: Verify python 3.13.5 deletion
- name: Verify Python 3.13.5 deletion
assert:
that:
- remove_python.changed is true
@ -142,13 +151,13 @@
- remove_python.python_paths | length >= 1
- '"3.13.5" in remove_python.python_versions'
- name: Remove python 3.13.5 again
- name: Remove Python 3.13.5 again
uv_python:
version: 3.13.5
state: absent
register: remove_python
- name: Verify python 3.13.5 deletion again
- name: Verify Python 3.13.5 deletion again
assert:
that:
- remove_python.changed is false
@ -156,13 +165,13 @@
- remove_python.python_versions | length == 0
- remove_python.python_paths | length == 0
- name: Upgrade python 3.13
- name: Upgrade Python 3.13
uv_python:
version: 3.13
state: latest
register: upgrade_python
- name: Verify python 3.13 upgrade
- name: Verify Python 3.13 upgrade
assert:
that:
- upgrade_python.changed is true
@ -170,35 +179,35 @@
- upgrade_python.python_versions | length >= 1
- upgrade_python.python_paths | length >= 1
- name: Upgrade python 3.13 in check mode
- name: Upgrade Python 3.13 in check mode
uv_python:
version: 3.13
state: latest
check_mode: true
register: upgrade_python
- name: Verify python 3.13 upgrade in check mode
- name: Verify Python 3.13 upgrade in check mode
assert:
that:
- upgrade_python.changed is false
- upgrade_python.failed is false
- upgrade_python.python_versions | length >= 1
- name: Upgrade python 3.13 again
- name: Upgrade Python 3.13 again
uv_python:
version: 3.13
state: latest
check_mode: true
register: upgrade_python
- name: Verify python 3.13 upgrade again
- name: Verify Python 3.13 upgrade again
assert:
that:
- upgrade_python.changed is false
- upgrade_python.failed is false
- upgrade_python.python_versions | length >= 1
- name: Install unexisting python version in check mode
- name: Install unexisting Python version in check mode
uv_python:
version: 3.12.13
state: present
@ -206,46 +215,46 @@
ignore_errors: true
check_mode: true
- name: Verify unexisting python 3.12.13 install in check mode
- name: Verify unexisting Python 3.12.13 install in check mode
assert:
that:
- unexisting_python_check_mode.changed is false
- unexisting_python_check_mode.failed is true
- '"Version 3.12.13 is not available." in unexisting_python_check_mode.msg'
- name: Install unexisting python version
- name: Install unexisting Python version
uv_python:
state: present
version: 3.12.13
register: unexisting_python
ignore_errors: true
- name: Verify unexisting python 3.12.13 install
- name: Verify unexisting Python 3.12.13 install
assert:
that:
- unexisting_python.changed is false
- unexisting_python.failed is true
- name: Install unexisting python version with latest state
- name: Install unexisting Python version with latest state
uv_python:
version: 3.12.13
state: latest
register: unexisting_python
ignore_errors: true
- name: Verify python 3.12.13 install with latest state
- name: Verify Python 3.12.13 install with latest state
assert:
that:
- unexisting_python.changed is false
- unexisting_python.failed is true
- name: Delete python 3.13 version
- name: Delete Python 3.13 version
uv_python:
version: 3.13
state: absent
register: uninstall_result
- name: Verify python 3.13 deletion
- name: Verify Python 3.13 deletion
assert:
that:
- uninstall_result.changed is true