Commit Graph

917 Commits (devel)

Author SHA1 Message Date
Matt Clay 367d45facd
ansible-test - Fix error with missing pylint home (#80155) 1 year ago
Matt Clay 27287b40c0
ansible-test - Fix pylint error with old home dir (#80151) 1 year ago
Sviatoslav Sydorenko 8fec2d2a82
Add macOS 13 to CI and ansible-test (#79508)
*  Add macOS 13.2 to `ansible-test`

* 🧪 Replace macOS 12.0 with 13.2 in the CI matrix

* Skip `lookup_url` under macOS 13.2

This is due to https://wefearchange.org/2018/11/forkmacos.rst.html
that manifests itself as follows:

    TASK [lookup_url : Test that retrieving a url works] ***************************
    objc[15394]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called.
    objc[15394]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in t
    he fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.
    ERROR! A worker was found in a dead state

* 📝 Extend ansible-test change note w/ macOS 13.2
1 year ago
Matt Clay f47bc03599
Relocate the AZP entry point scripts (#80114)
Scripts previously under `test/utils/shippable/` are now under `.azure-pipelines/commands/` instead.
1 year ago
Mark Chappell f64e79be41
sanity tests - ignore pre-release versions for deprecation comparisons (#79185) 1 year ago
Matt Clay 2f62db842d
ansible-test - Update base and default container (#80086) 1 year ago
Matt Clay 6bfe6b899a
ansible-test - Fix vendoring support (#80074)
- Support loading of vendored Python packages.
- Exclude vendored Python packages from payloads.
1 year ago
Matt Clay bca55d945b
ansible-test - Adjust vcenter test plugin behavior (#80063)
The previous change to the default mode of operation for the plugin is now limited to collections.

This enables easier testing of the plugin in core, so the previously removed tests have been restored.
1 year ago
Matt Clay 39a5b08ca6
ansible-test - Update base and default container (#80058) 1 year ago
Sviatoslav Sydorenko c05d813661
Fix #80020 typos confusing `pylint` for `pytest` (#80056) 1 year ago
Matt Clay ecf66c6f82
ansible-test - Update mypy and pylint requirements (#80049) 1 year ago
Matt Clay 5e3db6e441
ansible-test - Show Python version before install (#80022)
Always indicate the Python version being used before installing requirements.
1 year ago
Matt Clay e6cffce0eb
ansible-test - Allow target prefixes to use `_` (#80021)
Integration test target prefixes defined in a `tests/integration/target-prefixes.{group}` file can now contain an underscore (`_`) character.
1 year ago
Matt Clay fe2732b91e
ansible-test - Support pylint assertion rewriting (#80020)
Add support for `pylint` assertion rewriting when running unit tests on Python 3.5 and later.
1 year ago
Sandra McCann 967a88963f
Update docs requirements to latest package versions (#79930)
Co-authored-by: Matt Clay <matt@mystile.com>
1 year ago
Matt Clay 117cf0a44b
ansible-test - Disable the pep8 E203 rule (#79966)
The `E203` rule in `pycodestyle` is not fully PEP 8 compliant.
Disabling it provides compatibility with the output of the `black` code formatter.
1 year ago
Matt Clay 67d49734f7 ansible-test - Support Podman 4.4.0+ 1 year ago
Matt Clay d67b436eba
ansible-test - Improve pylint backwards compat (#79997) 1 year ago
Matt Clay 715ab99462
ansible-test - Improve code formatting (#79983)
* ansible-test - Add blank lines after docstrings

* ansible-test - Preserve formatting of arg pairs

* ansible-test - Remove unused string

* ansible-test - Remove pointless dict() usage

* ansible-test - Clean up initial func arg indenting

* ansible-test - Clean up constructor arg indenting

* ansible-test - Clean up func arg wrapping

* ansible-test - Clean up comma and paren placement
1 year ago
Matt Clay 43487c6581
ansible-test - Enable unused-import pylint rule (#79912)
This was previously enabled for core. This change enables it for collections.
1 year ago
Matt Clay 10bc8af5a2
ansible-test - Remove auto format pylint rule (#79985) 1 year ago
Matt Clay 58d84933fc
ansible-test - Clean up indentation and spaces (#79980) 1 year ago
Matt Clay 71f2e777ed
Update mypy to version 1.0.0 (#79963) 1 year ago
Felix Fontein 0793833847
ansible-test - Fix collection delegation (#79947) 1 year ago
Matt Clay 497d296ed6
Enable pylint rules to detect pointless statements (#79944)
Also instruct `git blame` to ignore the commit used to convert pointless strings to comments.
1 year ago
Matt Clay c8c1402ff6
ansible-test - Fix file permissions for delegation (#79932)
* ansible-test - Fix file permissions for delegation

* Set more restrictive permissions for SSH key

* Check all execute bits, not just owner

* Add a breaking_changes changelog entry
1 year ago
Matt Clay 402ae0aa5d
ansible-test - Remove old containers and remotes (#79929) 1 year ago
Matt Clay 379058e10f
Update collections.abc imports (#79911)
* Update `collections.abc` imports

- Use `six.moves` for modules and module_utils
- Use `collections.abc` for controller code

This avoids using `ansible.module_utils.common._collections_compat`,
which was added before the vendored `six` was updated to provide these
imports.

* Update _collections_compat to use six.moves

Also update the custom pylint rule to reflect this change.
1 year ago
Matt Clay e658995760
ansible-test - Enable pylint unused-import for core (#79910) 1 year ago
Matt Clay 4706af58ab
ansible-test - Enable trailing-comma-tuple pylint rule (#79909) 1 year ago
Matt Clay 1fd0265e22
ansible-test - Update default containers (#79887) 1 year ago
Matt Clay d48d1c23df
ansible-test - Specify config path in plugin error (#79881) 1 year ago
Matt Clay 0a53309f47
ansible-test - Update pylint to 2.16.0 (#79878) 1 year ago
Matt Clay 1dce45c42d
ansible-test - Update base and default containers (#79846) 1 year ago
Matt Clay 52d3d39ffc
ansible-test - Deprecate the foreman test plugin (#79821) 1 year ago
Matt Clay 7e53ec3c01
ansible-test - Update the NIOS test container (#79820) 1 year ago
Matt Clay 739bc8bb6c
ansible-test - Update sanity test requirements (#79819)
Also update core sanity test requirements, except mypy (already updated) and docs-build (update separately).
1 year ago
Matt Clay 27cd5e77d8
Update mypy and its dependencies. (#79812)
* Update mypy and its dependencies.

* Fix requirements.

* Remove unnecessary matching constraints.
1 year ago
Matt Clay 7329ec6936
ansible-test - Update CloudStack plugin container (#79813) 1 year ago
Felix Fontein 5fb8bc3ddb
Bump acme test container. (#79783) 1 year ago
Matt Clay a3b7863098
validate-modules - Remove `__future__` limits (#79800)
* validate-modules - Remove `__future__` limits

Limits on specific `__future__` imports are handled by other sanity tests.

* Add integration test for module/plugin imports.
1 year ago
Matt Clay c9f20aedc0
ansible-test - Fix various type hinting issues. (#79798)
* ansible-test - Add missing type hints.

* ansible-test - Remove redundant type hints.

* ansible-test - Fix return type annotations.

* ansible-test - Add assert, casts to assist mypy.

* ansible-test - Fix incorrect type hints.

* ansible-test - Remove no-op code.

* ansible-test - Fix incorrect types.

* ansible-test - Fix method signature mismatch.
1 year ago
Matt Clay 5f58015527 ansible-test - Remove obsolete DirectoryTarget.
This code has been unused since at least the 2.9 release.
1 year ago
Matt Clay 29b20f68e6 ansible-test - Deprecate the govcsim container.
Also remove the integration tests for the `vcenter` test plugin, since the tests relied on using the simulator.
1 year ago
Matthew Davis 8e80b03b33
document where to save cloud config files (#79412) 1 year ago
Felix Fontein 1852f9fab4
Support test and filter plugins in ansible-doc sanity test (#77737)
* Support test and filter plugins in ansible-doc sanity test.

* Move integration target non-filter file check_pylint.py from filter/ to plugin_utils/.
1 year ago
Jordan Borean ee33be9484
ansible-test - fix ps argspec check inside cmdlet (#79699)
* ansible-test - fix ps argspec check inside cmdlet

* Added error condition test

* Fix sanity problem
1 year ago
Matt Martz 56d142350d
Add support for importlib.resources (#78915)
* Add support for importlib.resources

* Remove the importlib.resources imports

* return the correct data

* Some code comments, and re-order for consistency

* Disallow traversing packages below an individual collection

* Add a traversable class for namespaces

* Re-use variable

* Utilize itertools.chain.from_iterable

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>

* Simplify logic to check for packages from ansible loaders

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>

* Just a generator expression, instead of a generator

* docstrings

* Add comment about find_spec for our namespaces

* Add some initial unit tests for importlib.resources

* normalize

* Utilize importlib.resources for listing collections

* collections_path is already in config, just use config

* install uses a different default for collections_path

* Remove unused import

* Remove duplicate __truediv__

* Bring back TraversableResources

* Apply some small suggestions from code review

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>

* Remove cross contamination between plugin loader code and CLI code

* Remove unused import

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Matt Davis <6775756+nitzmahone@users.noreply.github.com>
1 year ago
Matt Clay 1375861ec2 ansible-test - Update available platforms. 1 year ago
Evgeni Golov a7111c4dbb
validate-modules: don't fail on invalid YAML (#79682)
* validate-modules: don't fail on invalid YAML

When validate-modules encounters invalid YAML (e.g. in the EXAMPLES
section), it tries to reformat the exception to include the line number
in the Python file instead of the line number of the embedded YAML
document. However, PyYAML doesn't allow modification of the Mark object
(anymore) which leads to a new exception being raised, instead of
reporting the original exception.

As the original exception is not needed in other places anymore, we
don't have to modify it at all and can just compute the right line
number when reporting the error via ansible-test.

Fixes: #75837

* Add test for invalid module doc YAML syntax.

Co-authored-by: Matt Clay <matt@mystile.com>
1 year ago
Matt Clay 04fc98c794 ansible-test - Improve container startup handling.
Also improve the ansible-test-container integration test:

 - Add coverage for the no-probe code path.
 - Add work-arounds for centos6 containers (to support backporting).
 - Avoid systemd debug when the container doesn't use cgroup.
1 year ago
Matt Clay 75b60b17ee ansible-test - Support RSA SHA-1 for SSH clients. 1 year ago
Matt Clay da3b1d3f50
ansible-test - Fix `--prime-containers` and `--explain` (#79581)
* Remove unused code.
* Fix explain errors.
* Fix `--prime-containers` with docker on cgroup v2.
1 year ago
Matt Clay dcc08eec35 ansible-test - Fix target PyPI proxy config. 1 year ago
Martin Krizek 0a12d8a5bc
ansible-test - fix warning to include image name (#79560) 2 years ago
Matt Davis 1424484be0
Prevent stdio deadlock in forked children (#79522)
* background threads writing to stdout/stderr can cause children to deadlock if a thread in the parent holds the internal lock on the BufferedWriter wrapper
* prevent writes to std handles during fork by monkeypatching stdout/stderr during display startup to require a mutex lock with fork(); this ensures no background threads can hold the lock during a fork operation
* add integration test that fails reliably on Linux without this fix
2 years ago
Matt Clay 80d2f8da02
ansible-test - Fix container detection. (#79530) 2 years ago
Matt Clay f9715f436c ansible-test - Avoid direct use of `errno`.
Error handling on Python 3.x no longer requires the use of `errno` to identify specific errors.
2 years ago
Matt Clay cda16cc5e9
ansible-test - Improve container management. (#78550)
See changelogs/fragments/ansible-test-container-management.yml for details.
2 years ago
Matt Clay 38fe34244c ansible-test - Fix completion error in Python 3.11. 2 years ago
Wong Hoi Sing Edison b148fd8dd7
ansible-galaxy - support ``resolvelib >= 0.5.3, < 0.10.0`` (#79399)
* Upgrade `resolvelib >= 0.5.3, < 0.10.0`

https://pypi.org/project/resolvelib/0.9.0/ released on 2022-11-17:

  * https://github.com/sarugaku/resolvelib/blob/master/CHANGELOG.rst#090-2022-11-17
  * https://github.com/sarugaku/resolvelib/releases/tag/0.9.0

Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
2 years ago
Felix Fontein 1705ec98cd
ansible-doc and validate-modules: remove underscore deprecation handling for collections (#79362)
* Remove underscore deprecation handling for collections.

* Also consider ansible.legacy.
2 years ago
Felix Fontein e0118d9d03
The attribute was renamed to 'action' and the extra data was not used anymore. (#79317) 2 years ago
Matt Clay 938c0fa944 ansible-test - Fix and update documentation links. 2 years ago
Jordan Borean 698da30c1e
ansible-test - Update test container to 7.4.0 (#79281) 2 years ago
Jordan Borean 6def4a3180 Fix up sanity problems 2 years ago
Jordan Borean 4ad02dc6e3 ansible-test - Update PSScriptAnalyzer to 1.21.0 2 years ago
Felix Fontein 6e379e5d65
validate-modules: do not treat falsy non-`False` defaults as `None` (#79267)
* Do not treat falsy non-False defaults as None.

* Fix various instances of this in modules.

* Add changelog fragment.
2 years ago
Matt Clay d55423f5a4 ansible-test - Update default container. 2 years ago
Matt Clay 4fb5240af2 ansible-test - Update base and default containers. 2 years ago
Matt Clay 645b6b8581 ansible-test - Fix pylint support on Python 3.11. 2 years ago
Sviatoslav Sydorenko a76bbb18a5
Restrict `wheel` below v0.38.0 under Pythons < 3.7 (#79187)
* Restrict `wheel` below v0.38.0 under Pythons < 3.7

* Add a change note for PR #79187

* Update changelogs/fragments/79187--wheel-0.38.0.yml

Co-authored-by: Matt Clay <matt@mystile.com>

* Use constraints file when installing wheel.

Co-authored-by: Matt Clay <matt@mystile.com>
2 years ago
Matt Clay 14e7f05318 ansible-test - Update pylint to 2.15.4. 2 years ago
Matt Clay 5b239acb77 ansible-test - Update distro containers to 4.8.0.
The updated containers include coverage 6.5.0.
2 years ago
Matt Clay 20c1252212 ansible-test - Update coverage to version 6.5.0.
ci_complete
ci_coverage
2 years ago
Jordan Borean be4807b712
ansible-test validate-module - support sidecar docs (#78904) 2 years ago
Matt Clay bc274f57f7
ansible-test - Improve pylint command consistency. (#78896)
* ansible-test - Improve pylint command consistency.

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
2 years ago
Felix Fontein 50dae8087e
runtime-metadata sanity test: ensure redirects are FQCRs (#78802)
* Ensure that meta/runtime.yml redirects are FQCRs.

* Avoid crash when YAML errors without context mark happen, for example if file starts with 'foo---' instead of '---'.
2 years ago
Matt Clay d3d7785472
ansible-test - Fix integration test target filter. (#78862)
- Allow disabled, unsupported, unstable and destructive integration test targets to be selected using their respective prefixes.
- Allow unstable tests to run when targeted changes are made and the ``--allow-unstable-changed`` option is specified (resolves https://github.com/ansible/ansible/issues/74213).
2 years ago
Matt Clay 16cde1104f
ansible-test - Update base and default containers. (#78846) 2 years ago
Matt Martz 76b746655a
Add `use_rsa_sha2_algorithms` option for paramiko (#78789)
Fixes #76737
Fixes #77673

Co-authored-by: Matt Clay <matt@mystile.com>
2 years ago
Matt Clay 4d25233ece
ansible-test - Update Python 3.11 support. (#78840)
- Update sanity test requirements to fully support Python 3.11.
- Make Python 3.11 the default in the base and default test containers.
2 years ago
Matt Clay e5e87a3927
ansible-test - Update pylint to 2.15.3. (#78811) 2 years ago
Matt Clay 7683c0ae54
ansible-test - Update base and default containers. (#78774) 2 years ago
Matt Clay 79f67ed561
ansible-test - Fix container error handling. (#78739) 2 years ago
Matt Clay 8a7b89c2f4
ansible-test - Update distro containers. (#78729) 2 years ago
Matt Clay b3854161a0
ansible-test - Update coverage to version 6.4.4. (#78728) 2 years ago
Matt Clay c56b35598f
ansible-test - Upgrade pylint. (#78727)
This version of pylint now supports Python 3.11.
2 years ago
Matt Clay 38a82a5cc4
ansible-test - Remove Fedora 35 support. (#78720) 2 years ago
Sloane Hertel 12cec69545
Fix validate-modules version_added test (#78554) 2 years ago
Matt Clay 38db9cf417
ansible-test - Update test containers. (#78615)
The test containers no longer use the `VOLUME` instruction.
2 years ago
Matt Clay 4187707f03
ansible-test - Use --tmpfs to run containers. (#78605) 2 years ago
Matt Clay ece85abbc4
ansible-test - Verify executables are executable. (#78606) 2 years ago
Matt Clay d683c5bd21
ansible-test - Fix Ubuntu 20.04 bootstrapping. (#78551) 2 years ago
Matt Clay 8e96c27888
ansible-test - Update base and default containers. (#78532) 2 years ago
Matt Clay 69ceb31600
ansible-test - Update sanity test requirements. (#78528) 2 years ago
Matt Clay 99016653a2
ansible-test - Fix self-test change handling. (#78521) 2 years ago
Matt Clay 2b63fdd1b8
ansible-test - Fix ansible-doc sanity test FQCN. (#78518) 2 years ago
Matt Clay 2fedde6356
ansible-test - Update distro test containers. (#78506) 2 years ago
Matt Clay 8367af9cdd
ansible-test - No locale warning with delegation. (#78505)
The locale warning for the origin host is not relevant when delegation is used.
It is also not relevant when non-test commands are in use.
2 years ago
Matt Clay 47804fcdf5
ansible-test - Update coverage to 6.4.3. (#78504) 2 years ago
Matt Clay 89862fda3b
ansible-test - Sanity test code cleanup. (#78497) 2 years ago
Matt Clay 650befed37
Add missing space after keywords. (#78480)
Also remove unnecessary parenthesis.
2 years ago
Matt Clay 85acf4d1e5
ansible-test - Avoid use of deprecated type hints. (#78456)
* ansible-test - Avoid use of deprecated type hints.

PEP 585 deprecated many container types in the `typing` module in favor of the actual types, which support subscripting as of Python 3.9.

Conversion of `t.Type` was skipped since PyCharm does not currently recognize it.

* ansible-test - Fix `t` and `c` imports/shadowing.
2 years ago
Matt Clay 5bee66fc5d
ansible-test - More type hint updates. (#78455)
* Simple regex replace of multi-line function arg annotations on the first line.

* Manually fix up ArgumentParser type annotations.

* Manual type hint conversions.

* Manual conversion of function type hints.

* Remove unnecessary type hints on for statements.
2 years ago
Matt Clay b993b5cd49
ansible-test - Convert more type hints. (#78449)
* Simple regex replace of multi-line function arg annotations.

* Simple regex replace of multi-line function arg annotations with default values.

* Simple regex replace of multi-line function arg return annotations.

* Simple regex replace of assignment annotations.
2 years ago
Matt Clay 02e98810a9
Re-organize CI test groups for POSIX tests. (#77420)
* `context/target` tests must be in groups 1 - 2.
* `context/controller` tests must be in groups 3 - 5.

This makes it easier to efficiently organize groups and balance test runtimes.
2 years ago
Matt Clay 3eb0485dd9
ansible-test - Use more native type hints. (#78435)
* ansible-test - Use more native type hints.

Simple search and replace to switch from comments to native type hints for return types of functions with no arguments.

* ansible-test - Use more native type hints.

Conversion of simple single-line function annotation type comments to native type hints.

* ansible-test - Use more native type hints.

Conversion of single-line function annotation type comments with default values to native type hints.

* ansible-test - Use more native type hints.

Manual conversion of type annotation comments for functions which have pylint directives.
2 years ago
Matt Clay f2abfc4b3d
ansible-test - Parse content config only once. (#78418) 2 years ago
Matt Clay d8fefba20e
ansible-test - Update locale logic to match core. (#78389)
Now that core requires UTF-8 filesystem encoding, ansible-test does as well.

Additionally, the `en_US.UTF-8` or `C.UTF-8` encoding must be available.
Previously the `en_US.UTF-8` encoding was requested, but its availability was never verified.
The fallback to `C.UTF-8` maintains UTF-8 encoding while allowing more flexibility in the running environment.
2 years ago
Matt Clay b0b58fa7c2
ansible-test - Update base and default containers. (#78377) 2 years ago
Matt Clay a3c90dd0bc
ansible-test - Fix TTY and output handling. (#78350) 2 years ago
Matt Clay 0012263c7a
ansible-test - Fix handling of args after `--` (#78328) 2 years ago
Matt Clay 61af59c808
ansible-test - Update distro containers to 4.4.0. (#78322) 2 years ago
Matt Clay 4cd3425dfe
ansible-test - Update coverage to 6.4.2 (#78320) 2 years ago
Matt Clay 90ef914f77
ansible-test - Drop Python 3.8 controller support. (#78237) 2 years ago
Matt Clay f3f4ad9332
ansible-test - Use sudo for all remotes. (#78310) 2 years ago
Matt Clay 8565deaae3
ansible-test - Install `acl` on Alpine remotes. (#78303) 2 years ago
Matt Clay 8bb20fe06b
ansible-test - Enable ACL support on more remotes. (#78299) 2 years ago
Matt Clay b63812bc08 ansible-test - Enable ACLs on FreeBSD remotes.
This allows integration tests to switch from one unprivileged user
to another, sharing files between the users using ACLs.
2 years ago
Jordan Borean 75de4a37bc
validate-modules - allow raw module return type (#78231) 2 years ago
Matt Clay b9d13d222c ansible-test - Improve pip bootstrap download. 2 years ago
Sviatoslav Sydorenko e481b35e23
Delete core-ci `query` param from ansible-test (#78136)
Ref: https://github.com/ansible/ansible-core-ci/pull/343
2 years ago
Matt Clay ca04dc28a2 ansible-test - Remove deprecated test platforms. 2 years ago
Matt Clay cf9fd2d7da ansible-test - Use shlex.join where appropriate. 2 years ago
Matt Clay 24d91f552c ansible-test - Add support for more remotes. 2 years ago
Matt Clay 5666c6d6a3 ansible-test - More flexible become support. 2 years ago
Don Naro 3cd2c494bd
issue #72449 winrm script rm (#77931) 2 years ago
Matt Clay 2f0530396b ansible-test - Clean up type hints and comments. 2 years ago
Matt Clay a4e4413cde ansible-test - Update distro containers to 4.3.0.
The primary change in this update is removal of `/etc/ansible/hosts` from the containers.
2 years ago
Matt Clay 5b3557f8ba ansible-test - Allow docstring in docs-only module 2 years ago
Matt Clay c2b36ba04d ansible-test - Update base and default containers. 2 years ago
Matt Clay 23914d3f0b
ansible-test - Adjust unit test mock usage. (#77961) 2 years ago
Sloane Hertel e89176caac
Pin PyYAML version compatible with Python 3.8+ (#77936)
Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
Co-authored-by: Matt Clay <matt@mystile.com>
2 years ago
Sloane Hertel 143e7fb45e
ansible-galaxy - support resolvelib versions >= 0.5.3, < 0.9.0 (#77649)
* 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
2 years ago
Matt Clay df765c0ecf ansible-test - Update Alpine, openSUSE containers 2 years ago
Matt Clay 52c8613a04 ansible-test - Skip mypy runs under Python 3.11. 2 years ago
Matt Clay 11b6032e73 ansible-test - Ignore vendored code in mypy test. 2 years ago
Matt Clay 81351022d8 ansible-test - Prefer unittest.mock for core. 2 years ago
Matt Clay f933314101 ansible-test - Fix shell target options handling. 2 years ago
Matt Clay 86779cc903 ansible-test - Code cleanup.
This helps prepare for a future pylint upgrade.
2 years ago
Matt Clay 289cba333b ansible-test - More multi-arch containers. 2 years ago
Matt Clay 13d03c3c22
ansible-test - Add RHEL 9 / FreeBSD 13.1 remotes. (#77851) 2 years ago
Matt Clay 3d2c2e60aa
ansible-test - Update distro containers. (#77847)
* ansible-test - Add a Ubuntu 22.04 container.
* ansible-test - Add a Fedora 36 container.
* ansible-test - Update distro containers.
* Fix dnf test on Fedora 36.
* Work around scp test issues.
2 years ago
Matt Clay 76ead1e768 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
2 years ago
Matt Clay 185340e667 ansible-test - Update default containers.
These containers include Python 3.11 sanity test environments.
2 years ago
Matt Clay dfde4be444 Add Python 3.11 support.
ci_complete
ci_coverage
2 years ago
Matt Clay 9600e3064a
ansible-test - Improve requirements handling. (#77825)
The requirements for virtualenv and coverage are now kept in a requirements file for easier container builds.

The test-constraints sanity test has been updated to make sure the requirements file is kept up-to-date.
2 years ago
Matt Clay 290fb5e0ca
ansible-test - Upgrade to coverage 6.3.3. (#77817) 2 years ago
Matt Clay 1e3cf9f732
ansible-test - Make distro containers multi-arch. (#77814) 2 years ago
Matt Clay 449d82a521 ansible-test - Add RHEL 8.6 support. 2 years ago
Matt Clay fe349a1ccd
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.
2 years ago
Matt Clay cc5ac88c4c Update mypy test. Fix type hints for Python 3.9.
This also bumps the minimum controller version (for mypy only) to Python 3.9.
2 years ago
Matt Clay 2cc74b04c4 ansible-test - Add multi-arch remote support. 2 years ago
Matt Clay de5d6820f8 ansible-test - Remove obsolete code. 2 years ago
Matt Clay e2200e8dfc ansible-test - Fix remote completion validation. 2 years ago
Matt Clay 6513453310 ansible-test - Add support for remote Ubuntu VMs. 2 years ago
Matt Clay 5c2d830dea
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.
2 years ago
Brian Coca b439e41a91
expand ansible-doc coverage (#74963)
* Expand ansible-doc to tests/filters and fix existing issues

  enable filter/test docs if in single file or companion yaml
  add docs for several filters/tests plugins
  allow .yml companion for docs for other plugins, must be colocated
  verify plugins are valid (not modules, cannot)
  fix 'per collection' filtering
  limit old style deprecation (_ prefix) to builtin/legacy
  start move to pathlib for saner path handling
  moved some funcitons, kept backwards compat shims with deprecation notice

  Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
  Co-authored-by: Felix Fontein <felix@fontein.de>
  Co-authored-by: Sandra McCann <samccann@redhat.com>
2 years ago
Matt Clay 26fd5a8c3a Revert "ansible-test - Fix subprocess management. (#77638)"
This reverts commit 62d03c8e75.
2 years ago
Matt Clay 62d03c8e75
ansible-test - Fix subprocess management. (#77638)
* 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.
2 years ago
Matt Clay b960641759 ansible-test - Support multiple coverage versions.
ci_complete
ci_coverage
2 years ago
Matt Clay 191d9a771a ansible-test - Remove more Python 2.7 support. 2 years ago
Matt Martz 66c5844978
ansible-test - Don't fail if network cannot be disconnected (#77472)
* Don't fail if network cannot be disconnected

* add clog frag
2 years ago
Felix Fontein 6216c9fc93 Fix sanity test crash. 2 years ago
Matt Clay 4b51e61645 ansible-test - Fix origin host target filtering. 2 years ago
Matt Clay 708e4c206a ansible-test - Update default test containers. 2 years ago
Felix Fontein 7075fa36a1
Bump requirements for antsibull to 0.42.0 (which depends on antsibull-changelog >= 0.14.0). (#77362) 2 years ago
Matt Clay 55f90ba31f ansible-test - Remove RHEL 9.0b support.
Support can be restored once RHEL 9 has been released.
2 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
2 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>
2 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.
2 years ago
Matt Clay e8afdac06e ansible-test - Fix delegation inventory path. 2 years ago
Matt Martz 7cb581ed2c
Support podman-remote in ansible-test (#75753) 2 years ago
Matt Clay 0c514bcf54 ansible-test - Fix PS coverage `--all` generation. 2 years ago
Matt Clay f68c66a3ef Remove collections compat from controller code. 2 years ago
Matt Clay f43c54d890 ansible-test - Update default containers to 5.7.0. 2 years ago
Matt Clay 3d5637beec Initial mypy sanity test support for core. 2 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.
2 years ago
Matt Clay af2b1361ff ansible-test - Simplify type hints. 2 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.
2 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.
2 years ago
Matt Martz bdf37336c8
Update pylint deprecated plugin to use ansible-invalid* symbols (#77086) 2 years ago
Matt Clay 4f9c7fd509 ansible-test - Remove validate-modules symlink. 2 years ago
Matt Clay 5a6e05affb More strict pylint checking of ansible-test code. 2 years ago
Matt Clay d3d5244912 ansible-test - Fail sanity test on distutils use. 2 years ago
Matt Clay d286c2e8b3 ansible-test - Fix CParser import in yamllint. 2 years ago
Matt Clay c27fd777f4 ansible-test - Use quay.io containers in plugins. 2 years ago
Matt Clay addb9baec2 ansible-test - Clean up venv code. 2 years ago
Matt Clay 13d5381e56
ansible-test - Update base and default containers. (#77033) 2 years ago
Matt Clay 68fb3bf90e
ansible-test - Fix consistency of managed venvs. (#77028) 2 years ago
Matt Clay ef4c5cd61b ansible-test - Use newer pip to bootstrap FreeBSD. 2 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
2 years ago
Matt Clay 0d5401d950 ansible-test - Remove unused code.
This was overlooked in a previous commit that removed FreeBSD 12.2 support.
2 years ago
Matt Clay 00a2b7788e ansible-test - Remove cap on cryptography version. 2 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.
2 years ago
Matt Clay 17dd9ff924 ansible-test - Update default containers to 5.5.0. 2 years ago
Matt Clay b568e0db6f ansible-test - Remove outdated remote support. 2 years ago
Matt Clay 7e64c4fe55 ansible-test - Update bootstrap URL to not use S3. 2 years ago
Matt Clay 995d7e4db3 ansible-test - Limit installed pyopenssl version. 2 years ago