Commit Graph

1054 Commits

Author SHA1 Message Date
mansoor
e3f4fe4fb9
ansible-test - Remove macos/13.2 remote from ansible-test
Co-authored-by: Sviatoslav Sydorenko <webknjaz@redhat.com>
2024-03-27 22:45:54 +00:00
Abhijeet Kasurde
b8b12c4be3
Update sanity requirements (#82296)
* Update sanity requirements
* Drop Python 3.7 for mypy

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-03-22 17:17:52 -07:00
Matt Clay
ca168eb367 ansible-test - Fix Alpine libexpat bootstrapping 2024-03-22 12:27:35 -07:00
Matt Clay
b4d67adfda ansible-test - Update distro containers to 7.1.0 2024-03-21 21:40:01 -07:00
Matt Clay
a1ad7100df
ansible-test - Handle externally managed Python (#82883)
Remove EXTERNALLY-MANAGED marker in ansible-test managed environments

Additional changes:

- Test the Alpine 3.19 container
- Stop testing Alpine 3.18 container and remote
- Add missing changelog entry the Alpine 3.19 container
2024-03-21 21:06:25 -07:00
Abhijeet Kasurde
73701004b0
ansible-test - Add alpine 3.19 (#82115) 2024-03-22 01:02:29 +00:00
Felix Fontein
c0821346fc
Do not mangle plugin names in collections that start with an underscore. (#82574) 2024-03-21 19:40:46 -04:00
Brian Coca
ddae41759c
Add FreeBSD 13.3 and 14.0 to ansible-test (#82530)
Co-authored-by: Matt Clay <matt@mystile.com>
2024-03-21 17:50:51 +00:00
Abhijeet Kasurde
8eabeefa63 mypy: update code required to bump sanity requirements
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-03-21 09:54:24 -07:00
Felix Fontein
0c9f1989a7 Do not treat leading underscore in plugin names as attempted deprecation. 2024-03-20 14:01:50 -07:00
Matt Clay
a1edb61ce7
ansible-test - Add work-around for pytest>=8 errors (#82723)
* ansible-test - Add work-around for pytest>=8 errors
* Update changelogs/fragments/ansible-test-pytest-8.yml

Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
2024-02-21 10:08:54 -08:00
Sviatoslav Sydorenko (Святослав Сидоренко)
386edc666e
Add macOS 14.3 to CI and ansible-test
Additionally, this patch takes care of installing GPG within the
`ansible-galaxy-collection` test when running under macOS 14 and higher.

PR #82697

ci_complete
2024-02-16 21:26:16 +01:00
Matt Clay
c8d6f7b95e ansible-test - Fix validate-modules Python handling
The ``validate-modules`` sanity test no longer attempts to process files with unrecognized extensions as Python.

Integration tests have been added to verify Python-specific checks do not apply to these files.

The `invalid-extension` and `missing-gplv3-license` checks still apply to these files. This may change in the future.
2024-02-08 08:43:08 -08:00
Matt Martz
e458cbac61
Allow for arbitrary key 'context' in argument spec (#82183)
* Allow for arbitrary key 'context' in argument spec
2024-01-30 08:59:57 -06:00
Martin Krizek
f024cf35d7
Remove the yum module, redirect it to dnf (#81895)
Fixes #81728
2024-01-23 10:23:43 -06:00
Nilashish Chakraborty
b01f1f207c
Support action_plugin in plugin_routing_schema (#82562)
now validation schema matches reality

Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>
Co-authored-by: s-hertel <19572925+s-hertel@users.noreply.github.com>
2024-01-19 16:21:10 +00:00
Matt Clay
21247c828e ansible-test - Bypass PEP 668 checks
When ansible-test installs requirements, it now instructs pip to allow installs on externally managed environments as defined by PEP 668.

This only occurs in ephemeral environments managed by ansible-test, such as containers,
or when the `--requirements` option is used.
2024-01-11 14:10:31 -08:00
Abhijeet Kasurde
a69fab86bc ansible-test - remove Fedora 38 container and remote support
Fixes: #82022

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-01-10 11:05:57 -08:00
Matt Clay
c75624fbdc ansible-test - Enable shellcheck SC2164 2024-01-03 17:52:29 -08:00
Matt Clay
3c432fea43 ansible-test - Update base/default test containers 2024-01-03 17:17:00 -08:00
Mark Chappell
5346009d2c
ansible-test - Allow multiple documents in the YAML stream for EXAMPLES (#82355)
* Allow multiple documents in the YAML stream for EXAMPLES.

* Add integration test

* linting
2023-12-14 06:18:35 +10:00
Matt Clay
4208bdbbcd ansible-test - Update nios-test-container to 3.0.0 2023-11-30 09:59:49 -08:00
Abhijeet Kasurde
e6e19e37f7
validate-modules: Check for correct values in choice (#82266)
* validate-modules: Check for correct values in choice

* validate-modules test now checks the length of choices and
  correct option values inside the choice.

Fixes: #82179

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

* Fix sanity tests

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

---------

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-11-28 10:09:29 -05:00
Martin Krizek
afd45aca6a
ansible-test - remove rhel 9.2 test remote (#82211)
Fixes #82024
2023-11-27 10:03:42 +01:00
Abhijeet Kasurde
fbdb666411
ansible-test: Added Fedora 39 (#82218)
* Fedora 39 remote
* Fedora 39 container

Fixes: #82018

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-11-17 02:30:13 +00:00
Martin Krizek
0bab08ee33
ansible-test - Add RHEL 9.3 support (#82178)
Fixes #82020
2023-11-14 08:23:44 +01:00
Matt Clay
9dd3eafa14 ansible-test - Use pylint unidiomatic-typecheck
This replaces the regex based check previously used within the validate-modules sanity test.

NOTE: The pylint check overlaps with a similar check for pep8.
      Both are used, since the pep8 based check is more nuanced than the one in pylint.
      For example, allowing `is` checks, but not `==` comparisons.
      If the pylint check is ignored, the pep8 check would still be relevant.
2023-11-07 11:04:22 -08:00
Matt Clay
36d6860d80 ansible-test - Remove no-main-display sanity test 2023-11-02 13:34:20 -07:00
Matt Clay
6e15fb0ebf ansible-test - Removed no-basestring sanity test 2023-11-02 12:32:01 -07:00
Matt Clay
c349b91af3 ansible-test - Removed no-dict-* sanity tests 2023-11-02 11:55:14 -07:00
Matt Clay
9765bb46f9 ansible-test - Remove no-unicode-literals test 2023-11-02 11:42:02 -07:00
Matt Clay
18e8401edd
Remove Python 2.x compat from unit tests (#82109) 2023-11-01 16:37:08 -07:00
Brian Coca
9ee603d1c5
Clarify some points in config lookup documentation (#81951)
Also update tests to support the format on modules/plugins

Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2023-10-24 09:17:32 -04:00
Matt Clay
e933d9d8a6 ansible-test - Fix parsing of cgroup entries 2023-10-19 15:30:32 -07:00
Matt Clay
37cee8bdfc
ansible-test - Remove special cryptography install (#82008)
Python 3.10 is the minimum version on the controller, and it requires openssl 1.1.1 or later.

As a result, there's no need to check the openssl version any longer.
2023-10-18 10:52:18 -07:00
Matt Clay
f5c742cdfd
ansible-test - Clean up old Python 2 compat code (#81962)
* Update generated code __future__ import

* Remove Python 2.x compat from compile sanity test

* Remove __metaclass__ from pylint good names list

* Remove Python 2.x compat from ansible-test injector

* Remove Python 2.x compat from ansible-test importer

* Remove Python 2.x compat from ansible-test units

* Remove Python 2.x compat from validate-modules

* Remove Python 2.x compat from pylint plugins

* Remove more Python 2.x compat from ansible-test

* Remove Python 2.x openssl detection in ansible-test

* Remove obsolete Python 2.x comment

* Remove obsolete ansible-test Python 2.x support

* Remove unused bootstrap script functions

* Keep mypy happy

* Remove unused imports

* Keep pylint happy
2023-10-11 19:04:30 -07:00
Matt Clay
fd0f48e99d
ansible-test - Update base/default containers (#81957) 2023-10-11 17:17:11 -07:00
Matt Davis
d8484f0af7
Update default test container Python to 3.12 and support for PyLint 3.0.1 (#81953)
* temporary PyLint plugin to mask 3.12 finalizer noise

* ansible-test - Default to Python 3.12 for base/default

* ansible-test - Update pylint requirements

* ansible-test - Remove obsoleted changelog entry

* Add changelog fragment for pylint work-around
2023-10-11 13:04:22 -07:00
Sviatoslav Sydorenko
d2ba76c117
Remove Python < 3.5 selectors fallbacks (#81872) 2023-10-11 08:36:20 -07:00
Matt Clay
921efce43a
ansible-test - Remove more Python 2.7 / 3.6 support (#81898) 2023-10-04 11:32:31 -07:00
Matt Clay
b94ee1cefd
Drop Python 2.7 and Python 3.6 support (#81866)
* Drop Python 2.7 and Python 3.6 support

* Remove obsolete _json_compat
2023-10-03 21:52:38 +00:00
Sloane Hertel
000cf1dd46
Update the test containers to include Python3.12.0 final (#81858) 2023-10-03 10:46:58 -07:00
Matt Clay
b7903669b4
ansible-test - Update distro containers (#81851)
* ansible-test - Update distro containers

* Update the alpine3 container to Python 3.11

* Update changelog
2023-10-03 16:33:37 +00:00
Matt Clay
20f17687da
ansible-test - Invoke container sleep through env (#81853) 2023-10-03 08:27:55 -07:00
Abhijeet Kasurde
d8f791d88c
Bump sanity test requirements for 3.12 (#81846) 2023-10-03 06:38:49 -07:00
Abhijeet Kasurde
ce3954ba74
Bump sanity test requirements for 3.12 (#81843) 2023-10-03 06:18:32 -07:00
Sviatoslav Sydorenko
ec265ec08a
Bump coverage.py to v7.3.2 in ansible-test (#81844) 2023-10-02 20:45:57 +00:00
Matt Clay
f31c287348
ansible-test - Improve compatibility with pylint 3 (#81841) 2023-10-02 13:05:39 -07:00
Matt Clay
d6a356d7cd
ansible-test - Update sanity test requirements (#81810) 2023-09-28 14:28:35 -07:00
Sloane Hertel
cb8cb8936a
Update ansible-test containers
* Include Python 3.12rc3 and PowerShell 7.3.7
2023-09-28 10:24:03 -04:00
Matt Clay
3794612832
ansible-test - Skip pylint test on Python 3.12 (#81706) 2023-09-21 21:01:58 -07:00
René Moser
e4b9f9c6ae
tests: update CloudStack test container to version 1.7.0. (#81732) 2023-09-20 08:34:02 -07:00
Matt Martz
3ec7a6e0db
Fix ansible-test issues with detecting docker host and forwarding ports (#81726)
* Properly detect docker host using ssh

* Disable ControlPath when creating SSH port forwards

* typo fix

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

* Add clog frag

---------

Co-authored-by: Matt Clay <matt@mystile.com>
2023-09-19 12:10:52 -05:00
Abhijeet Kasurde
3b608f97b1
sanity: update requirements (#81680)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-09-12 11:33:08 -04:00
Sloane Hertel
67cdaa49f8
ansible-galaxy-collection - fix config permissions for galaxy-importer (#81679)
* Fix permissions for the galaxy-importer config, previously only root had
read/write

* fix ownership instead
2023-09-12 08:43:46 -05:00
Abhijeet Kasurde
1cc5efa77b
tarfile: Handle deprecation warning for extract and extractall (#81545)
* Python 3.11.4 introduces a new parameter 'filter' in extract and
extractall in tarfile. Handle deprecation warning message emitted
in Python 3.12.
* added probing mechanism in ansible-galaxy code to detect broken
data filter implementation in tarfile.

Fixes: #80832

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Matt Clay <matt@mystile.com>
2023-08-31 12:02:48 -07:00
Matt Clay
5a059b81c8
ansible-test - Fix Python coverage stub generation (#81611)
As of coverage 7.1.0, files without arcs are not generated.

To work around this, an empty (0, 0) arc is used for each file instead.

This is a follow-up to https://github.com/ansible/ansible/pull/81077

ci_coverage
ci_complete
2023-08-31 10:53:10 -07:00
Matt Clay
e1e0e2709c
ansible-test - Enable thread code coverage (#81604)
ci_complete
ci_coverage
2023-08-30 14:39:47 -07:00
Matt Clay
261e5ce381
ansible-test - Update mypy to 1.5.1 (#81602) 2023-08-30 10:39:25 -07:00
Sviatoslav Sydorenko
c59bcbe627
Bump coverage.py to v7.3.0 in ansible-test (#81077) 2023-08-30 08:58:45 -07:00
Matt Clay
f28e32c063
ansible-test - Limit deprecated check to core (#81552)
Using `# deprecated:` comment checks in collections would effectively limit those collections to a single version of ansible-core.
2023-08-21 12:58:09 -07:00
Matt Clay
390e508d27
ansible-test - Always use managed entry points (#81537) 2023-08-17 19:13:29 -07:00
Matt Clay
47ab59753c
Clean up release script (#81488)
* Enable mypy for the entire packaging directory

* Return CompletedProcess only when capturing output

This allows stdout/stderr on CompletedProcess to be `str` instead of `str | None`.
The unused args on CompletedProcess have been removed.
Overload type hints have been added to reflect these changes.

* Relax return type on ensure_venv

This improves consistency with its usage, since `run` accepts `env` of `dict[str, t.Any]`.
Also removed unnecssary `str()` usage when updating `env`.

* Fix type hint on suppress_when

* Fix callable annotation

* Add type hint for command_parser

PyCharm complains about using a protected member, and also that it can't find the type in the type stubs.
However, mypy properly recognizes the type.

* Avoid unnecessary TypeVar usage
2023-08-10 13:39:37 -07:00
Abhijeet Kasurde
fa5fe8a7db
Bump test container versions to latest (#81471)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-08-08 19:53:04 -07:00
Abhijeet Kasurde
493c678795
Sanity: Bump version to match Python 3.12 (#81399)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-08-08 09:05:46 -07:00
Matt Clay
f894ce89b4
Overhaul package-data sanity test (#81427)
The sanity test now only inspects the sdist and wheel instead of trying to install the sdist using setup.py.
2023-08-03 13:24:25 -07:00
Matt Clay
c525514994
ansible-test - Update source layout detection (#81418) 2023-08-02 20:24:13 -07:00
Abhijeet Kasurde
11e261b54f
CI: remove FreeBSD 12.4 from test matrix (#81315)
Fixes: #80417

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-08-01 13:37:26 -07:00
Matt Clay
691c8e8603
Omit pre-built man pages from sdist (#81395)
Since man pages aren't accessible to users after a `pip install`, there's no need to include them in the sdist.
This change makes it trivial to build man pages from source, which makes them much easier to iterate on.
It also simplifies creation and testing of the sdist, since it no longer requires building man pages.

The new `packaging/cli-doc/build.py` script can generate both man pages and RST documentation.
This supports inclusion on the docs site without a dependency on `ansible-core` internals.
Having a single implementation for both simplifies keeping the two formats in sync.
2023-08-01 12:48:01 -07:00
Brian Coca
6d1f85bbe9
ansible-test: remove alpine 3.17 (#81124) 2023-08-01 11:54:33 -07:00
Sloane Hertel
5167618e46
Update ansible-test containers to test Python 3.12 with the test venvs (#81330) 2023-07-21 20:15:07 -07:00
Sloane Hertel
48dfe8e215
add Python 3.12 support to ansible-test (#80834)
* update docker containers versions to use newer ansible-test ref in the pre-built venvs

* Allow invoking ansible-test with Python 3.12

* Add python3.12 to the INTERPRETER_PYTHON_FALLBACK

* changelog

* add Python 3.12 as a non-default Python version for the test containers

* Update mypy ignores for Python 3.12

* Add Python 3.12 to CI matrix for unit tests, generic tests, and galaxy

* Update unit test for using the Python 2 collection loader path with Python 3.

Skip the existing test on Python 3.12, since find_module is removed.

Suppress the pre-existing deprecation warnings using the Python 2
codepath with Python 3.

Add a test for Python >= 3.12, which doesn't call find_module.

* Ignore sanity test errors on systems without libselinux present.
2023-07-21 10:23:14 -07:00
Matt Clay
c5d18c39d8
Update sanity requirements comments (#81321)
Also remove a redundant indirect dependency.

The requirements file updates are being deferred until other changes are required.
2023-07-20 14:31:25 -07:00
René Moser
99eeaf7da8
ansible-test: cloudstack: bump test container version (#81319) 2023-07-20 14:26:00 -07:00
Matt Clay
e964078a83
ansible-test - Pre-build PyYAML wheels (#81300)
This works around Cython failures when attempting to install PyYAML >= 5.4 <= 6.0.
2023-07-18 18:17:48 -07:00
Matt Clay
765b2bd783
ansible-test - Narrow the scope of some sanity tests (#81273)
* ansible-test - Limit scope of replace-urlopen test

Only ansible-core code and plugins in collections can be expected to rely on module_utils.

* ansible-test - Limit scope of use-compat-six test

Only ansible-core code and plugins in collections can be expected to rely on module_utils.

* ansible-test - Limit scope of no-get-exception test

Only ansible-core code and plugins in collections should be checked for usage of outdated module_utils functions.

* Add integration tests
2023-07-14 17:19:33 -07:00
Matt Clay
3f7bf0bcd4
ansible-test - Fix sanity traceback with -e opt (#81271)
Also remove redundant warning about missing programs.

Includes integration tests to verify `-e` does not traceback.
2023-07-14 15:50:14 -07:00
Sloane Hertel
59a791ee3b
ansible-test - remove Fedora 37 container and remote support (#81093) 2023-07-13 08:50:15 -04:00
Matt Clay
08307de366
ansible-test - Remove obsolete WinRM setup script (#81249)
The WinRM setup is handled internally by ansible-core-ci now.
2023-07-12 19:52:49 -07:00
Matt Clay
876be11f8c
Add pymarkdown sanity test for core (#81220)
* Clean up markdown

* Add pymarkdown sanity test for core

* Update unit test SHA
2023-07-11 14:40:47 -07:00
Matt Clay
72e038e823
Remove docs and examples directories (#81011)
* Remove docs dir

* Updates to reflect docs removal

* Fix integration test

* Remove examples dir

* Updates to reflect examples removal

* Remove build_library and build-ansible.py

* Remove refs to build_library and build-ansible.py

* Remove obsolete template

* Remove obsolete template reference

* Remove the now obsolete rstcheck sanity test
2023-07-11 12:40:06 -07:00
Sloane Hertel
67b78a17c4
Remove Python 3.9 support for the controller (#80973)
* Remove obsolete Python <=3.9 controller code
* Remove Python 3.9 test controller bootstrapping
* Update test requirements

Co-authored-by: Matt Clay <matt@mystile.com>
2023-07-10 12:01:47 -04:00
Matt Clay
f4ff6768f3
ansible-test - Remove old pytest-forked constraint (#81185) 2023-07-07 13:10:42 -07:00
Matt Clay
3d2ff64264
ansible-test - Fix import sanity test for targets (#81184) 2023-07-06 22:57:10 -07:00
Martin Krizek
ca3ffbf4c2
ansible-test - remove test remotes: rhel 8.7/9.1 (#81065)
Fixes #80419
Fixes #80420
2023-07-06 11:25:57 -07:00
Sloane Hertel
ed8a404f4a
add coverage for Python 3.12 (#81125) 2023-06-26 10:38:22 -07:00
Brian Coca
e22fe9be56
ansible-test add alpine 3.18 as remote (#81109)
* add crun to avoid runc
2023-06-26 10:41:31 -04:00
Matt Clay
c3926268e2
ansible-test - Avoid using atexit module (#81096) 2023-06-21 14:41:25 -07:00
Abhijeet Kasurde
c69951daca
ansible-test: remove Ubuntu 20.04 LTS (#81070) 2023-06-20 11:25:12 -07:00
Abhijeet Kasurde
bc68ae8b97
ansible-test: Added Fedora 38 (#81074) 2023-06-20 11:24:08 -07:00
Matt Martz
6fead15334
Pylint deprecated comment checker (#81071)
Co-authored-by: Matt Clay <matt@mystile.com>
2023-06-15 16:14:52 -05:00
Brian Coca
534f688a53
remove Freebsd 13.1 from test matrix (#81058)
* remove Freebsd 13.1 from test matrix

fixes #80416


Co-authored-by: Matt Clay <matt@mystile.com>
2023-06-15 14:59:33 -04:00
Martin Krizek
cde15f3c81
Add test support for Python 3.11 on RHEL 8.8/9.2 (#80990)
Fixes #80412
Fixes #80413
2023-06-14 18:16:28 -07:00
Abhijeet Kasurde
c1bc445aa7
ansible-test - Update openSUSE containers (#81062)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-06-14 17:54:43 -07:00
Sloane Hertel
ecbbd7e5d1
Remove Python 3.5 support (#80972)
* Remove Python 3.5 support

* changelog

* add requested changes

* Update changelogs/fragments/remove-python3.5.yml

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

* remove Python3 < 3.5 error handling

* remove Python3 < 3.5 error handling in TE too

---------

Co-authored-by: Matt Clay <matt@mystile.com>
2023-06-15 00:05:50 +02:00
Matt Martz
92d5ffda82
Update galaxy_ng container for tests (#80721) 2023-06-07 09:09:01 -05:00
Sloane Hertel
742d47fa15
replace deprecated ast.value.s with ast.value.value (#80968)
* replace deprecated ast.value.s with ast.value.value

the s attribute is deprecated since Python 3.8 and emits a warning in
3.12 causing some test failures
2023-06-06 11:22:26 -04:00
Matt Clay
3a1d58bc58
ansible-test - Use raise from to handle exceptions (#80905) 2023-05-26 20:25:17 -07:00
Felix Fontein
a5bb4c7dee
ansible-test - local change detection without --fork-point (#79734) 2023-05-26 14:07:20 -07:00
Felix Fontein
9526338273
validate-modules and docsite build: bump antsibull-docs(-parser) dependencies to new major versions (#80846)
* Bump antsibull-docs-parser version to 1.0.0.

There are no functional changes that affect the functionality used in validate-modules.

* Bump antsibull-docs to 2.0.0.
2023-05-19 16:18:59 -07:00
Jordan Borean
0a36cd910e
Removed testing support for Server 2012 and 2012 R2 (#80778) 2023-05-18 11:02:58 -07:00
Matt Clay
b16041f1a9
ansible-test - Fix traceback when mixing sources (#80801)
* ansible-test - Fix traceback when mixing sources

* ansible-test - Refactor layout error handling
2023-05-17 09:07:04 -07:00
Martin Krizek
156493eed5
ansible-test - Add RHEL 9.2 support (#80755) 2023-05-11 14:36:36 +02:00
Matt Clay
aacab0633a
ansible-test - Fix handling of long timeouts (#80769) 2023-05-10 17:08:53 -07:00
Matt Clay
4c6aa70662
ansible-test - Fix timeout handling (#80764) 2023-05-10 14:55:57 -07:00
Matt Clay
fd341265d0
ansible-test - Avoid use of deprecated utcnow (#80750)
The timestamps are only used by ansible-test, not the junit callback, so this change only impacts ansible-test.
2023-05-10 11:26:49 -07:00
Matt Clay
790e0b0983
ansible-test - Update the NIOS test container (#80739) 2023-05-08 13:53:01 -07:00
Matt Clay
cdeb607b1d
ansible-test - Always use unique container names (#80724) 2023-05-04 15:41:14 -07:00
Brian Coca
d12aa7f69c
Add FreeBSD 13.2 to ansible-test (#80698) 2023-05-03 10:24:53 -07:00
Matt Clay
2cd1744be3
Use ansible.module_utils.common.text.converters (#80704)
Replace use of old `ansible.module_utils._text` and add a unit test to maintain backwards compatibility.
2023-05-03 08:58:00 -07:00
Matt Clay
5e220416a2
ansible-test - Update the default containers (#80635) 2023-04-25 14:54:04 -07:00
Matt Clay
372fc99686
ansible-test - Update pylint to 2.17.3 (#80632) 2023-04-25 12:45:26 -07:00
Matt Clay
abc58c026b
ansible-test - Use FreeBSD packaged setuptools (#80615)
This will avoid issues during bootstrapping caused by breaking changes in setuptools.
2023-04-24 12:13:59 -07:00
Matt Clay
7b50571588
ansible-test - Remove deprecated features (#80558) 2023-04-18 17:17:22 -07:00
Matt Clay
1fdeff949c
ansible-test - Update default containers (#80559) 2023-04-18 17:16:29 -07:00
Matt Clay
ba47dd9ef4
ansible-test - Update pylint to 2.17.2 (#80555) 2023-04-18 13:44:27 -07:00
Matt Clay
676b731e6f
ansible-test - Replace pytest-forked (#80525)
- Unit tests now report warnings generated during test runs.
- Python 3.12 warnings about `os.fork` usage with threads (due to `pytest-xdist`) are suppressed.
- Added integration tests to verify forked test behavior.
2023-04-14 15:13:58 -07:00
Matt Clay
0371ea08d6
ansible-test - Add support for argcomplete 3 (#80482) 2023-04-11 12:03:18 -07:00
Matt Martz
62211097cb
Expand pylint deprecated plugin to catch ansible.module_utils.common.warnings uses (#80462) 2023-04-11 11:45:56 -05:00
Matt Clay
f9534fd7b7
ansible-test - Update default containers (#80468) 2023-04-10 14:29:09 -07:00
Matt Martz
7251938370
ansible.builtin inferred by collection_name == None (#80446) 2023-04-06 13:51:39 -05:00
Felix Fontein
92c694372b
Replace validate-modules's semantic markup parser with antsibull-docs-parser (#80406) 2023-04-05 17:45:44 -07:00
Felix Fontein
2f647e9617
Implement semantic markup support for Ansible documentation in validate-modules. (#80243) 2023-03-31 14:14:35 -07:00
Matt Clay
5d64024f1a
ansible-test - Fix packaging change classification (#80360) 2023-03-29 17:54:30 -07:00
Matt Clay
d8adc081d8
ansible-test - Update base and default container (#80355) 2023-03-29 14:59:44 -07:00
Matt Clay
49b5c80c41
ansible-test - Update sanity test requirements (#80354) 2023-03-29 12:15:25 -07:00
Matt Clay
8ce102f302
ansible-test - Remove macos/12.0 remote (#80319) 2023-03-27 12:56:13 -07:00
Wong Hoi Sing Edison
016b7f71b1
ansible-galaxy - support resolvelib >= 0.5.3, < 1.1.0 (#80196)
* ansible-galaxy - support `resolvelib >= 0.5.3, < 1.1.0`

<https://pypi.org/project/resolvelib/1.0.1> released on 2023-03-09:

-   <https://github.com/sarugaku/resolvelib/blob/main/CHANGELOG.rst#101-2023-03-09>
-   <https://github.com/sarugaku/resolvelib/releases/tag/1.0.1>

Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>

* Trigger CI by pinning resolvelib with latest version

Since resolvelib is pre-installed in our test containers, we should temporarily pin the latest version allowed to force the tests to run with that version. Once the tests have passed that commit can be reverted.

Please make those changes without force pushing, so that we keep the reference to the passing CI run. We can squash the commits when merging the PR so the temporary commits won't be in the final commit merged to the devel branch.

Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>

* https://github.com/ansible/ansible/pull/80196#discussion_r1136003637

Also test resolvelib with multiple supported versions.

Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>

* Revert "Trigger CI by pinning resolvelib with latest version"

This reverts commit 5518e5dbca01b87d13850cee9ccdbdc1ee49188f.

---------

Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
2023-03-27 16:19:23 +02:00
Felix Fontein
4ea50cef23
validate-modules: check_mode attribute and compare with supports_check_mode parameter (#80090)
Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>
2023-03-23 09:59:33 -07:00
Felix Fontein
5388f6020a
validate-modules: support plugin see-also (#80244) 2023-03-23 09:48:22 -07:00
Matt Clay
6a6824f570
ansible-test - Update CloudStack test container (#80278) 2023-03-23 09:28:23 -07:00
Matt Clay
cf8fa5e75c
ansible-test - Update sanity test requirements (#80279) 2023-03-22 17:47:06 -07:00
Matt Clay
bad8843124
ansible-test - Update git diff handling (#80202)
This change allows ansible-test to work with newer versions of git on AZP.
2023-03-13 15:29:09 -07:00
Matt Clay
f3bc0f18ff
ansible-test - Update base and default container (#80178) 2023-03-08 14:38:14 -08:00
Matt Clay
85b5f31f75
Update mypy to 1.1.1 (#80175) 2023-03-08 13:11:03 -08:00
Matt Clay
c564c6e21e
ansible-test - Update pylint requirements (#80172) 2023-03-08 12:15:02 -08:00
Matt Clay
31658031ed
ansible-test - Remove pointless comparison (#80168) 2023-03-08 11:06:54 -08:00
Matt Clay
367d45facd
ansible-test - Fix error with missing pylint home (#80155) 2023-03-06 19:49:21 -08:00
Matt Clay
27287b40c0
ansible-test - Fix pylint error with old home dir (#80151) 2023-03-06 17:58:14 -08:00
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
2023-03-03 04:30:30 +01:00
Matt Clay
f47bc03599
Relocate the AZP entry point scripts (#80114)
Scripts previously under `test/utils/shippable/` are now under `.azure-pipelines/commands/` instead.
2023-02-28 13:21:11 -08:00
Mark Chappell
f64e79be41
sanity tests - ignore pre-release versions for deprecation comparisons (#79185) 2023-02-27 13:23:40 -08:00
Matt Clay
2f62db842d
ansible-test - Update base and default container (#80086) 2023-02-23 17:19:14 -08:00
Matt Clay
6bfe6b899a
ansible-test - Fix vendoring support (#80074)
- Support loading of vendored Python packages.
- Exclude vendored Python packages from payloads.
2023-02-23 12:45:43 -08:00
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.
2023-02-21 13:50:32 -08:00
Matt Clay
39a5b08ca6
ansible-test - Update base and default container (#80058) 2023-02-21 12:24:29 -08:00
Sviatoslav Sydorenko
c05d813661
Fix #80020 typos confusing pylint for pytest (#80056) 2023-02-21 08:43:24 -08:00
Matt Clay
ecf66c6f82
ansible-test - Update mypy and pylint requirements (#80049) 2023-02-20 20:39:54 -08:00
Matt Clay
5e3db6e441
ansible-test - Show Python version before install (#80022)
Always indicate the Python version being used before installing requirements.
2023-02-20 17:55:04 -08:00
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.
2023-02-20 17:54:34 -08:00
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.
2023-02-20 17:54:20 -08:00
Sandra McCann
967a88963f
Update docs requirements to latest package versions (#79930)
Co-authored-by: Matt Clay <matt@mystile.com>
2023-02-17 13:32:21 -05:00
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.
2023-02-14 12:39:04 -08:00
Matt Clay
67d49734f7 ansible-test - Support Podman 4.4.0+ 2023-02-14 12:17:42 -08:00
Matt Clay
d67b436eba
ansible-test - Improve pylint backwards compat (#79997) 2023-02-14 11:34:39 -08:00
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
2023-02-13 10:49:58 -08:00
Matt Clay
43487c6581
ansible-test - Enable unused-import pylint rule (#79912)
This was previously enabled for core. This change enables it for collections.
2023-02-13 10:09:05 -08:00
Matt Clay
10bc8af5a2
ansible-test - Remove auto format pylint rule (#79985) 2023-02-13 09:21:11 -08:00
Matt Clay
58d84933fc
ansible-test - Clean up indentation and spaces (#79980) 2023-02-10 14:53:36 -08:00
Matt Clay
71f2e777ed
Update mypy to version 1.0.0 (#79963) 2023-02-09 16:52:31 -08:00
Felix Fontein
0793833847
ansible-test - Fix collection delegation (#79947) 2023-02-08 00:24:20 -08:00
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.
2023-02-07 21:11:51 -08:00
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
2023-02-07 12:18:20 -08:00
Matt Clay
402ae0aa5d
ansible-test - Remove old containers and remotes (#79929) 2023-02-06 10:49:56 -08:00
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.
2023-02-03 16:22:40 -08:00
Matt Clay
e658995760
ansible-test - Enable pylint unused-import for core (#79910) 2023-02-03 15:42:09 -08:00
Matt Clay
4706af58ab
ansible-test - Enable trailing-comma-tuple pylint rule (#79909) 2023-02-03 15:19:35 -08:00
Matt Clay
1fd0265e22
ansible-test - Update default containers (#79887) 2023-02-02 09:31:30 -08:00
Matt Clay
d48d1c23df
ansible-test - Specify config path in plugin error (#79881) 2023-02-02 00:21:38 -08:00
Matt Clay
0a53309f47
ansible-test - Update pylint to 2.16.0 (#79878) 2023-02-01 12:40:36 -08:00
Matt Clay
1dce45c42d
ansible-test - Update base and default containers (#79846) 2023-01-30 12:32:47 -08:00
Matt Clay
52d3d39ffc
ansible-test - Deprecate the foreman test plugin (#79821) 2023-01-25 16:51:43 -08:00
Matt Clay
7e53ec3c01
ansible-test - Update the NIOS test container (#79820) 2023-01-25 16:31:31 -08:00
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).
2023-01-25 16:05:25 -08:00
Matt Clay
27cd5e77d8
Update mypy and its dependencies. (#79812)
* Update mypy and its dependencies.

* Fix requirements.

* Remove unnecessary matching constraints.
2023-01-25 12:46:09 -08:00
Matt Clay
7329ec6936
ansible-test - Update CloudStack plugin container (#79813) 2023-01-25 11:22:28 -08:00
Felix Fontein
5fb8bc3ddb
Bump acme test container. (#79783) 2023-01-25 08:53:23 -08:00
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.
2023-01-24 13:25:32 -08:00
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.
2023-01-23 16:56:07 -08:00
Matt Clay
5f58015527 ansible-test - Remove obsolete DirectoryTarget.
This code has been unused since at least the 2.9 release.
2023-01-23 16:08:58 -08:00
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.
2023-01-23 15:48:12 -08:00
Matthew Davis
8e80b03b33
document where to save cloud config files (#79412) 2023-01-19 15:25:16 -08:00
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/.
2023-01-16 14:15:55 -05:00
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
2023-01-11 08:05:50 +10:00
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>
2023-01-10 11:09:57 -06:00
Matt Clay
1375861ec2 ansible-test - Update available platforms. 2023-01-06 17:13:20 -08:00
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>
2023-01-06 11:34:35 -08:00
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.
2022-12-15 19:42:58 -08:00
Matt Clay
75b60b17ee ansible-test - Support RSA SHA-1 for SSH clients. 2022-12-14 09:19:33 -08:00
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.
2022-12-12 12:12:16 -08:00
Matt Clay
dcc08eec35 ansible-test - Fix target PyPI proxy config. 2022-12-12 09:51:02 -08:00
Martin Krizek
0a12d8a5bc
ansible-test - fix warning to include image name (#79560) 2022-12-09 05:21:00 +10:00
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
2022-12-05 20:46:15 -08:00
Matt Clay
80d2f8da02
ansible-test - Fix container detection. (#79530) 2022-12-05 13:33:14 -08:00
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.
2022-11-29 13:40:04 -08:00
Matt Clay
cda16cc5e9
ansible-test - Improve container management. (#78550)
See changelogs/fragments/ansible-test-container-management.yml for details.
2022-11-29 13:35:53 -08:00
Matt Clay
38fe34244c ansible-test - Fix completion error in Python 3.11. 2022-11-28 19:41:47 -08:00
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>
2022-11-23 08:57:24 -05:00
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.
2022-11-15 10:03:47 -05:00
Felix Fontein
e0118d9d03
The attribute was renamed to 'action' and the extra data was not used anymore. (#79317) 2022-11-08 10:16:52 -05:00