100 Commits
Author SHA1 Message Date
Matt ClayandGitHub 59aa0145d2 Fix various issues in unsafe_proxy (#82326)
- Use str/bytes directly instead of text_type/binary_type
- Fix AnsibleUnsafeBytes.__str__ implementation
- Fix AnsibleUnsafeBytes.__format__ return type
- Remove invalid methods from AnsibleUnsafeBytes (casefold, format, format_map)
- Use `chars` instead of `bytes` to match stdlib naming
- Remove commented out code
2023-12-01 09:28:05 -08:00
Matt Clay 31aac52a72 [stable-2.16] ansible-test - Fix parsing of cgroup entries
(cherry picked from commit e933d9d8a6)

Co-authored-by: Matt Clay <matt@mystile.com>
2023-10-23 09:47:54 -07:00
Matt Clay 00f74e03b2 [stable-2.16] Fix subversion integration test (#82029)
- Remove dependency on the htpasswd module (and thus passlib)
- Fix setup/teardown of the httpd process
- Fix cleanup of temporary directories.
(cherry picked from commit 09d943445c)

Co-authored-by: Matt Clay <matt@mystile.com>
2023-10-23 09:46:55 -07:00
Matt ClayandGitHub 33248690fe ansible-test - Update base/default containers (#81956) 2023-10-11 16:37:29 -07:00
Matt ClayandGitHub f9dfd28cff [stable-2.16] Update default test container Python to 3.12 and support for PyLint 3.0.1 (#81953) (#81955)
* 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.

(cherry picked from commit d8484f0af7)
2023-10-11 13:53:55 -07:00
Matt ClayandGitHub 2578664198 [stable-2.16] ansible-test - Update distro containers (#81851) (#81859)
* ansible-test - Update distro containers

* Update the alpine3 container to Python 3.11

* Update changelog.

(cherry picked from commit b7903669b4)
2023-10-03 18:29:45 +00:00
Matt ClayandGitHub 8c4736dd76 [stable-2.16] ansible-test - Invoke container sleep through env (#81853) (#81856)
(cherry picked from commit 20f17687da)
2023-10-03 16:50:15 +00:00
Matt ClayandGitHub 58cf53b3c3 [stable-2.16] ansible-test - Improve compatibility with pylint 3 (#81841) (#81842)
(cherry picked from commit f31c287348)
2023-10-02 13:07:27 -07:00
Matt ClayandGitHub c2567b1d67 [stable-2.16] ansible-test - Update sanity test requirements (#81810) (#81811)
(cherry picked from commit d6a356d7cd)
2023-09-28 15:49:58 -07:00
Matt ClayandGitHub e3eecf096f [stable-2.16] ansible-test - Skip pylint test on Python 3.12 (#81706) (#81757)
(cherry picked from commit 3794612832)
2023-09-21 23:05:04 -07:00
Matt ClayandGitHub 7d3d4572ed Fix set filters to use set operations (#81639)
* Fix set filters to use set operations

* Fix integration tests

* Update filter documentation
2023-09-11 09:32:32 -07:00
Matt ClayandGitHub 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 ClayandGitHub e1e0e2709c ansible-test - Enable thread code coverage (#81604)
ci_complete
ci_coverage
2023-08-30 14:39:47 -07:00
Matt ClayandGitHub 261e5ce381 ansible-test - Update mypy to 1.5.1 (#81602) 2023-08-30 10:39:25 -07:00
Matt ClayandGitHub 6627ba9ace Unit test cleanup (#81556)
* Fix cleanup_tmp_file unit tests

* Simplify the problematic wcwidth chars unit test
2023-08-21 15:54:03 -07:00
Matt ClayandGitHub 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 ClayandGitHub 390e508d27 ansible-test - Always use managed entry points (#81537) 2023-08-17 19:13:29 -07:00
Matt ClayandGitHub 9afaf2216b Remove obsolete text from release.py PR template (#81526) 2023-08-16 10:52:20 -07:00
Matt ClayandGitHub 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
Matt ClayandGitHub d0699cb44a Add unit tests for module_utils.compat.datetime (#81483) 2023-08-09 12:24:10 -07:00
Matt ClayandGitHub 580b87252c Remove unreachable code in password lookup test (#81482) 2023-08-09 12:23:58 -07:00
Matt ClayandGitHub 726d9a5fcc Fix constructed inventory plugin unit test (#81481) 2023-08-09 12:23:47 -07:00
Matt ClayandGitHub 85d3305889 Fix f-string whitespace in release script (#81477) 2023-08-09 09:35:38 -07:00
Matt ClayandGitHub 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 ClayandGitHub dbb3feddaf Update update-sanity-requirements.py script (#81424)
Frozen requirements can now preserve any explicitly installed package that would normally be omitted, not just setuptools.
2023-08-03 10:58:19 -07:00
Matt ClayandGitHub c525514994 ansible-test - Update source layout detection (#81418) 2023-08-02 20:24:13 -07:00
Matt ClayandGitHub 0c03a6bcf6 Add changelog fragment for docs/examples removal (#81410) 2023-08-02 12:27:10 -07:00
Matt ClayandGitHub b9daa6891f Remove unused sanity test code (#81398) 2023-08-01 14:08:01 -07:00
Matt ClayandGitHub 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
Matt ClayandGitHub 081c60b9d3 Include subcommands in generated man pages (#81378)
Sub commands of `ansible-galaxy role` and `ansible-galaxy collection` are now documented.
2023-07-31 13:04:17 -07:00
Matt ClayandGitHub 32b388b4ca Fix missing command descriptions in manpages/docs (#81366) 2023-07-28 18:01:11 -07:00
Matt ClayandGitHub f9d674fcfd Fix command doc lookup in man page generation (#81365) 2023-07-28 16:24:04 -07:00
Matt ClayandGitHub fead654671 Exclude internal options from man pages and docs (#81360) 2023-07-28 14:58:18 -07:00
Matt ClayandGitHub c8bc393871 Raise the minimum setuptools version to 66.1.0 (#81341)
* Raise the minimum setuptools version to 66.1.0

This is the first version to support Python 3.12.

While Python 3.10 and 3.11 could use an older version, a consistent minimum is easier to work with and test against.

* Fix PEP 517 integration test
2023-07-24 16:02:05 -07:00
Matt ClayandGitHub 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
Matt ClayandGitHub 18cbfc688b Add missing skip entries for selinux module_util (#81305) 2023-07-18 18:27:25 -07:00
Matt ClayandGitHub 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 ClayandGitHub 261a12b8a9 Disable cron integration test on Alpine (#81301)
The tests are now failing due to the lack of `libfaketime` in the Alpine repos.
2023-07-18 17:38:37 -07:00
Matt ClayandGitHub 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 ClayandGitHub 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
Matt ClayandGitHub 26cb1652bc Add docs and examples to obsolete-files test (#81258) 2023-07-13 16:20:37 -07:00
Matt ClayandGitHub 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 ClayandGitHub b93a628aed Omit hacking directory from MANIFEST.in (#81245)
* Omit `hacking` directory from `MANIFEST.in`

* Update package-data sanity test
2023-07-12 14:43:08 -07:00
Matt ClayandGitHub 7c6564ad0e Revert "define code owners to support branch-protection rules on docs (#81041)" (#81228)
This reverts commit 9117762358.
2023-07-11 16:27:29 -07:00
Matt ClayandGitHub 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 ClayandGitHub 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
Matt ClayandGitHub 38e50c9f81 Convert non-docs *.rst files to *.md (#81217)
* Rename README.rst to README.md

* Change README format from reStructuredText to Markdown

* Fix whitespace in README.md

* Update setup.cfg to use README.md

* Replace changelog placeholder with README.md

* Update package-data sanity test
2023-07-11 11:42:40 -07:00
Matt ClayandGitHub f4ff6768f3 ansible-test - Remove old pytest-forked constraint (#81185) 2023-07-07 13:10:42 -07:00
Matt ClayandGitHub 3d2ff64264 ansible-test - Fix import sanity test for targets (#81184) 2023-07-06 22:57:10 -07:00
Matt ClayandGitHub f1ddcb4ae4 Simplify release name tracking and testing (#81151)
Convert the release names list from YAML to plain text, removing the need for YAML parsing in the sanity test.
2023-06-29 10:18:15 -07:00
Matt ClayandGitHub 8c9f5c9106 Remove unused unit test code (#81150) 2023-06-28 16:26:00 -07:00
Matt ClayandGitHub b06f7de24a Remove unused strategy plugin unit tests (#81146) 2023-06-28 12:07:25 -07:00
Matt ClayandGitHub 63946eaed6 Remove unreachable code in curses unit test (#81138) 2023-06-27 23:24:42 -07:00
Matt ClayandGitHub 5f58775a1f More unit test code coverage improvements (#81136) 2023-06-27 17:38:35 -07:00
Matt ClayandGitHub e535eb625b Remove long obsolete hacking/get_library.py (#81122) 2023-06-23 18:42:48 -07:00
Matt ClayandGitHub 5b586096b3 Remove hacking/fix_test_syntax.py (#81121)
This script is no longer needed, since using tests as filters was removed in 2.9.
2023-06-23 18:31:42 -07:00
Matt ClayandGitHub 7e2b25beac Revert "Add a custom policy for hackers using ansible-test (#68535)" (#81120)
This reverts commit bd9e31fcb0.
2023-06-23 17:36:36 -07:00
Matt ClayandGitHub 82b5544b09 Improve code coverage of unit tests (#81119)
- Remove unused code
- Remove unnecessary code
- Ignore coverage for unreachable code
- Use previously unused code to increase coverage
2023-06-23 16:08:54 -07:00
Matt ClayandGitHub da2cd157f1 Fix arg splitting and key/value parsing (#80030)
* Improve readability of unit test output

This drops the trailing `-expectedXXX` suffixes from test names generated by parametrize.

* Add more splitter unit tests

This fills in code coverage gaps in the exising unit tests.

* Bug fixes and code cleanup

- Fix IndexError exceptions caused by parsing a leading newline, space or escaped space.
- Fix an AttributeError exception in `parse_args` when parsing `None`.
- Fix incorrect parsing of multi-line Jinja2 blocks, which resulted in doubling newlines.
- Remove unreachable exception handlers in the `parse_kv` function.
  The unreachable code was verified through analysis of the code as well as use of the `atheris` fuzzer.
- Remove unnecessary code in the `split_args` function.
- Add an optimization to `split_args` for the empty args case.

* Add unit tests for bug fixes

The splitter code is now fully covered by unit tests.

* Add another issue ref in changelog
2023-06-22 16:19:52 -07:00
Matt ClayandGitHub c3926268e2 ansible-test - Avoid using atexit module (#81096) 2023-06-21 14:41:25 -07:00
Matt ClayandGitHub cf4d4577ac Remove hacking dir dependency from build backend (#81021)
* Copy man generation files into build backend

* Use copied files in build backend
2023-06-09 16:56:48 -07:00
Matt ClayandGitHub 6ac0ea3567 Use *.md instead of *.rst for test READMEs (#81009) 2023-06-08 23:04:32 -07:00
Matt ClayandGitHub ff359fa8e1 Reorganize CI sanity test matrix (#81004) 2023-06-08 13:07:54 -07:00
Matt ClayandGitHub b3f1290bcd Remove docs dir dependency from man page build (#81003) 2023-06-08 12:41:45 -07:00
Matt ClayandGitHub 6e325d9e4d Clean up MANIFEST.in (#80688)
* Remove unnecessary MANIFEST.in commands

This eliminates more setuptools warnings during build.

* Sort MANIFEST.in

Now that only include commands are used, the order of the commands no longer effects the build output.
2023-06-06 14:48:16 -07:00
Matt ClayandGitHub 3a1d58bc58 ansible-test - Use raise from to handle exceptions (#80905) 2023-05-26 20:25:17 -07:00
Matt ClayandGitHub 43c31c5dc2 Use isinstance in unit tests for type checks (#80906) 2023-05-26 19:25:26 -07:00
Matt ClayandGitHub 585b82838b Improve code coverage of unit tests (#80904)
* Improve coverage of validate-modules unit tests

* Remove unused galaxy unit test code

* Fix galaxy unit test teardown logic

* Improve coverage of galaxy unit test code

* Improve coverage of galaxy unit tests

* Remove unused code in galaxy API tests

* Remove unused galaxy collection unit test code

* Improve coverage of galaxy collection unit tests

* Remove unused galaxy unit test code
2023-05-26 16:54:11 -07:00
Matt ClayandGitHub 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
Matt ClayandGitHub 2fd64161c1 Fix hard-coded interpreter in test_async_wrapper (#80816) 2023-05-16 16:55:57 -07:00
Matt ClayandGitHub e837680f4b Use strings for removal_date in runtime metadata (#80815) 2023-05-16 14:23:46 -07:00
Matt ClayandGitHub 2ba24957dd Use subset checks for some collection loader tests (#80812) 2023-05-16 10:29:46 -07:00
Matt ClayandGitHub aacab0633a ansible-test - Fix handling of long timeouts (#80769) 2023-05-10 17:08:53 -07:00
Matt ClayandGitHub 4c6aa70662 ansible-test - Fix timeout handling (#80764) 2023-05-10 14:55:57 -07:00
Matt ClayandGitHub 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 ClayandGitHub 905131fc76 junit-xml - Remove outdated type ignore hint (#80748) 2023-05-09 17:20:41 -07:00
Matt ClayandGitHub 790e0b0983 ansible-test - Update the NIOS test container (#80739) 2023-05-08 13:53:01 -07:00
Matt ClayandGitHub cdeb607b1d ansible-test - Always use unique container names (#80724) 2023-05-04 15:41:14 -07:00
Matt ClayandGitHub 7eada15d1e Remove unused code from lib/ansible/collections/ (#80712) 2023-05-03 18:41:25 -07:00
Matt ClayandGitHub 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 ClayandGitHub eea7137449 Fix os.walk issues in package-data sanity test (#80703) 2023-05-02 16:17:00 -07:00
Matt ClayandGitHub 54576cd794 pep517 backend - Copy symlinks when copying source (#80690) 2023-05-02 14:35:59 -07:00
Matt ClayandGitHub 23e2ca91c2 Improve coverage of role unit tests (#80695) 2023-05-02 10:53:42 -07:00
Matt ClayandGitHub 251360314d Fix docs-build test to not mutate source tree (#80689) 2023-05-01 17:04:13 -07:00
Matt ClayandGitHub 884215bd1c Improve unit test code coverage (#80683) 2023-05-01 09:41:43 -07:00
Matt ClayandGitHub d37678c5ff Release tool improvements (#80641)
* Provide reproducible sdist builds.
* Use reproducible wheel builds.
* Add PyPI artifact checks.
2023-05-01 09:30:19 -07:00
Matt ClayandGitHub 71f6e10dae Use assertRaisesRegex in unit test (#80663) 2023-04-27 12:43:35 -07:00
Matt ClayandGitHub 5ac292e12d Use package_data instead of include_package_data (#80652)
This resolves warnings generated by setuptools such as the following:

_Warning: Package 'ansible.galaxy.data' is absent from the `packages` configuration.
2023-04-26 16:23:26 -07:00
Matt ClayandGitHub 4d25e3d54f Set the minimum setuptools to 45.2.0 (#80649)
Also update the package-data sanity test to use the minimum setuptools version.
2023-04-26 16:01:56 -05:00
Matt ClayandGitHub 5e220416a2 ansible-test - Update the default containers (#80635) 2023-04-25 14:54:04 -07:00
Matt ClayandGitHub 372fc99686 ansible-test - Update pylint to 2.17.3 (#80632) 2023-04-25 12:45:26 -07:00
Matt ClayandGitHub 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 ClayandGitHub 560d5b00d0 Remove docs references to obsolete test plugins (#80576) 2023-04-19 14:40:58 -07:00
Matt ClayandGitHub 7b50571588 ansible-test - Remove deprecated features (#80558) 2023-04-18 17:17:22 -07:00
Matt ClayandGitHub 1fdeff949c ansible-test - Update default containers (#80559) 2023-04-18 17:16:29 -07:00
Matt ClayandGitHub ba47dd9ef4 ansible-test - Update pylint to 2.17.2 (#80555) 2023-04-18 13:44:27 -07:00
Matt ClayandGitHub 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 ClayandGitHub 43c5cbcaef Fix galaxy CLI unit test assertions (#80504) 2023-04-12 10:32:59 -07:00
Matt ClayandGitHub 3ec828703f Fix unit test asserts (#80500) 2023-04-12 10:04:42 -07:00
Matt ClayandGitHub e87802cf2c pep517 backend - Use correct import_module import (#80480) 2023-04-12 10:00:09 -07:00