summaryrefslogtreecommitdiffstats
path: root/test/lib/ansible_test/_internal/util.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* ansible-test - Fix interactive cmd traceback (#84264)Matt Clay2024-11-061-3/+3
|
* ansible-test - Improve container probe error handling (#84109)Matt Clay2024-10-111-8/+16
|
* ansible-test - Add Windows remote connection optionMatt Clay2024-08-151-0/+40
|
* mypy: update code required to bump sanity requirementsAbhijeet Kasurde2024-03-211-1/+1
| | | | Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
* ansible-test - Always use managed entry points (#81537)Matt Clay2023-08-181-2/+0
|
* ansible-test - Fix sanity traceback with `-e` opt (#81271)Matt Clay2023-07-151-1/+1
| | | | | Also remove redundant warning about missing programs. Includes integration tests to verify `-e` does not traceback.
* Remove Python 3.9 support for the controller (#80973)Sloane Hertel2023-07-101-6/+1
| | | | | | | * 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>
* ansible-test - Fix timeout handling (#80764)Matt Clay2023-05-101-0/+4
|
* ansible-test - Fix vendoring support (#80074)Matt Clay2023-02-231-0/+17
| | | | - Support loading of vendored Python packages. - Exclude vendored Python packages from payloads.
* ansible-test - Improve code formatting (#79983)Matt Clay2023-02-131-0/+10
| | | | | | | | | | | | | | | | | * 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
* ansible-test - Clean up indentation and spaces (#79980)Matt Clay2023-02-101-31/+31
|
* ansible-test - Fix various type hinting issues. (#79798)Matt Clay2023-01-241-7/+7
| | | | | | | | | | | | | | | | | * 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.
* ansible-test - Avoid direct use of `errno`.Matt Clay2022-11-291-9/+5
| | | | Error handling on Python 3.x no longer requires the use of `errno` to identify specific errors.
* ansible-test - Improve container management. (#78550)Matt Clay2022-11-291-0/+17
| | | See changelogs/fragments/ansible-test-container-management.yml for details.
* ansible-test - Verify executables are executable. (#78606)Matt Clay2022-08-201-0/+10
|
* ansible-test - No locale warning with delegation. (#78505)Matt Clay2022-08-111-2/+2
| | | | 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.
* ansible-test - Avoid use of deprecated type hints. (#78456)Matt Clay2022-08-051-32/+33
| | | | | | | | | * 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.
* ansible-test - More type hint updates. (#78455)Matt Clay2022-08-051-6/+6
| | | | | | | | | | | * 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.
* ansible-test - Convert more type hints. (#78449)Matt Clay2022-08-041-32/+32
| | | | | | | | | * 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.
* ansible-test - Use more native type hints. (#78435)Matt Clay2022-08-041-29/+29
| | | | | | | | | | | | | | | | | * 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.
* ansible-test - Update locale logic to match core. (#78389)Matt Clay2022-08-031-1/+15
| | | | | | | 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.
* ansible-test - Fix TTY and output handling. (#78350)Matt Clay2022-07-261-14/+35
|
* ansible-test - Drop Python 3.8 controller support. (#78237)Matt Clay2022-07-201-1/+1
|
* ansible-test - Use shlex.join where appropriate.Matt Clay2022-06-181-2/+2
|
* ansible-test - Code cleanup.Matt Clay2022-06-011-6/+6
| | | | This helps prepare for a future pylint upgrade.
* ansible-test - Enhance the shell command. (#77734)Matt Clay2022-05-051-12/+34
| | | | | | | | | | | | | | | | | | | | | | | | * 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.
* ansible-test - Add multi-arch remote support.Matt Clay2022-04-301-0/+66
|
* ansible-test - Fix subprocess management. (#77641)Matt Clay2022-04-271-12/+173
| | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* Revert "ansible-test - Fix subprocess management. (#77638)"Matt Clay2022-04-261-18/+2
| | | | This reverts commit 62d03c8e752ee35057031a91d7028e0a2e5d43e4.
* ansible-test - Fix subprocess management. (#77638)Matt Clay2022-04-251-2/+18
| | | | | | | | | | | | | | | | | | | | * 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.
* ansible-test - Support multiple coverage versions.Matt Clay2022-04-201-0/+6
| | | | | ci_complete ci_coverage
* Support podman-remote in ansible-test (#75753)Matt Martz2022-03-091-13/+0
|
* ansible-test - Code cleanup and refactoring. (#77169)Matt Clay2022-02-281-7/+23
| | | | | | | | | | | | | | | | | * 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.
* ansible-test - Remove obsolete display of MAXFD.Matt Clay2022-02-241-6/+0
| | | | Use of ``subprocess.MAXFD`` only worked on Python 2.x, which is no longer supported.
* ansible-test - Clean up future boilerplate. (#76874)Matt Clay2022-01-281-0/+1
| | | | | | | | | | | | | | * ansible-test - Clarify need for empty __init__.py * ansible-test - Update code-smell boilerplate. * Update code-smell boilerplate for core. * Update future boilerplate test for ansible-test. All ansible-test code (except for targets) and core-specific sanity tests now use the same boilerplate. The test also checks for unwanted `__future__` and `metaclass` boilerplate. * Relocate target tools to the correct directory. Several tools used on target Python versions were incorrectly placed in the controller directory.
* ansible-test - Validate collection ns and name.Matt Clay2022-01-281-0/+6
| | | | Resolves https://github.com/ansible/ansible/issues/62079
* ansible-test - Fix plugin loading.Matt Clay2022-01-051-2/+1
| | | | This fixes a traceback when loading plugins that use dataclasses.
* ansible-test - Code cleanup. (#76540)Matt Clay2021-12-111-19/+8
| | | | | | | | | | | * 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.
* ansible-test - Remove support for Python 2.6.Matt Clay2021-09-301-3/+0
| | | | Deferring removal of obsolete constraints until container updates are required.
* ansible-test - More PEP 484 type hints.Matt Clay2021-09-251-38/+33
|
* ansible-test - Code cleanup. (#75774)Matt Clay2021-09-241-76/+28
| | | | * ansible-test - Remove unused code. * ansible-test - More PEP 484 type hints.
* ansible-test - split controller/target testing (#75605)Matt Clay2021-09-211-147/+124
|
* ansible-test - Move code from _data to _util. (#75495)Matt Clay2021-08-131-1/+7
| | | | | | | | | | | | | | | * Update paths to match relocated files. * Update ansible-test symlink paths. * Update path classification. * Update MANIFEST.in * Update sanity test context paths. * Update sanity ignores. * Update shebang sanity test. * Update configure-remoting-ps1 sanity test. * Update BOTMETA.yml to reflect new paths. * Update paths in collection loader comments. * Update Makefile for ansible-test. * Update docs. * Add changelog fragment.
* ansible-test - Upgrade pylint to 2.9.3. (#75480)Matt Clay2021-08-121-2/+2
| | | | | | | | | | | | | | | | * ansible-test - Upgrade `pylint` to 2.9.3. * Update pylint ignores due to rule name change. * Disable pylint deprecated-class for compat code. * Add pylint ignores for test support content. * Add ignores for arguments-renamed in lib/ansible/ * Add pylint ignores for collection_loader. * ansible-test - Ignore deprecations in legacy collection loader. * ansible-test - Suppress pylint consider-using-with * ansible-test - Suppress pylint false positive. * ansible-test - Suppress pylint consider-using-with. * ansible-test - Suppress pylint deprecated-module * Disable some of the new pylint suggestions. * Remove unnecessary six usage from string_format pylint plugin. * Remove obsolete ignore entry.
* ansible-test - add ssh debugging logging (#75374)Sam Doran2021-08-031-7/+12
|
* Add support for testing with Python 3.10.Matt Clay2021-05-101-0/+1
|
* Code cleanup in ansible-test. (#74529)Matt Clay2021-05-011-3/+3
| | | | | | | | | * Fix get_available_python_versions calls. * Make run_playbook vars optional. * Use ansible_pipelining in inventory. * Fix type hint. * Fix order of conditional evaluation. * Remove unused ibmi platform. * Add changelog fragment.
* Set ansible-test min controller Python to 3.8. (#74395)Matt Clay2021-04-231-3/+4
| | | | | - Version neutral sanity tests now require Python 3.8 or later. - Unit tests for controller-only code now require Python 3.8 or later.
* Overhaul ansible-test container management.Matt Clay2021-04-121-14/+43
| | | | This brings ansible-test closer to being able to support split controller/remote testing.
* Import sanity test for plugins (#72497)Felix Fontein2021-02-121-0/+17
|