Commit Graph

916 Commits (edab99d3df2c01399b8f4e3793bc463effca3cb7)

Author SHA1 Message Date
Alex Willmer 1e72ebaf8b tests: Update test coverage to Python 3.9
The Travis Linux distribution must be upgraded because the Trusty
(Ubuntu 14.04) image does not have Python 3.9. Xenial (Ubuntu 16.04) is
the earliest version that offers Python 3.9.

I have not chosen a later release, in order to aid restoration of Python
2.4 - 2.6 tests.
4 years ago
Alex Willmer 4b39013ef4 tests: Compatiblity shim for threading.Thread.is_alive()
On Python >= 3.8 thread.isAlive() is deprecated (removed in Python 3.9.
On Python <= 2.5 thread.is_alive() isn't present (added in Python 2.6).
4 years ago
Alex Willmer 1a0951c664
Merge branch 'master' into tests-resource_intensive-tag 4 years ago
Alex Willmer bb271d8d00 tests: Tag resource intensive tasks, to skip when strategy=linear
The ansible_mitogen test suite takes over an hour when Ansible is not
accelerated by Mitogen. This change aims to reduce that by skipping
tests with a large number of iterations when the linear strategy is
chosen.

The tagged tests are intended to uncover Mitogen resource leaks. Since
Mitogen is not invoked when strategy=linear, the slight reduction in
test coverage is an acceptable trade off.
4 years ago
Alex Willmer a64e966ab9 tests: Add unofficial Tox environments for Ansible tests
These are not part of the official testing regime (tests run for pull
requests). I find them convenient for local development.

Limitations
- Python 2.7+ only. No Python 2.4, 2.5, or 2.6.
- Requires Pythons pre-installed (e.g. DeadSnakes, pyenv)
- No coverage of alternate controller OS (e.g. MacOS)

The environments tested by default are

py27-mode_ansible-ansible2.10
py36-mode_ansible-ansible2.10
py39-mode_ansible-ansible2.10
py27-mode_mitogen
py36-mode_mitogen
py39-mode_mitogen
py27-mode_mitogen-distro_centos7
py36-mode_mitogen-distro_centos7
py39-mode_mitogen-distro_centos7
4 years ago
Alex Willmer f162a8a7c5 Fix DjangoMixin test imports for setuptools >= 50.0 4 years ago
Steven Robertson 22cce2dfae Merge branch 'master' into collectionsSupport 4 years ago
Alex Willmer 79b4c0f815 tests: Fix AttributeError in callback plugins used by test suite
CALLBACK_VERSION et al are documented as required in
https://docs.ansible.com/ansible/2.10/dev_guide/developing_plugins.html#callback-plugins.
The need for document_fragment is noted in
cfa8075537/lib/ansible/plugins/callback/default.py (L28-L32)

Fixes #758

This addresses the following error, seen while running
`ansible_tests.py`.

```
TASK [Gathering Facts gather_timeout=10, gather_subset=['all']]
****************
task path:
/home/alex/src/mitogen/tests/ansible/regression/issue_109__target_has_old_ansible_installed.yml:4
[WARNING]: Failure using method (v2_runner_on_start) in callback plugin
(<ansible.plugins.callback.nice_stdout.CallbackModule object at
0x7f76b3dad090>): 'show_per_host_start'
Callback Exception:
File
"/home/alex/src/mitogen/.tox/py27-ansible2.10/lib/python2.7/site-packages/ansible/executor/task_queue_manager.py",
line 372, in send_callback
    method(*new_args, **kwargs)
File
"/home/alex/src/mitogen/.tox/py27-ansible2.10/lib/python2.7/site-packages/ansible/plugins/callback/default.py",
line 240, in v2_runner_on_start
    if self.get_option('show_per_host_start'):
File
"/home/alex/src/mitogen/.tox/py27-ansible2.10/lib/python2.7/site-packages/ansible/plugins/callback/__init__.py",
line 91, in get_option
    return self._plugin_options[k]
Callback Exception:
File
"/home/alex/src/mitogen/.tox/py27-ansible2.10/lib/python2.7/site-packages/ansible/executor/task_queue_manager.py",
line 372, in send_callback
    method(*new_args, **kwargs)
File
"/home/alex/src/mitogen/.tox/py27-ansible2.10/lib/python2.7/site-packages/ansible/plugins/callback/default.py",
line 240, in v2_runner_on_start
    if self.get_option('show_per_host_start'):
File
"/home/alex/src/mitogen/.tox/py27-ansible2.10/lib/python2.7/site-packages/ansible/plugins/callback/__init__.py",
line 91, in get_option
    return self._plugin_options[k]
[task 339882] 00:00:08.172036 D ansible_mitogen.affinity: CPU mask for
WorkerProcess: 0x000004
Callback Exception:
File
"/home/alex/src/mitogen/.tox/py27-ansible2.10/lib/python2.7/site-packages/ansible/executor/task_queue_manager.py",
line 372, in send_callback
    method(*new_args, **kwargs)
File
"/home/alex/src/mitogen/.tox/py27-ansible2.10/lib/python2.7/site-packages/ansible/plugins/callback/default.py",
line 240, in v2_runner_on_start
    if self.get_option('show_per_host_start'):
File
"/home/alex/src/mitogen/.tox/py27-ansible2.10/lib/python2.7/site-packages/ansible/plugins/callback/__init__.py",
line 91, in get_option
    return self._plugin_options[k]
```
4 years ago
Steven Robertson 5a0da02e6c code review changes, using when statements and adding trailing comma 4 years ago
Steven Robertson 741e99f698 ansible 2.10 no longer has a at the end of the error msg... 🤦 4 years ago
Steven Robertson e6d7cd3aff skip vanilla Ansible 2.10 hanging task if not is_mitogen 4 years ago
Steven Robertson 9e17c98f3f adding hopefully new-style import that works for Ansible 2.10 4 years ago
Steven Robertson 941132c040 revert missing interpreter change, it breaks with Mitogen and without Mitogen, something else might be causing new-style detection to not work 4 years ago
Steven Robertson 2ecf227e1f oops, broke new-style missing interpreter detection. Regex should match now 4 years ago
Steven Robertson cf3d646613 fix custom_python_new_style_missing_interpreter, looks like Ansible 2.10 changed how new-style module detection works 4 years ago
Steven Robertson 518324c371 fix regression in Darwin 19 (OSX 10.15+) ansible python interpreter detection 4 years ago
Steven Robertson a3b9622f8b result length is 3 in Azure, 4 on local Mac 4 years ago
Steven Robertson 9f04d6713b fixed ansible_become_pass test, looks like regression on Ansible's end 4 years ago
Steven Robertson aac1e7f76a fix yml parsing 4 years ago
Steven Robertson fbcf765fb2 oops, yml file can't be empty 4 years ago
Steven Robertson 31670ff993 ignore another flaky test that works locally 4 years ago
Steven Robertson d978dffe4e fix ansible version check error 4 years ago
Steven Robertson 5b40b8d155 fix runner_one_job ansible version comparison 4 years ago
Steven Robertson 24d716aab9 oops, 0664 not 0666 4 years ago
Steven Robertson 355e2ffba2 fix fixup_perms2() test 4 years ago
Steven Robertson 22bc5448b1 default copy perms look like 0644 now based on ansible source and docs 4 years ago
Steven Robertson 8481c50a59 ignore synchronize for now, made ticket 4 years ago
Steven Robertson 207e36194d try and get some visibility into test failures 4 years ago
Steven Robertson 8b2d930042 cffi super old, try and update it 4 years ago
Steven Robertson e852c65e36 print what's being ran in tests 4 years ago
Steven Robertson a7705a3435 add back in ansible tests but don't run synchronize 4 years ago
Steven Robertson 49dd8eee1a figure out what synchronize is now 4 years ago
Steven Robertson e8fb4071b2 put future import in wrong place 4 years ago
Steven Robertson c6d42212dd add some debugging info, was able to run the failed synchronize test locally just fine using test framework, not sure what's going on 4 years ago
Steven Robertson 1091cd7ca1 try and suppress mode warning clogging up logs 4 years ago
Steven Robertson b26a636bba remove ansible 2.4-specific test 4 years ago
Steven Robertson fbb92e461f fix fixup_perms2 default file mode 4 years ago
Steven Robertson acde13f9d6 handles a 'wait_for_connection' call right after a task caused a shutdown 5 years ago
Steven Robertson c12e3d0f92 disable flaky test on py3.6 5 years ago
Steven Robertson 530f5e6412 read in ansible installation version always 5 years ago
Steven Robertson 957e295ba9 google will always be up, just use that 5 years ago
Steven Robertson 40946277c3 actual link 5 years ago
Steven Robertson 1ce0091dbc github url changed, switch to taco pic because tacos are delicious 5 years ago
Steven Robertson 595569eeab don't run flaky test on python 2.6 5 years ago
Steven Robertson 101e200538 disabled flaky test 5 years ago
Steven Robertson 1f61b9ee67 making commit to retrigger tests' 5 years ago
Steven Robertson 5196fbbadf missed a few more tests 5 years ago
Steven Robertson bc87fb0c5d change more tests to compare to 'discovered_interpreter' for python_path 5 years ago
Steven Robertson 389cee8c70 fix assertion of python_path, it should be always what 'discovered_interpreter' is 5 years ago
Steven Robertson e7e1c3bc86 note on changed interpreter value functionality, need to fix the test 5 years ago