Should result in
- better isolation of faults
- easier retries of failed jobs
- quicker test completion, to to more efficient queueing.
This does not expand test coverage, merely rearranges the tests already run.
Also
- Simplifies adding support for additional Ansible versions
- Unifies Python package versioning in CI and local test environments
- Matches Python versions tested, with those declared in setup.py
- Expands targets covered by automated Ansible tests to
- centos6, centos8
- debian9, debian11
- ubuntu1604, ubuntu2004
This reverse shell was historically used to debug CI jobs interactively.
It is not used anymore, and may be causing jobs to hang, then timeout.
There is no reason to keep it, and removing it simplifies CI jobs.
Additionally it has been reported as flagged by security scanners, so
removing it makes Mitogen easier to package/adopt.
fixes#847
Attempt to fix
Collecting hdrhistogram==0.6.1 (from -r tests/ansible/requirements.txt
(line 2))
Downloading
2422ad2ad90047d3b9f73061e8696f/hdrhistogram-0.6.1.tar.gz
(61kB)
Complete output from command python setup.py egg_info:
Couldn't find index page for 'pbr' (maybe misspelled?)
sources=['src/python-codec.c'])]
File "/usr/lib/python3.5/distutils/core.py", line 108, in setup
_setup_distribution = dist = klass(attrs)
File "/tmp/venv/lib/python3.5/site-packages/setuptools/dist.py",
line 315, in __init__
self.fetch_build_eggs(attrs['setup_requires'])
File "/tmp/venv/lib/python3.5/site-packages/setuptools/dist.py",
line 361, in fetch_build_eggs
replace_conflicting=True,
File
"/tmp/venv/lib/python3.5/site-packages/pkg_resources/__init__.py", line
850, in resolve
dist = best[req.key] = env.best_match(req, ws, installer)
File
"/tmp/venv/lib/python3.5/site-packages/pkg_resources/__init__.py", line
1122, in best_match
return self.obtain(req, installer)
File
"/tmp/venv/lib/python3.5/site-packages/pkg_resources/__init__.py", line
1134, in obtain
return installer(requirement)
File "/tmp/venv/lib/python3.5/site-packages/setuptools/dist.py",
line 429, in fetch_build_egg
return cmd.easy_install(req)
File
"/tmp/venv/lib/python3.5/site-packages/setuptools/command/easy_install.py",
line 659, in easy_install
raise DistutilsError(msg)
distutils.errors.DistutilsError: Could not find suitable
distribution for Requirement.parse('pbr')
A few changes are bundled in this
- Ansible 2.10.x and Mitogen 0.3.x are used to build nearly all images
(Ansile 2.3.x is retained for CentOS 5, because it uses Python 2.4).
- Tox is used to install/run Ansible, replacing build_docker_images.py
- A static inventory, identifying containers by name rather than ID.
- debian-test image is renamed to debian9-test
- debian9-test image is now based on debian:9
- centos6-test image is now based on moreati/centos6-vault
following the same scheme as centos5-test.
- Images are now uploaded to Amazon Elastic Container Registry (ECR).
See #809.
- Debian recommended packages aren't installed (e.g. build-essential)
- Python 2.x and Python 3.x are installed wherever available.
- Python Virtualenv is installed wherever available.
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.
I hope this will prevent AWS Elastic Container Registry returning 429:
Too Many Requests error, due to the burst of activity from multiple VMs,
when a CI build begins.
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.
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
The environment variable DISTRO is used to set the target Docker image
used when running the Mitogen unit tests. DISTROS is used for the
Ansible integration tests. VER sets the version of Ansible that is
installed on the controller.
When MODE=Mitogen
- there is no need to set VER, because nothing that installs Ansible
- it does not make sense to set DISTROS.