Commit Graph

620 Commits (fd1935048c47ac3e13e972b47e9eaf9bcdce6da8)

Author SHA1 Message Date
Matt Clay fd1935048c
Update mypy test. Fix type hints for Python 3.9. (#78587)
This also bumps the minimum controller version (for mypy only) to Python 3.9.

(cherry picked from commit cc5ac88c4c)
3 years ago
Matt Clay d6b40a5bc6
[stable-2.13] ansible-test - Fix ansible-doc sanity test FQCN. (#78518). (#78519)
(cherry picked from commit 2b63fdd1b8)
3 years ago
Matt Clay 9ec6e331bf
[stable-2.13] ansible-test - Fix self-test change handling. (#78521) (#78523)
(cherry picked from commit 99016653a2)
3 years ago
Matt Clay 426e4899a3
[stable-2.13] ansible-test - Parse content config only once. (#78418) (#78426)
(cherry picked from commit f2abfc4b3d)
3 years ago
Matt Clay 24359537bb [stable-2.13] ansible-test - Fix TTY and output handling. (#78350).
(cherry picked from commit a3c90dd0bc)

Co-authored-by: Matt Clay <matt@mystile.com>
3 years ago
Matt Clay 4bb1907084 [stable-2.13] ansible-test - Fix handling of args after `--` (#78328)
(cherry picked from commit 0012263c7a)

Co-authored-by: Matt Clay <matt@mystile.com>
3 years ago
Matt Clay 99217ca2b6 [stable-2.13] ansible-test - Improve pip bootstrap download.
(cherry picked from commit b9d13d222c)

Co-authored-by: Matt Clay <matt@mystile.com>
4 years ago
Sandra McCann f09e6b7769
Backportapalooza 06 16 (#78072)
* Docsite: Updated style guide resources (#78048)

(cherry picked from commit 561cf1956d)

* Create reusable role layout snippet for documentation (#78057)

* reuse role structure
* reuse role snippet in role docs

(cherry picked from commit f4ad1c771e)

* Docsite: update links to community docs (#78043)

(cherry picked from commit 46d86a882d)

* Windows - incorrect python-devel package in WinRM docs (#78037)

Co-authored-by: Emanuele Barbato <manu@Giuseppes-MacBook-Air.local>
(cherry picked from commit 681dc6eab9)

* issue #72449 winrm script rm (#77931)

(cherry picked from commit 3cd2c494bd)

* reword the regex note (#75393)

Co-authored-by: Matt Martz <matt@sivel.net>
Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>
(cherry picked from commit 66c0882314)

* Document debconf interaction with dpkg-reconfigure (#74196)

Signed-off-by: David Greaves <david@dgreaves.com>
(cherry picked from commit 5b90601ca4)

Co-authored-by: Lewis Brogan <ilewisbrogan@gmail.com>
Co-authored-by: Andrew Klychkov <aklychko@redhat.com>
Co-authored-by: Emanuele Barbato <30394740+emanuelebarbato@users.noreply.github.com>
Co-authored-by: Don Naro <dnaro@redhat.com>
Co-authored-by: David Greaves <david@dgreaves.com>
4 years ago
Sloane Hertel cf5c0c9b06
ansible-galaxy - support resolvelib versions >= 0.5.3, < 0.9.0 (#77649) (#78008)
* ansible-galaxy - support resolvelib versions >= 0.5.3, <= 0.8.1

Test incompatibilities are removed for resolvelib >= 0.6.0

Test against the latest 0.8.x version and fix requirements

* Fix tests - use a venv for testing the range of resolvelib versions

* Update temporary hardcoded fallback for ansible-test

* Update hardcoded upperbound for sanity tests

* Make error check more flexible

(cherry picked from commit 143e7fb45e)
4 years ago
Sloane Hertel 0c76edb63a
Pin PyYAML version compatible with Python 3.8+ (#77936) (#77986)
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
Co-authored-by: Matt Clay <matt@mystile.com>
(cherry picked from commit e89176caac)
4 years ago
Matt Clay 567a295c00
[stable-2.13] ansible-test - Adjust unit test mock usage. (#77961) (#77999)
(cherry picked from commit 23914d3f0b)

Co-authored-by: Matt Clay <matt@mystile.com>
4 years ago
Matt Clay ae380e3bef
[stable-2.13] ansible-test - Multiple backports (#77951)
* ansible-test - Backport `InternalError`

NOTE: This is a partial backport, including only one new class.

(cherry picked from commit b960641759)

* ansible-test - Fix subprocess management. (#77641)

* Run code-smell sanity tests in UTF-8 Mode.
* Update subprocess use in sanity test programs.
* Use raw_command instead of run_command with always=True set.
* Add more capture=True usage.
* Don't expose stdin to subprocesses.
* Capture more output. Warn on retry.
* Add more captures.
* Capture coverage cli output.
* Capture windows and network host checks.
* Be explicit about interactive usage.
* Use a shell for non-captured, non-interactive subprocesses.
* Add integration test to assert no TTY.
* Add unit test to assert no TTY.
* Require blocking stdin/stdout/stderr.
* Use subprocess.run in ansible-core sanity tests.
* Remove unused arg.
* Be explicit with subprocess.run check=False.
* Add changelog.
* Use a Python subprocess instead of a shell.
* Use InternalError instead of Exception.
* Require capture argument.
* Check for invalid raw_command arguments.
* Removed pointless communicate=True usage.
* Relocate stdout w/o capture check.
* Use threads instead of a subprocess for IO.

(cherry picked from commit 5c2d830dea)

* ansible-test - Add support for remote Ubuntu VMs.

(cherry picked from commit 6513453310)

* ansible-test - Fix remote completion validation.

(cherry picked from commit e2200e8dfc)

* ansible-test - Add multi-arch remote support.

(cherry picked from commit 2cc74b04c4)

* ansible-test - Enhance the shell command. (#77734)

* ansible-test - Add shell --export option.

* ansible-test - Support cmd args for shell command.

Also allow shell to be used without a valid layout if no delegation is required.

* ansible-test - Improve stderr/stdout consistency.

By default all output goes to stdout only, with the exception of a fatal error.

When using any of the following, all output defaults to stderr instead:

* sanity with the `--lint` option -- sanity messages to stdout
* coverage analyze -- output to stdout if the output file is `/dev/stdout`
* shell -- shell output to stdout

This fixes issues two main issues:

* Unpredictable output order when using both info and error/warning messages.
* Mixing of lint/command/shell output with bootstrapping messages on stdout.

* ansible-test - Add changelog fragment.

(cherry picked from commit fe349a1ccd)

* ansible-test - Fix remote args restriction.

The platform-specific and global fallbacks were not working with the `--remote` option.

This regression was introduced by https://github.com/ansible/ansible/pull/77711

(cherry picked from commit 76ead1e768)
4 years ago
Matt Clay 2ac74197af [stable-2.13] ansible-test - Prefer unittest.mock for core.
(cherry picked from commit 81351022d8)

Co-authored-by: Matt Clay <matt@mystile.com>
4 years ago
Matt Clay 44ce9fe998 [stable-2.13] ansible-test - Fix shell target options handling.
(cherry picked from commit f933314101)

Co-authored-by: Matt Clay <matt@mystile.com>
4 years ago
Matt Clay 2b6df9ea36
Add RHEL 9.0 to ansible-test and CI. (#77923)
* ansible-test - Add RHEL 9.0 remote support.

* Add RHEL 9.0 to CI. (#77853)

* Add RHEL 9.0 to CI.

* Restrict network manager inspection to RHEL8

* Skip module tests when astream_name is undefined, undefine it for RHEL9 until 9.1

* Remove redundant test.

Co-authored-by: Matt Martz <matt@sivel.net>
(cherry picked from commit 43d650f924)

* Include test fix from https://github.com/ansible/ansible/pull/77847
4 years ago
Matt Clay 9a7b645c50 ansible-test - Update default containers to 5.9.0. 4 years ago
Matt Martz 30f96bb75e
[stable-2.13] ansible-test - Don't fail if network cannot be disconnected (#77472) (#77482)
* Don't fail if network cannot be disconnected

* add clog frag
(cherry picked from commit 66c5844)

Co-authored-by: Matt Martz <matt@sivel.net>
4 years ago
Matt Clay 3b20b02272
[stable-2.13] Fix sanity test crash. (#77475)
(cherry picked from commit 6216c9fc93)

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
4 years ago
Matt Clay ee9705a1ce [stable-2.13] ansible-test - Fix origin host target filtering.
(cherry picked from commit 4b51e61645)

Co-authored-by: Matt Clay <matt@mystile.com>
4 years ago
Matt Clay 708e4c206a ansible-test - Update default test containers. 4 years ago
Felix Fontein 7075fa36a1
Bump requirements for antsibull to 0.42.0 (which depends on antsibull-changelog >= 0.14.0). (#77362) 4 years ago
Matt Clay 55f90ba31f ansible-test - Remove RHEL 9.0b support.
Support can be restored once RHEL 9 has been released.
4 years ago
Sloane Hertel 2769f5621b
Add find_spec and exec_module to RestrictedModuleLoader (#76427)
* Add find_spec and exec_module to RestrictedModuleLoader

* Fix getting new loader with correct path

Fix pep8 errors

* Use convert_ansible_name_to_absolute_paths instead of the loader path

* Apply suggestions from code review

* Fix type hints and test them in CI

* Fix error message for ansible.module_utils.basic if it's missing

Add mypy ignored missing imports for controller sanity tests

* Add mypy attr-defined ignore entries for python 3.8, 3.9, 3.10 for vendored six

Add mypy attr-defined ignore for python 2.7 in lib/ansible/utils/collection_loader/_collection_finder.py

* Just test controller python versions to simplify ignoring mypy errors
4 years ago
Abhijeet Kasurde 1100289a45
docker_util: Handle error in JSON parsing (#77298)
While getting hostname from container, podman command
fails to return JSON so wrap exception and return
hostname as 'None'

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
4 years ago
Felix Fontein 4d984613f5
validate-modules for plugins: do some more schema validations so that some issues that are currently reported for modules are also reported for plugins (#77268)
* Add more sanity tests on schema level (so they also work for plugins).

* Fix various issues the sanity test reported.

* Add changelog fragment.

* Fix function name.
4 years ago
Matt Clay e8afdac06e ansible-test - Fix delegation inventory path. 4 years ago
Matt Martz 7cb581ed2c
Support podman-remote in ansible-test (#75753) 4 years ago
Matt Clay 0c514bcf54 ansible-test - Fix PS coverage `--all` generation. 4 years ago
Matt Clay f68c66a3ef Remove collections compat from controller code. 4 years ago
Matt Clay f43c54d890 ansible-test - Update default containers to 5.7.0. 4 years ago
Matt Clay 3d5637beec Initial mypy sanity test support for core. 4 years ago
Felix Fontein 0990c4ca7c
Extend validate-modules to also validate plugins (#71734)
* Let validate-modules also validate plugins.

* Support 'option' in 'cli'.

* Use DOCUMENTABLE_PLUGINS instead of UNDOCUMENTED_PLUGIN_TYPES.

* Support 'keyword', clean up error codes.

* Call settings.process_errors only once; remove __version__.

* Add changelog fragment.
4 years ago
Matt Clay af2b1361ff ansible-test - Simplify type hints. 4 years ago
Matt Clay a06fa496d3
ansible-test - Code cleanup and refactoring. (#77169)
* Remove unnecessary PyCharm ignores.
* Ignore intentional undefined attribute usage.
* Add missing type hints. Fix existing type hints.
* Fix docstrings and comments.
* Use function to register completion handler.
* Pass strings to display functions.
* Fix CompositeAction handling of dest argument.
* Use consistent types in expressions/assignments.
* Use custom function to keep linters happy.
* Add missing raise for custom exception.
* Clean up key/value type handling in cloud plugins.
* Use dataclass instead of dict for results.
* Add custom type_guard function to check lists.
* Ignore return type that can't be checked (yet).
* Avoid changing types on local variables.
4 years ago
Matt Clay dc6b0d4857 ansible-test - Remove obsolete display of MAXFD.
Use of ``subprocess.MAXFD`` only worked on Python 2.x, which is no longer supported.
4 years ago
Matt Martz bdf37336c8
Update pylint deprecated plugin to use ansible-invalid* symbols (#77086) 4 years ago
Matt Clay 4f9c7fd509 ansible-test - Remove validate-modules symlink. 4 years ago
Matt Clay 5a6e05affb More strict pylint checking of ansible-test code. 4 years ago
Matt Clay d3d5244912 ansible-test - Fail sanity test on distutils use. 4 years ago
Matt Clay d286c2e8b3 ansible-test - Fix CParser import in yamllint. 4 years ago
Matt Clay c27fd777f4 ansible-test - Use quay.io containers in plugins. 4 years ago
Matt Clay addb9baec2 ansible-test - Clean up venv code. 4 years ago
Matt Clay 13d5381e56
ansible-test - Update base and default containers. (#77033) 4 years ago
Matt Clay 68fb3bf90e
ansible-test - Fix consistency of managed venvs. (#77028) 4 years ago
Matt Clay ef4c5cd61b ansible-test - Use newer pip to bootstrap FreeBSD. 4 years ago
Matt Clay 0d40423f1c
ansible-test - Fix collection loader import. (#76986)
* ansible-test - Fix collection loader import.

Resolves https://github.com/ansible/ansible/issues/76960
4 years ago
Matt Clay 0d5401d950 ansible-test - Remove unused code.
This was overlooked in a previous commit that removed FreeBSD 12.2 support.
4 years ago
Matt Clay 00a2b7788e ansible-test - Remove cap on cryptography version. 4 years ago
Matt Clay e27b94c467 ansible-test - Update alpine3 container to 3.3.0.
This updates the base image from 3.14.2 to 3.15.0, which includes support for installing binary wheels using pip.
4 years ago
Matt Clay 17dd9ff924 ansible-test - Update default containers to 5.5.0. 4 years ago