Commit Graph

38 Commits

Author SHA1 Message Date
Matt Clay
6b2b665ef7
Add support for Python 3.14 and drop Python 3.8 (#85576) 2025-07-28 16:16:14 -07:00
Matt Clay
7ef13cb29e
ansible-test - Add remote debugging support (#85317) 2025-06-12 18:57:36 +00:00
Matt Clay
4b0a5c5c63
ansible-test - Relocate internal CLI args (#85308)
This improves consistency by locating them with other global options.
2025-06-12 03:24:50 +00:00
Matt Clay
76ad0b636f
ansible-test - Move metadata to environment (#85307) 2025-06-12 00:18:09 +00:00
Matt Davis
35750ed321
Templating overhaul, implement Data Tagging (#84621)
Co-authored-by: Matt Davis <mrd@redhat.com>
Co-authored-by: Matt Clay <matt@mystile.com>
2025-04-14 08:54:36 -07:00
Matt Clay
5ff8d093f0
ansible-test - Code style cleanup (#84749)
* ansible-test - Minor style cleanup (add blank lines)

* ansible-test - Use `"""` instead of `'''`
2025-02-25 04:47:45 +00:00
Matt Clay
989e583356
ansible-test - Initial support for black in core (#84741) 2025-02-24 08:39:59 +00:00
Matt Clay
81e025b414 ansible-test - Add Windows remote connection option 2024-08-15 13:40:42 -07:00
Matt Clay
906c969b55
ansible-test - Improve unknown env error message (#83610) 2024-07-15 16:37:40 +00:00
Matt Clay
4c6aa70662
ansible-test - Fix timeout handling (#80764) 2023-05-10 14:55:57 -07:00
Matt Clay
7b50571588
ansible-test - Remove deprecated features (#80558) 2023-04-18 17:17:22 -07:00
Matt Clay
0371ea08d6
ansible-test - Add support for argcomplete 3 (#80482) 2023-04-11 12:03:18 -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
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
58d84933fc
ansible-test - Clean up indentation and spaces (#79980) 2023-02-10 14:53:36 -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
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
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.
2022-08-04 22:29:38 -07:00
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.
2022-08-04 15:51:11 -07:00
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.
2022-08-04 12:15:46 -07:00
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.
2022-08-03 15:08:55 -07:00
Matt Clay
5666c6d6a3 ansible-test - More flexible become support. 2022-06-17 17:37:42 -07:00
Matt Clay
2f0530396b ansible-test - Clean up type hints and comments. 2022-06-08 23:31:58 -07:00
Matt Clay
f933314101 ansible-test - Fix shell target options handling. 2022-06-01 12:49:51 -07:00
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
2022-05-18 12:19:07 -07:00
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.
2022-05-05 09:09:57 -07:00
Matt Clay
2cc74b04c4 ansible-test - Add multi-arch remote support. 2022-04-29 18:20:14 -07:00
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.
2022-02-28 14:37:09 -08:00
Matt Clay
de5f60e374
ansible-test - Improve help for unsupported cwd. (#76866)
* ansible-test - Improve help for unsupported cwd.

* The `--help` option is now available when an unsupported cwd is in use.
* The `--help` output now shows the same instructions about cwd as would be shown in error messages if the cwd is unsupported.
* Add `--version` support to show the ansible-core version.
* The explanation about cwd usage has been improved to explain more clearly what is required.

Resolves https://github.com/ansible/ansible/issues/64523
Resolves https://github.com/ansible/ansible/issues/67551
2022-01-27 12:32:11 -08:00
Matt Clay
e9ffcf3c85
ansible-test - Defer loading of completion entries. (#76852)
* ansible-test - Defer loading of completion entries.

This avoids a traceback when running ansible-test outside of a supported directory.
2022-01-25 13:24:17 -08:00
Matt Clay
d2daa67b00 ansible-test - Fix type hints. 2022-01-05 10:04:06 -08:00
Matt Clay
4e70156d7e
ansible-test - Code cleanup. (#76540)
* Add missing typing imports.
* Remove unnecessary non-capturing group.
* Whitespace.
* Add type hints.
* Ignore PyCharm false positives.
* Remove Python 2.x plugin loading logic.
* Remove Python 2.x exception handling.
* Remove Python 2.x display logic.
* Add changelog.
2021-12-10 15:49:51 -08:00
Matt Martz
66a83314b9
Modernize install (#76021)
Co-authored-by: Matt Clay <matt@mystile.com>
Co-authored-by: Matt Davis <mrd@redhat.com>
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
2021-10-19 14:24:57 -05:00
Matt Clay
8cef40f839 ansible-test - Fix inventory path. 2021-10-07 10:19:34 -07:00
Matt Clay
e3fd9b0769 ansible-test - Add --prime-containers option.
Resolves https://github.com/ansible/ansible/issues/75320

The option `--prime-containers` was chosen over `--docker-pull-only` to match the recently added `--prime-venvs` option for sanity tests.
It would also fit well with a future `--prime-requirements` option for pre-installing requirements for unit and integration tests.
2021-09-23 15:52:34 -07:00
Matt Clay
94410789d1 ansible-test - Add --prime-venvs option. 2021-09-21 00:03:33 -07:00
Matt Clay
4ea8d9a782
ansible-test - split controller/target testing (#75605) 2021-09-20 18:39:07 -07:00