From 9609437262554e46ce807c19b6bfd91345ee69ef Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Tue, 25 Nov 2025 08:26:12 +0000 Subject: [PATCH] CI: Use 2025.02 test images, keeping same OS releases MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit centos8-test:2025.02 no longer has a /usr/bin/python installed, so use centos8-py3 target which sets `ansible_python_interpreter=/usr/bin/python3` in the templated inventory. Ansible <= 9 (ansible-core <= 2.6) now discover the interpreter as /usr/bin/python3 on debian11-test:2025.02, as opposed to /usr/bin/python3.9 on debian11-test:2021. I'm don't know the exact cause. From manual tests the change in observed behaviour appears to be common to vanilla Ansible (strategy=linear) and Mitogen flavour (strategy=mitogen_linear). ```console (ans9) ➜ mitogen git:(4efb7158) ✗ ANSIBLE_STRATEGY=mitogen_linear ANSIBLE_STRATEGY_PLUGINS=ansible_mitogen/plugins/strategy ans9/bin/ansible -e ansible_python_interpreter=auto -mping d11.lan d11.lan | SUCCESS => { "ansible_facts": { "discovered_interpreter_python": "/usr/bin/python3" }, "changed": false, "ping": "pong" } (ans9) ➜ mitogen git:(4efb7158) ✗ ans9/bin/ansible -e ansible_python_interpreter=auto -mping d11.lan d11.lan | SUCCESS => { "ansible_facts": { "discovered_interpreter_python": "/usr/bin/python3" }, "changed": false, "ping": "pong" } ``` Update some tests which assume `/usr/bin/python` exists or that `env python` will resolve successfully. --- .ci/ci_lib.py | 8 ++++---- docs/changelog.rst | 2 ++ .../interpreter_discovery/ansible_2_8_tests.yml | 4 ++-- .../regression/issue_122__environment_difference.yml | 11 +++++++---- tests/testlib.py | 4 ++-- tox.ini | 9 +++++---- 6 files changed, 22 insertions(+), 16 deletions(-) diff --git a/.ci/ci_lib.py b/.ci/ci_lib.py index c50c76da..06867c33 100644 --- a/.ci/ci_lib.py +++ b/.ci/ci_lib.py @@ -34,12 +34,12 @@ ANSIBLE_TESTS_HOSTS_DIR = os.path.join(GIT_ROOT, 'tests/ansible/hosts') ANSIBLE_TESTS_TEMPLATES_DIR = os.path.join(GIT_ROOT, 'tests/ansible/templates') DISTRO_SPECS = os.environ.get( 'MITOGEN_TEST_DISTRO_SPECS', - 'centos6 centos8 debian9 debian11 ubuntu1604 ubuntu2004', + 'centos6 centos8-py3 debian9 debian11 ubuntu1604 ubuntu2004', ) IMAGE_PREP_DIR = os.path.join(GIT_ROOT, 'tests/image_prep') IMAGE_TEMPLATE = os.environ.get( 'MITOGEN_TEST_IMAGE_TEMPLATE', - 'ghcr.io/mitogen-hq/%(distro)s-test:2021', + 'ghcr.io/mitogen-hq/%(distro)s-test:2025.02', ) SUDOERS_DEFAULTS_SRC = './tests/image_prep/files/sudoers_defaults' SUDOERS_DEFAULTS_DEST = '/etc/sudoers.d/mitogen_test_defaults' @@ -231,7 +231,7 @@ def container_specs( [{'distro': 'debian11', 'family': 'debian', 'hostname': 'localhost', - 'image': 'ghcr.io/mitogen-hq/debian11-test:2021', + 'image': 'ghcr.io/mitogen-hq/debian11-test:2025.02', 'index': 1, 'name': 'target-debian11-1', 'port': 2201, @@ -239,7 +239,7 @@ def container_specs( {'distro': 'centos6', 'family': 'centos', 'hostname': 'localhost', - 'image': 'ghcr.io/mitogen-hq/centos6-test:2021', + 'image': 'ghcr.io/mitogen-hq/centos6-test:2025.02', 'index': 2, 'name': 'target-centos6-2', 'port': 2202, diff --git a/docs/changelog.rst b/docs/changelog.rst index ad11c08f..b8f59f59 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -21,6 +21,8 @@ To avail of fixes in an unreleased version, please download a ZIP file In progress (unreleased) ------------------------ +* :gh:issue:`1118` CI: Use 2025.02 test images, keeping same OS releases + v0.3.33 (2025-11-22) -------------------- diff --git a/tests/ansible/integration/interpreter_discovery/ansible_2_8_tests.yml b/tests/ansible/integration/interpreter_discovery/ansible_2_8_tests.yml index 451b4dc3..403f7848 100644 --- a/tests/ansible/integration/interpreter_discovery/ansible_2_8_tests.yml +++ b/tests/ansible/integration/interpreter_discovery/ansible_2_8_tests.yml @@ -13,7 +13,7 @@ debian: '9': /usr/bin/python '10': /usr/bin/python3 - '11': /usr/bin/python + '11': /usr/bin/python3 'NA': /usr/bin/python # Debian 11, Ansible <= 7 (ansible-core <= 2.14) 'bullseye/sid': /usr/bin/python # Debian 11, Ansible 8 - 9 (ansible-core 2.15 - 2.16) ubuntu: @@ -29,7 +29,7 @@ debian: '9': /usr/bin/python '10': /usr/bin/python3 - '11': /usr/bin/python3.9 + '11': /usr/bin/python3 'NA': /usr/bin/python3.9 # Debian 11, Ansible <= 7 (ansible-core <= 2.14) 'bullseye/sid': /usr/bin/python3.9 # Debian 11, Ansible 8 - 9 (ansible-core 2.15 - 2.16) ubuntu: diff --git a/tests/ansible/regression/issue_122__environment_difference.yml b/tests/ansible/regression/issue_122__environment_difference.yml index 273a49ae..510dbf86 100644 --- a/tests/ansible/regression/issue_122__environment_difference.yml +++ b/tests/ansible/regression/issue_122__environment_difference.yml @@ -8,9 +8,12 @@ - name: regression/issue_122__environment_difference.yml hosts: test-targets tasks: - - - script: scripts/print_env.py - register: env - - debug: msg={{env}} + - name: Run print_env.py + script: + cmd: scripts/print_env.py + executable: "{{ ansible_python_interpreter | default(ansible_facts.discovered_interpreter_python) }}" + register: print_env_result + - debug: + var: print_env_result tags: - issue_122 diff --git a/tests/testlib.py b/tests/testlib.py index 3b5dc8b6..803159a3 100644 --- a/tests/testlib.py +++ b/tests/testlib.py @@ -53,11 +53,11 @@ LOG = logging.getLogger(__name__) DISTRO_SPECS = os.environ.get( 'MITOGEN_TEST_DISTRO_SPECS', - 'centos6 centos8 debian9 debian11 ubuntu1604 ubuntu2004', + 'centos6 centos8-py3 debian9 debian11 ubuntu1604 ubuntu2004', ) IMAGE_TEMPLATE = os.environ.get( 'MITOGEN_TEST_IMAGE_TEMPLATE', - 'ghcr.io/mitogen-hq/%(distro)s-test:2021', + 'ghcr.io/mitogen-hq/%(distro)s-test:2025.02', ) TESTS_DIR = os.path.join(os.path.dirname(__file__)) diff --git a/tox.ini b/tox.ini index c2a51dda..b2974332 100644 --- a/tox.ini +++ b/tox.ini @@ -123,10 +123,11 @@ setenv = ans{2.10,3,4,5}: ANSIBLE_STDOUT_CALLBACK=yaml # Print warning on the first occurence at each module:linenno in Mitogen. Available Python 2.7, 3.2+. PYTHONWARNINGS=default:::ansible_mitogen,default:::mitogen + ans{2.10,3,4,5}: MITOGEN_TEST_DISTRO_SPECS=centos6 centos8-py3 debian9 debian11 ubuntu1604 ubuntu2004 # Ansible 6 - 8 (ansible-core 2.13 - 2.15) require Python 2.7 or >= 3.5 on targets - ans{6,7,8}: MITOGEN_TEST_DISTRO_SPECS=centos7 centos8 debian9 debian10 debian11 ubuntu1604 ubuntu1804 ubuntu2004 + ans{6,7,8}: MITOGEN_TEST_DISTRO_SPECS=centos7 centos8-py3 debian9 debian10 debian11 ubuntu1604 ubuntu1804 ubuntu2004 # Ansible 9 (ansible-core 2.16) requires Python 2.7 or >= 3.6 on targets - ans9: MITOGEN_TEST_DISTRO_SPECS=centos7 centos8 debian9 debian10 debian11 ubuntu1804 ubuntu2004 + ans9: MITOGEN_TEST_DISTRO_SPECS=centos7 centos8-py3 debian9 debian10 debian11 ubuntu1804 ubuntu2004 # Ansible 10 (ansible-core 2.17) requires Python >= 3.7 on targets ans10: MITOGEN_TEST_DISTRO_SPECS=debian10-py3 debian11-py3 ubuntu2004-py3 # Ansible 11 (ansible-core 2.18) requires Python >= 3.8 on targets @@ -134,11 +135,11 @@ setenv = ans12: MITOGEN_TEST_DISTRO_SPECS=debian11-py3 ubuntu2004-py3 # Ansible 13 (ansible-core 2.20) requires Python >= 3.9 on targets ans13: MITOGEN_TEST_DISTRO_SPECS=debian11-py3 - distros_centos: MITOGEN_TEST_DISTRO_SPECS=centos6 centos7 centos8 + distros_centos: MITOGEN_TEST_DISTRO_SPECS=centos6 centos7 centos8-py3 distros_centos5: MITOGEN_TEST_DISTRO_SPECS=centos5 distros_centos6: MITOGEN_TEST_DISTRO_SPECS=centos6 distros_centos7: MITOGEN_TEST_DISTRO_SPECS=centos7 - distros_centos8: MITOGEN_TEST_DISTRO_SPECS=centos8 + distros_centos8: MITOGEN_TEST_DISTRO_SPECS=centos8-py3 distros_debian: MITOGEN_TEST_DISTRO_SPECS=debian9 debian10 debian11 distros_debian9: MITOGEN_TEST_DISTRO_SPECS=debian9 distros_debian10: MITOGEN_TEST_DISTRO_SPECS=debian10