Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .ci/ansible_install.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env python
# SPDX-FileCopyrightText: 2026 Mitogen authors <https://github.com/mitogen-hq>
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import absolute_import, division, print_function

import ci_lib
from ci_lib import subprocess

with ci_lib.Fold('ansible_prep'):
subprocess.check_call(
['ansible-galaxy', 'collection', 'install', '-r', ci_lib.ANSIBLE_TESTS_REQUIREMENTS],
)
1 change: 1 addition & 0 deletions .ci/ci_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
GIT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
ANSIBLE_TESTS_DIR = os.path.join(GIT_ROOT, 'tests/ansible')
ANSIBLE_TESTS_HOSTS_DIR = os.path.join(GIT_ROOT, 'tests/ansible/hosts')
ANSIBLE_TESTS_REQUIREMENTS = os.path.join(GIT_ROOT, 'tests/ansible/requirements.yml')
ANSIBLE_TESTS_TEMPLATES_DIR = os.path.join(GIT_ROOT, 'tests/ansible/templates')
DISTRO_SPECS = os.environ.get(
'MITOGEN_TEST_DISTRO_SPECS',
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ jobs:
python_version: '3.11'
- tox_env: py311-m_ans-ans5
python_version: '3.11'
- tox_env: py313-m_ans-ans6
python_version: '3.13'
- tox_env: py313-m_ans-ans7
python_version: '3.13'
- tox_env: py311-m_ans-ans6
python_version: '3.11'
- tox_env: py311-m_ans-ans7
python_version: '3.11'
- tox_env: py313-m_ans-ans8
python_version: '3.13'
- tox_env: py314-m_ans-ans9
Expand Down
2 changes: 2 additions & 0 deletions tests/ansible/integration/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
tags: async
- import_playbook: become/all.yml
tags: become
- import_playbook: collections/all.yml
tags: collections
- import_playbook: connection/all.yml
tags: connection
- import_playbook: connection_delegation/all.yml
Expand Down
4 changes: 4 additions & 0 deletions tests/ansible/integration/collections/all.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# SPDX-FileCopyrightText: 2026 Mitogen authors <https://github.com/mitogen-hq>
# SPDX-License-Identifier: BSD-3-Clause

- import_playbook: smoke.yml
10 changes: 10 additions & 0 deletions tests/ansible/integration/collections/smoke.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# SPDX-FileCopyrightText: 2026 Mitogen authors <https://github.com/mitogen-hq>
# SPDX-License-Identifier: BSD-3-Clause

- name: integration/collections/smoke.yml
hosts: test-targets
gather_facts: false
become: false
tasks:
- name: Check basic import and execution
moreati.test_artifacts.warn:
1 change: 1 addition & 0 deletions tests/ansible/regression/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- import_playbook: issue_591__setuptools_cwd_crash.yml
- import_playbook: issue_615__streaming_transfer.yml
- import_playbook: issue_655__wait_for_connection_error.yml
- import_playbook: issue_672__relative_imports.yml
- import_playbook: issue_766__get_with_context.yml
- import_playbook: issue_776__load_plugins_called_twice.yml
- import_playbook: issue_952__ask_become_pass.yml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

- name: regression/issue_1477__task_warnings_persist.yml
# Check warnings emitted by one task don't persist into another
hosts: localhost
hosts: test-targets
gather_facts: false
become: false
tasks:
Expand Down
13 changes: 13 additions & 0 deletions tests/ansible/regression/issue_672__relative_imports.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# SPDX-FileCopyrightText: 2026 Mitogen authors <https://github.com/mitogen-hq>
# SPDX-License-Identifier: BSD-3-Clause

- name: regression/issue_672__relative_imports.yml
# Check Ansible modules containing relative imports - direct or indirect
hosts: test-targets
gather_facts: false
become: false
tasks:
- name: Trigger relative imports
moreati.test_artifacts.relative_imports:
tags:
- issue_672
6 changes: 6 additions & 0 deletions tests/ansible/requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# SPDX-FileCopyrightText: 2026 Mitogen authors <https://github.com/mitogen-hq>
# SPDX-License-Identifier: BSD-3-Clause

collections:
- name: moreati.test_artifacts
version: ">=0.2.1"
2 changes: 2 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,10 @@ deps =
install_command =
python -m pip --no-python-version-warning --disable-pip-version-check install {opts} {packages}
commands_pre =
m_ans: {toxinidir}/.ci/ansible_install.py
m_ans: {toxinidir}/.ci/container_images_install.py
mode_debops_common: {toxinidir}/.ci/debops_common_install.py
m_lcl: {toxinidir}/.ci/ansible_install.py
m_lcl: {toxinidir}/.ci/localhost_ansible_install.py
m_mtg: {toxinidir}/.ci/container_images_install.py
commands =
Expand Down
Loading