Commit Graph

3775 Commits (d3413372b42fef19b8a265f2b1cc44203aecda9d)
 

Author SHA1 Message Date
Lee Garrett d3413372b4 Allow running with ansible-core 2.19 6 months ago
Stefano Rivera 54ad3341f1 Support tox tests on ansible 12 alphas 6 months ago
Alex Willmer b382855aa2
Merge pull request #1269 from moreati/prep-0.3.24
Prep v0.3.24
6 months ago
Alex Willmer 65a81121c5 Begin 0.3.25dev 6 months ago
Alex Willmer 229fd67e97 Prepare v0.3.24 6 months ago
Alex Willmer 07028c190b
Merge pull request #1268 from moreati/stdio-no-no-no
mitogen: Only close stdio file descriptors that were open at process startup
6 months ago
Alex Willmer 566a4c1e3c mitogen: log child file objects rather than descriptors
The repr() of file objects is more self descriptive, and includes the fd.
6 months ago
Alex Willmer 6cec613daa mitogen: Only close stdio file descriptors that were open at process startup
File descriptors 0, 1, and 2 are usually stdin, stdout, stderr; but not
always. If a process is started without one of these then the first descriptor
allocated by the process opening a file or socket will be allocated an fd <=
STDERR_FILENO. This isn't common, but it does occur, e.g. Windows GUI apps
started without being connected to a console, controller side plugins run
under Ansible 12 (ansible-core 2.19).

In such cases the corresponding sys attribute (e.g. sys.stderr) will be None.

refs #1258

See also
- https://docs.python.org/3/library/sys.html#sys.__stdin__
- https://docs.ansible.com/ansible/devel/porting_guides/porting_guide_12.html#porting-guide-for-v12-0-0a1
- https://github.com/ansible/ansible/pull/82770
- https://github.com/python/typeshed/issues/11778
- https://gist.github.com/moreati/034fef45f73d809d9411a8a63eca34d6
6 months ago
Alex Willmer 49fea37879 mitogen: Use pty.STD*_FILENO constants
Makes it more obvious and easier to find where stdin, stdout, and stderr file
descriptors are being interacted with.
6 months ago
Alex Willmer 8faae13d7e mitogen: Improve readability of stderr initialisation in create_child()
There should be no behaviour change.
6 months ago
Alex Willmer ab63864ace CI: Fix indentation 6 months ago
Alex Willmer e19397ee59 CI: Timeout Linux jobs after 25 minutes
Some tests have been seen deadlocked. They continued running for an hour+,
until the default Github timeout. Linux timeout higher than macOS because the
Linux jobs run more tests.
6 months ago
Alex Willmer a00263d963 CI: Fix cosmetic typos in get_with_context() regression test 6 months ago
Alex Willmer 68f17420e2 CI: Name Ansible stack construction plays
Simplifies matching a failed test to the play/task.
6 months ago
Alex Willmer c31d902dc8 CI: Skip tests that require Mitogen when Ansible strategy is linear
The Van_* GitHub Actions jobs (corresponding to Tox factor strategy_linear,
environment variable ANSIBLE_STRATEGY=linear) were failing inside Mitogen
modules, which they should not touch. The jobs are intended as a cross
validation of the test suite, they should only fail if Ansible itself has a
problem.
6 months ago
Alex Willmer 4c41bf02f1 CI: Specify ANSIBLE_STRATEGY in tasks that run ansible or ansible-playbook
This makes the behaviour more consistent across jobs that run with
`mitogen_linear` or plain `linear`.
6 months ago
Alex Willmer a9048f0f7d CI: Use Ansible finished test (`result.finished` -> `result is finished`)
Required by Ansible 12 (ansible-core-2.19).

refs #1298
6 months ago
Alex Willmer 491d438427 CI: Add is_macos_controller Ansible variable for become_unpriv_available
This eliminates the need for ansible_facts to be gathered before
become_unpriv_available can be referenced.
6 months ago
Alex Willmer dcff603267
Merge pull request #1261 from moreati/prep-0.3.23
Prepare 0.3.23
7 months ago
Alex Willmer c146682e2e Begin 0.3.24dev 7 months ago
Alex Willmer 8e25944c94 Prepare v0.3.23 7 months ago
Alex Willmer 4a75648774 packaging: Fix InvalidVersion in release versions
fixes #1263
7 months ago
Alex Willmer fa28024810
Merge pull request #1257 from moreati/issue1256
CI: Upgrade Linux runner to Ubuntu 22.04 & 24.04
7 months ago
Alex Willmer 27b4b77bba CI: Upgrade Github jobs from Ubuntu 20.04 to 22.04 & 24.04
Python 2.7 (distro package) and 3.6 (pyenv managed) jobs run on Ubuntu 22.04.
More recent Pythons (distro or Github provided) run on 24.04.

fixes #1256

Ansible tasks that run locally (e.g. `connection: local`, `delegate_to:
localhost`) must now specify their `ansible_python_interpreter`, typically as
`{{ ansible_playbook_python }}`; otherwise the system Python on the controller
(e.g. `/usr/bin/python`) is likely to be used and this is often outside the
version range supported by the Ansible verison under test. If this occurs then
the symptom is often a failure to import a builtin from
`ansible.module_utils.six.moves`, e.g.

```
fatal: [target-centos6-1]: FAILED! => changed=true
  cmd:
  - ansible
  - -m
  - shell
  - -c
  - local
  - -a
  - whoami
  - -i
  - /tmp/mitogen_ci_ansibled3llejls/hosts
  - test-targets
  delta: '0:00:02.076385'
  end: '2025-04-17 17:27:02.561500'
  msg: non-zero return code
  rc: 8
  start: '2025-04-17 17:27:00.485115'
  stderr: |-
  stderr_lines: <omitted>
  stdout: |-
    An exception occurred during task execution. To see the full traceback,
    use -vvv. The error was:     from ansible.module_utils.six.moves import
    map, reduce, shlex_quote
```
7 months ago
Alex Willmer 1f737568b2 ci: Remove vestigial Python 2.7 support in macOS Github jobs 7 months ago
Alex Willmer 9b17f2839c ci: Label Github jobs by OS/distribution & Tox environment 7 months ago
Alex Willmer b130cd9f90
Merge pull request #1252 from moreati/issue1118-update-containers
CI: Mark and use 2021 test containers
9 months ago
Alex Willmer fdbd1a8c9b ci: Configure package managers using a role
This allows code sharing between integration tests and test image prep.
9 months ago
Alex Willmer 1e12edbf95 ci: Use file module to set mitogen__readonly_homedir permissions 9 months ago
Alex Willmer f2e0e552ac ci: Fix sshd configuration during image prep
This will allow image preparation using Ansible versions that
- predate ansible_facts.*
- predate loop keyword
- predate collections
9 months ago
Alex Willmer 20e23b5bd9 ci: Name all image prep plays 9 months ago
Alex Willmer 8e58c4a759 ci: Decouple image prep from Ansible controller reporting
This will allow image preparation using Ansible versions that predate
import_playbook.
9 months ago
Alex Willmer 67ececc804 ci: Use GitHub Container Registery images tagged 2021
Previously (and implicitly) used "latest". The tag 2021 is new today, the
image contents have not changed since they were generated in 2021.

They have moved container registry twice since 2021
- #791 Docker -> Amazon Elastic Container Registry (public.ecr.aws/n5z0e8q)
- #1128 Amazon ECR -> GitHub Container Registry (ghcr.io/mitogen-hq)

This commit also removes the last references to ECR.
9 months ago
Alex Willmer 0388cd5c0f
Merge pull request #1247 from moreati/issue-1118-ci_lib
CI: ci_lib cleanup
10 months ago
Alex Willmer a376daa04d CI: Consolidate directory path constants 10 months ago
Alex Willmer f659213159 CI: Don't share temporary directory between test groupings
Each grouping gets an independant dir, e.g.
 - ansible -> /tmp/mitogen_ci_ansible
 - debops -> /tmp/mitogen_ci_debops

Importing ci_lib no longer creates a temporary directory as a side effect.
10 months ago
Alex Willmer 620bc3a944 CI: Don't copy SSH private key to temporary dir
Running tests aren't using the copy & it wasn't being cleaned up.
10 months ago
Alex Willmer 2095342245 CI: Remove unused ci_lib.have_*() functions 10 months ago
Alex Willmer 2c7eda1dc1 CI: Fix NameError in ci_lib._have_cmd() 10 months ago
Alex Willmer 0b216c815a CI: Consolidate `apt-get install`s 10 months ago
Alex Willmer 26507481b1
Merge pull request #1246 from moreati/issue1118
CI: Test user creation tidy up
10 months ago
Alex Willmer 78b440104e CI: Validate sudoers file 10 months ago
Alex Willmer c92df356e6 CI: Consolidate sudoers config tasks 10 months ago
Alex Willmer 11d2d70fd8 CI: Use native Ansible support to hide macOS users 10 months ago
Alex Willmer 5283e6756b CI: Statically specify test usernames and group names
This makes it easier to grep for a username and to discover how the user was
create. Hence it should be easier to understand/debug tests.
10 months ago
Alex Willmer 913090ea7e
Merge pull request #1245 from moreati/issue1238
packaging: Avoid ast module, requires Python = 2.6
10 months ago
Alex Willmer a0d3858ff9 packaging: Avoid ast module, requires Python = 2.6
fixes #1238, refs #1236
10 months ago
Alex Willmer 77d87cd3cd
Merge pull request #1244 from moreati/issue1121
mitogen: cfmakeraw() cleanups
10 months ago
Alex Willmer 927fb172d8 mitogen: Log skipped termios attributes
refs #1121
10 months ago
Alex Willmer 5f42da36f3 mitogen: Deduplicate cfmakeraw() flags
refs #1121
10 months ago