Commit graph

29 commits

Author SHA1 Message Date
Matt Clay
cf9999692a Fix ansible-test encoding issues.
This fixes `ansible-test sanity --list-tests` which was failing when `LC_ALL=C` was set.
2019-07-25 23:29:42 -07:00
Matt Clay
79eca9c8fb
Initial ansible-test support for collections. (#59197)
* Initial ansible-test support for collections.
* Include cloud config in delegation payload.
* Add missing types import and fix `t` shadowing.
* Fix plugin traceback when config_path not set.
* Fix encoding issues.
* Remove unused imports.
* More encoding fixes.
* Handle delegation outside exception handler.
* Inject ssh keys only if not already in place.
* More defensive approach to getting remote pwd.
* Add missing string format var.
* Correct PowerShell require regex.
* Rename `is_install` and `INSTALL_ROOT`.
2019-07-22 19:24:48 -07:00
Matt Clay
2ed78b650f Update to ansible-test to prepare for collections.
Changes to simplify merging of collections support.
2019-07-16 08:04:07 -07:00
Matt Clay
4b9391f32a Clean up ansible-test target handling. 2019-07-15 20:33:23 -07:00
Matt Clay
f81238012b Clean up pylint issues in test infra. 2019-07-15 14:45:30 -07:00
Matt Clay
6645054329
Code cleanup for test infrastructure. (#59046)
* Remove useless object inheritance in test code.
* Remove unnecessary pass statements from test code.
* Comment on why certain pylint rules are ignored.
* Add more pylint test contexts.
* Fix import order.
* Remove unused variables.
* Remove unnecessary pass statement.
* Fix bad continuations.
* Remove unnecessary elif.
* Allow legitimate broad except statements.
* Allow legitimate protected access.
* Clean up names to make pylint pass.
2019-07-12 13:17:20 -07:00
Matt Clay
3f2b766d10 Add future and metaclass boilerplate to test code.
Continue to ignore:

- test/integration/
- test/legacy/
- test/units/
2019-07-12 09:18:24 -07:00
Matt Clay
b06f5634c5 Simplify ansible-test target expansion.
Targets are always expanded to full lists now instead of optimizing
for shorter lists by collapsing directories.

This change only affects unit tests and the ansible-doc sanity test,
as they were the only remaining tests using the old behavior.
2019-06-27 08:27:48 -07:00
Jordan Borean
c2466c545b
Handle binary files when scanning metadata in python 3 (#53773) 2019-03-14 10:00:30 +10:00
Matt Clay
6842c0467f Fix ansible-test handling of empty test targets.
Previously empty test targets were ignored by ansible-test.
This would prevent them from participating in dependency analysis.
These targets are actually empty roles, and should be processed as such.
2019-01-16 00:03:43 -08:00
Matt Clay
6a0452559b Handle non-target file deps for integration tests.
Some integration test targets have dependencies on files outside
the `test/integration/targets/` directory tree. Changes to these
dependencies can result in unexpected test failures since they do
not trigger integration tests which depend on them.
2019-01-14 23:58:10 -08:00
Matt Clay
7b4bc572de
Fix ansible-test target dependency issues. (#50908)
* Log dependencies at verbosity level 4.

This makes it easier to debug target dependency issues.

* Scan symlinks for target dependencies.

Some test targets use symlinks to files in other test targets.
These dependencies were previously undetected. This could result in
changes made to dependencies without triggering the dependent tests.

* Track missing target deps with `needs/target/*`.

Some existing test targets have untracked dependencies on other
test targets. This can result in changes to those dependencies
not triggering their dependent tests, resulting in test failures
after a PR is merged.

This PR adds the appropriate `needs/target/*` aliases to track
those dependencies, along with appropriate processing in
ansible-test to handle the new aliases.

* Scan meta dependencies in script targets.

Script targets are often former role targets which were converted
to allow custom invocations of ansible-playbook. These targets still
have their meta dependencies, but they were not being detected.

This could result in changes to dependencies not triggering the
targets which depend on them.
2019-01-14 19:57:32 -08:00
Matt Clay
35caebd036 Fix ansible-test dependency processing.
Previously, the following dependencies:

A used by B
B used by C

Would have been converted to:

A used by C
B used by C

Intead of being expanded to:

A used by B
A used by C
B used by C

This change preserves the existing dependency when expanding it.
2019-01-14 15:31:59 -08:00
Jordan Borean
694c505452
ansible-test: recursively scan setup dependencies (#49170)
* ansible-test: recursively scan setup dependencies

* removed need for default set()
2018-11-28 06:38:27 +10:00
Matt Clay
76bf861308
Upgrade pylint to version 2.1.1. (#47036)
* Fix issues reported by the latest pylint.
* Split pylint runs into more contexts.
* Upgrade pylint.
2018-10-14 22:59:52 -07:00
Matt Clay
0d7a156319 Fix ansible-test encoding issues for exceptions. 2018-10-02 13:36:43 -07:00
Matt Clay
5a3000af19 Support comments in ansible-test flat files. 2018-09-20 00:48:00 -07:00
Ryan Brown
dda7d9e704
[AWS] Add Ansible Version to botocore user agent string (#39993)
Pull `config` out if it was provided to boto3_conn and add the useragent string
2018-05-17 11:41:14 -04:00
Matt Clay
5ea8a5e34b Add support for setup targets to ansible-test. (#28544)
* Add support for setup targets to ansible-test.
* Code cleanup.
2017-08-23 14:09:50 -04:00
Matt Clay
688823014f Convert sanity tests to plugins. (#28425)
* Move sanity into directory.
* Omit abstract classes from returned subclass list.
* Split sanity tests out into plugins.
* Fix abstract class handling for Python 3.
2017-08-18 17:21:11 -07:00
Matt Clay
8e0b5800b7 Miscellaneous ansible-test fixes. (#28355)
* Include .github in test targets. Fix BOTMETA.yml.
* Include bin in compile tests.
* Exclude links from test targets.
* Include bin in pep8 and pylint tests.
* Fix pep8 and pylint issues in bin dir.
2017-08-17 12:04:43 -07:00
Matt Clay
0ff5815a4f Fix ansible-test target completion on Python 3. 2017-08-15 16:18:02 -07:00
Matt Clay
f6d7fc548e Fix ansible-test type hints. 2017-07-28 21:47:04 -07:00
Matt Clay
82558baaf6 Add role dependencies to change classification. 2017-07-10 18:20:09 -07:00
David Newswanger
b2d88f8b73 updated ansible-test integration to skip any files in test/integration/targets/ that aren't directories.
Fixes #26007
2017-06-22 13:03:42 -07:00
Matt Clay
6522d703a1 Fix ansible-test pylint and pep8 issues. (#24245)
* Fix pylint useless-super-delegation issues.
* Fix miscellaneous pylint issues.
* Fix PEP 8 issues.
* Fix warnings reported by PyCharm.
2017-05-03 23:19:44 +08:00
Matt Clay
3e4be156d7 Pre-compile regexes to speed up target processing.
Without this, changing a large number of files results in target
processing taking a very long time due to repeatedly compiling
the same patterns in a loop over many targets.
2017-03-06 12:35:12 -08:00
Matt Clay
6ef1a6aeb6 Add pep8 to ansible-test. (#20745)
The rule sets and legacy file list are a first draft.
It is likely that they will need to be revised.
2017-01-27 12:34:00 -08:00
Matt Clay
6bbd92e422 Initial ansible-test implementation. (#18556) 2016-11-29 21:21:53 -08:00