Commit Graph

180 Commits (dfe3a4d345ef236cabb79d2d91ef0640ea8b3a70)

Author SHA1 Message Date
Matt Clay dfe3a4d345
[stable-2.9] Fix ansible-test docker container IP detection. (#74390)
(cherry picked from commit 14ff5e213c)

Co-authored-by: Matt Clay <matt@mystile.com>
5 years ago
Matt Clay 225709ca20
[stable-2.9] Switch to hashlib.sha256() for ansible-test (#72411) (#74170)
When FIPs mode is enable on centos-8, we are not able to load md5
functions.

Signed-off-by: Paul Belanger <pabelanger@redhat.com>
(cherry picked from commit a95213d2f5)

Co-authored-by: Paul Belanger <pabelanger@redhat.com>

Co-authored-by: Paul Belanger <pabelanger@redhat.com>
5 years ago
Gonéri Le Bouder f4ec55b2d8
[stable-2.9] validate_modules: fails with .id attribute not found (#73322) (#74179)
* validate_modules: fails with .id attribute not found

This patch addresses a problem in the `found_try_except_import` test.

This module tries to identify lines like:

`HAS_FOO = True`

In this case, the target (`HAS_FOO`) is of type `ast.Name` and has a
`id` attribute which provide the name.

In my case, I've a line that set a module attribute`. In this case, the
target (`module.var`) has the type `ast.Attribute` and no `id`
attribute. The code trigger an `AttributeError` exception.

This patch ensures we compare a `ast.Name`.

* Update test/lib/ansible_test/_data/sanity/validate-modules/validate_modules/main.py

(cherry picked from commit 7cf80f50d1)
5 years ago
Sam Doran cc97479f9d
[stable-2.9] ansible-test - ensure trailing separator is added for connection unit test target (#74176) (#74182)
For connection units tests, if the `__init__.py` file is modified, the trailing separator was
not added, making the target invalid.
(cherry picked from commit 7b79b69369)

Co-authored-by: Sam Doran <sdoran@redhat.com>
5 years ago
Matt Clay 3155c8c26c
[stable-2.9] Add PyPI proxy container for tests on Python 2.6.. (#74206)
(cherry picked from commit becf941673)

Co-authored-by: Matt Clay <matt@mystile.com>
5 years ago
Matt Clay 7fa32b9b44 [stable-2.9] Fix ansible-test coverage exporting.
(cherry picked from commit b75844af45)
5 years ago
Mark Chappell 84e61b32f8 Ensure unit test paths for connection and inventory plugins are based on the context (#73877) 5 years ago
Gonéri Le Bouder cf53554cf5
[ansible-test] attempt to work around podman (#72096) (#73570)
Change:
- podman > 2 && < 2.2 does not support "images --format {{json .}}"
- podman also now outputs images JSON differently than docker
- Work around both of the above.

Test Plan:
- Tested with podman 2.0.6 in Fedora 31.

Signed-off-by: Rick Elrod <rick@elrod.me>
Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
(cherry picked from commit 0332046699)
5 years ago
Gonéri Le Bouder 462edf003e
ansible-test: yamllint, check the assigment (#73584)
Ensure `yamllint`'s `check_assignment()` correctly ignore the
attribute assignment. Those don't have any `.id` attribute and will
trigger an `AttributeError` exception.

See: https://github.com/ansible/ansible/pull/73322
(cherry picked from commit 0a8d5c0983)
5 years ago
Matt Clay b20547af70 Fix cryptography install in ansible-test.
This fix is based on https://github.com/ansible/ansible/pull/73530/
5 years ago
Matt Clay d8ab39fbaa
[stable-2.9] Use a versioned pip bootstrapper in ansible-test. (#73360)
(cherry picked from commit fc590aeb21)

Co-authored-by: Matt Clay <matt@mystile.com>
5 years ago
Matt Clay 8d31c4426b
[stable-2.9] Update ansible-test pylint Python support. (#72972) (#73355)
* [stable-2.9] Update ansible-test pylint Python support. (#72972)

* Update ansible-test pylint Python support.
* Python 3.8 is now officially supported.

(cherry picked from commit 37d09f2488)
5 years ago
Matt Clay 7339b9d9cf [stable-2.9] Handle get-pip.py breaking change on Python 2.7.
(cherry picked from commit 484e4af4d0)

Co-authored-by: Matt Clay <matt@mystile.com>
5 years ago
Matt Clay cdcd2ed49a
Support venv in ansible-test virtualenv scripts (#73164)
* ansible-test - prefer venv over virtualenv on Python 3 (#73000)

Also pin virtualenv to 16.7.10 for older Mac OS X systems. This was the version being installed
anway with the previous constraint (<20).

On systems with Python 3, now prefer venv over virtualenv. Test to see if venv is functional since
some systems have a non-functional venv installation (such as Debian).

(cherry picked from commit 850a77f639)
(cherry picked from commit a48b3d2089)

* Make the new ansible-test venv behavior opt-in

Co-authored-by: Sam Doooran <sdoran@redhat.com>
5 years ago
Matt Clay 17effffad6
[stable-2.9] Add coverage exporting to ansible-test (#72982)
* Add `--venv-system-site-packages` to ansible-test.

(cherry picked from commit 934d6b235b)

Backport of https://github.com/ansible/ansible/pull/65615

* [stable-2.9] Add coverage exporting to ansible-test

A new `--export` option for `ansible-test coverage combine` allows multi-step aggregation of code coverage for CI pipelines..

(cherry picked from commit fa2be89cd4)

Backport of https://github.com/ansible/ansible/pull/72563
5 years ago
Sam Doran d12e82b94c
[stable-2.9] ansible-test - skip installing PowerShell sanity test reqs if they are already installed (#72423) (#72425)
(cherry picked from commit 809d5fc398)

Co-authored-by: Jordan Borean <jborean93@gmail.com>
5 years ago
Felix Fontein 9ba34dec35
ansible-test sanity: fix UnicodeDecodeError for `--python 2.7 --docker` (#72623) (#72866)
* Store target paths as unicode.

* Add changelog fragment.

(cherry picked from commit f94ba68d8f)
5 years ago
Felix Fontein 903f2e267b Improve ansible-test classifications for collections (#72353)
(cherry picked from commit 64a809d2b6)
5 years ago
Matt Clay 2c66c6297c [stable-2.9] Use AZP config for integration-aliases test.
No changelog entry since this test is limited to the ansible/ansible repo.

Backport of https://github.com/ansible/ansible/pull/72842
5 years ago
Matt Clay 0b54f3e1ba [stable-2.9] Fix Azure Pipelines change detection. (#72824)
(cherry picked from commit 08842cd6bb)

Co-authored-by: Matt Clay <mclay@redhat.com>
5 years ago
Rick Elrod d92820c2d5
[centos6] update container for EOL (#72797)
* [centos6] update container for EOL

Change:
- Reference:
  https://lists.centos.org/pipermail/centos-devel/2020-December/056208.html
- Bump centos6 container to 1.25.0

Test Plan:
- ci_complete

Signed-off-by: Rick Elrod <rick@elrod.me>

* update EPEL 6 too which is now archived

Signed-off-by: Rick Elrod <rick@elrod.me>

* bump to 1.26.0

Signed-off-by: Rick Elrod <rick@elrod.me>
5 years ago
Jordan Borean c90eea843b
Add RHEL 7.9 (#72558) - 2.9 (#72567)
* Add RHEL 7.9 - ci_complete (#72558)

(cherry picked from commit d451433e5d)

* Added changelog for RHEL 7.9 (#72572)

(cherry picked from commit bdd0c48837)
5 years ago
Sam Doran f6635e3804 [stable-2.9] - ansible-test - add cryptography constraint for cffi (#72761)
The recently released version of cffi fails to install on systems with an older version of gcc. In
our case, this in the CentOS 6 test image. There is a fix but it has not yet been released.

https://foss.heptapod.net/pypy/cffi/-/issues/480
5 years ago
Matt Clay c73c5477e5 [stable-2.9] Fix container discovery for the acme test plugin.
(cherry picked from commit f022dedd0a)

Co-authored-by: Matt Clay <matt@mystile.com>
5 years ago
Matt Clay 6f29ab5203 [stable-2.9] Fix ansible-test tar format handling.
(cherry picked from commit 49d8d5ae33)

Co-authored-by: Matt Clay <matt@mystile.com>
5 years ago
Felix Fontein 7fe2a22f70 ansible-test ansible-doc sanity test: disable vars plugins for collections 5 years ago
Matt Clay 8fc579061f [stable-2.9] [stable-2.10] Fix ansible-test handling of user-defined docker networks. (#72256)
* Fix ansible-test docker container detection.

* Attach test containers to the correct network.

* Do not assume `localhost` for accesing Docker.

* Look for containers on current network.

* Always map /var/run/docker.sock into containers.

This fixes issues when using a remote Docker host.

* Support container IP lookup from networks list.

* Fix container network attachment.

* Remove redundant container detection messages.

* Limit DOCKER_HOST parsing to TCP.

* Restore docker socket existence check.

The check is skipped if the docker hostname is not localhost.

* Correct changelog entry..
(cherry picked from commit 3c2e8b99be)

Co-authored-by: Matt Clay <mclay@redhat.com>.
(cherry picked from commit 6362232c30)

Co-authored-by: Matt Clay <mclay@redhat.com>
5 years ago
Matt Clay c54dc50bd7
[stable-2.9] Fix ansible-test Azure Pipelines container auth. (#72283)
(cherry picked from commit 2ef4b7e07e)

Co-authored-by: Matt Clay <matt@mystile.com>
5 years ago
Matt Clay b9fc07ef4e
[stable-2.9] Support collection constraints in ansible-test. (#72158)
This allows collections to specify requirements and constraints for packages that ansible-test has requirements or constraints for..
(cherry picked from commit 5f76bd2af7)

Co-authored-by: Matt Clay <matt@mystile.com>
5 years ago
Matt Clay 0dba2fe0dc
[stable-2.9] CI provider fixes for ansible-test. (#71929) (#71933)
* Make Azure Pipelines resource_prefix lowercase.

* Make classification of CI files consistent.

* Update package-data sanity test for AZP.
(cherry picked from commit 92b66e3e31)

Co-authored-by: Matt Clay <mclay@redhat.com>
5 years ago
Matt Clay 417e408f59
[stable-2.9] Backport ansible-test CI provider support. (#71614)
* Add encoding.py from devel to support backports.

* Add io.py from devel to support backports.

* Update ansible-test support for CI providers. (#69522)

Refactored CI provider code to simplify multiple provider support and addition of new providers.

(cherry picked from commit d8e0aadc0d)

* Add Shippable request signing to ansible-test. (#69526)

(cherry picked from commit e7c2eb519b)

* ansible-test local change detection: use --base-branch if specified (#69508)

(cherry picked from commit 43acd61901)

* Add Azure Pipelines support to ansible-test.

(cherry picked from commit 8ffaed00f8)

* Update ansible-test remote endpoint handling. (#71413)

* Request ansible-core-ci resources by provider.
* Remove obsolete us-east-2 CI endpoint.
* Add new --remote-endpoint option.
* Add warning for --remote-aws-region option.
* Update service endpoints.
* Allow non-standard remote stages.
* Add changelog fragment.

(cherry picked from commit d099591964)

* Fix ansible-test coverage traceback. (#71446)

* Add integration test for ansible-test coverage.

* Fix ansible-test coverage traceback.

* Fix coverage reporting on Python 2.6.

(cherry picked from commit f5b6df14ab)

* Use new endpoint for Parallels based instances.

(cherry picked from commit 98febab975)

* Add pause to avoid same mtime in test.

(cherry picked from commit 3d769f3a76)

Co-authored-by: Felix Fontein <felix@fontein.de>
5 years ago
Matt Davis 6123266c82 [stable-2.9] fix collection package root location under pytest >=6.0.0 (#70963).
(cherry picked from commit 86b6c4bbb6)

Co-authored-by: nitzmahone <nitzmahone@users.noreply.github.com>
5 years ago
Felix Fontein 02be2a13db
ansible-test: bump acme test container version to 2.0.0 (#71097) (#71166)
(cherry picked from commit 050841324c)
5 years ago
Matt Clay c37acc7740
[stable-2.9] Fix ansible-test relative import analysis. (#70994)
(cherry picked from commit 2e0097ada3)

Co-authored-by: Matt Clay <matt@mystile.com>
5 years ago
Matt Clay e5ec3f8578 [stable-2.9] Cap pytest version to avoid relative import issue.
(cherry picked from commit 3a8ac62596)

Co-authored-by: Matt Clay <matt@mystile.com>
6 years ago
Matt Clay 8b0484217f [stable-2.9] Default ansible-test provisioning to us-east-1.
Previously windows instances on Shippable would be automatically directed to us-east-2.
(cherry picked from commit 1cf26896c5)

Co-authored-by: Matt Clay <matt@mystile.com>
6 years ago
Monty Taylor be2a3f520c Add an author exception for OpenStack Ansible SIG
The current author line wants to match a github author id. But
some people, including the OpenStack project, do not use github,
and additionally do not claim individual ownership but instead
group ownership.

Since there are already a couple of hard-coded examples in the
regex, just add one more. Alternately we could come up with some
mechanism to indicate that the author is purposely not listing
a github id, but that seems a bit heavywight.
6 years ago
Matt Clay 8b75da2af2 Fix ansible-test import analysis warning.
Fix overlooked in https://github.com/ansible/ansible/pull/68372/

(cherry picked from commit 77732ed50d)
6 years ago
Matt Clay 75d1213f9a Fix ansible-test change detection traceback.
(cherry picked from commit 53a3d1ffdb)
6 years ago
Matt Clay e80d736869 Fix ansible-test module_utils import analysis.
Now empty `*.py` files are ignored during module_utils import analysis for change detection.
This eliminates "No imports found" warnings for files which should have no imports.

(cherry picked from commit ab27680318)
6 years ago
Matt Clay f4b1604eba Fix ansible-test import analysis for collections. (#68352)
* Fix ansible-test import analysis for collections.

* Ignore plugins/module_utils/__init__.py

(cherry picked from commit 0ca3feb861)
6 years ago
Matt Clay 6514ae6c05 Revert "Fix ansible-test module_utils import analysis. (#69406)"
This reverts commit b8808efd26.
6 years ago
Matt Clay a0c02d4c9d Revert "Fix ansible-test import analysis for collections. (#68352) (#69405)"
This reverts commit c333846097.
6 years ago
Matt Clay c8a94d0ad5 Revert "Fix ansible-test change detection traceback."
This reverts commit 58954ab77b.
6 years ago
Matt Clay 58954ab77b Fix ansible-test change detection traceback.
(cherry picked from commit 53a3d1ffdb)
6 years ago
Matt Clay 7f31a7a488 [stable-2.9] Disabled inconsistent pylint checks.
(cherry picked from commit 8152d8bc1a)

Co-authored-by: Matt Clay <matt@mystile.com>
6 years ago
Felix Fontein c333846097
Fix ansible-test import analysis for collections. (#68352) (#69405)
* Fix ansible-test import analysis for collections.

* Ignore plugins/module_utils/__init__.py

(cherry picked from commit 0ca3feb861)

Co-authored-by: Matt Clay <mclay@redhat.com>
6 years ago
Felix Fontein 4744f31023
Fix ansible-test egg-info directory detection. (#69403)
(cherry picked from commit 8b63da7b43)

Co-authored-by: Matt Clay <matt@mystile.com>
6 years ago
Felix Fontein cf244c094a
[2.9] Prevent Ansible 2.9 to choke on collections using deprecation by date or collection_name for deprecation calls (#69935)
* Prevent Ansible 2.9 to choke on collections using deprecation by date or collection_name for deprecation calls.

* Add changelog fragment.

* Fix YAML.

* Improve C# compatibility.

* Add tests for AnsibleModule.

* Fix var name.

* Fix type.

* Update C# code.

* Show deprecation warning if removed_at_date is used for Python modules.

* Update changelogs/fragments/69935-2.10-deprecation-support.yml

Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>

* Prevent crash of validate-modules if 'removed_in' is not in 'deprecated'.

Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
6 years ago
Felix Fontein abbb8c4ea8
ansible-test: don't trigger full CI run for changes to changelogs/ and docs/ in collections (#68550) (#69408)
* Don't trigger full CI run for changes to changelogs/ and docs/ in collections.

* Add changelog fragment.

* Update changelogs/fragments/68550-ansible-test-docs-changelogs.yml

Co-Authored-By: Matt Clay <matt@mystile.com>

Co-authored-by: Matt Clay <matt@mystile.com>
(cherry picked from commit bae5f18f5c)
6 years ago