forked from ansible/ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ansible-galaxy - support resolvelib versions >= 0.5.3, < 0.9.0 (ansib…
…le#77649) * ansible-galaxy - support resolvelib versions >= 0.5.3, <= 0.8.1 Test incompatibilities are removed for resolvelib >= 0.6.0 Test against the latest 0.8.x version and fix requirements * Fix tests - use a venv for testing the range of resolvelib versions * Update temporary hardcoded fallback for ansible-test * Update hardcoded upperbound for sanity tests * Make error check more flexible
- Loading branch information
Showing
16 changed files
with
338 additions
and
88 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
changelogs/fragments/77649-support-recent-resolvelib-versions.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
minor_changes: | ||
- ansible-galaxy - Support resolvelib versions 0.6.x, 0.7.x, and 0.8.x. | ||
The full range of supported versions is now >= 0.5.3, < 0.9.0. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...ration/targets/ansible-galaxy-collection-scm/tasks/test_supported_resolvelib_versions.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
- vars: | ||
venv_cmd: "{{ ansible_python_interpreter ~ ' -m venv' }}" | ||
venv_dest: "{{ galaxy_dir }}/test_venv_{{ resolvelib_version }}" | ||
block: | ||
- name: install another version of resolvelib that is supported by ansible-galaxy | ||
pip: | ||
name: resolvelib | ||
version: "{{ resolvelib_version }}" | ||
state: present | ||
virtualenv_command: "{{ venv_cmd }}" | ||
virtualenv: "{{ venv_dest }}" | ||
virtualenv_site_packages: True | ||
|
||
- include_tasks: ./scm_dependency_deduplication.yml | ||
args: | ||
apply: | ||
environment: | ||
PATH: "{{ venv_dest }}/bin:{{ ansible_env.PATH }}" | ||
ANSIBLE_CONFIG: '{{ galaxy_dir }}/ansible.cfg' | ||
|
||
always: | ||
- name: remove test venv | ||
file: | ||
path: "{{ venv_dest }}" | ||
state: absent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
test/integration/targets/ansible-galaxy-collection/tasks/fail_fast_resolvelib.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# resolvelib>=0.6.0 added an 'incompatibilities' parameter to find_matches | ||
# If incompatibilities aren't removed from the viable candidates, this example causes infinite resursion | ||
- name: test resolvelib removes incompatibilites in find_matches and errors quickly (prevent infinite recursion) | ||
block: | ||
- name: create collection dir | ||
file: | ||
dest: "{{ galaxy_dir }}/resolvelib/ns/coll" | ||
state: directory | ||
|
||
- name: create galaxy.yml with a dependecy on a galaxy-sourced collection | ||
copy: | ||
dest: "{{ galaxy_dir }}/resolvelib/ns/coll/galaxy.yml" | ||
content: | | ||
namespace: ns | ||
name: coll | ||
authors: | ||
- ansible-core | ||
readme: README.md | ||
version: "1.0.0" | ||
dependencies: | ||
namespace1.name1: "0.0.5" | ||
- name: build the collection | ||
command: ansible-galaxy collection build ns/coll | ||
args: | ||
chdir: "{{ galaxy_dir }}/resolvelib" | ||
|
||
- name: install a conflicting version of the dep with the tarfile (expected failure) | ||
command: ansible-galaxy collection install namespace1.name1:1.0.9 ns-coll-1.0.0.tar.gz -vvvvv -s {{ test_name }} -p collections/ | ||
args: | ||
chdir: "{{ galaxy_dir }}/resolvelib" | ||
timeout: 30 | ||
ignore_errors: yes | ||
register: incompatible | ||
|
||
- assert: | ||
that: | ||
- incompatible.failed | ||
- not incompatible.msg.startswith("The command action failed to execute in the expected time frame") | ||
|
||
always: | ||
- name: cleanup resolvelib test | ||
file: | ||
dest: "{{ galaxy_dir }}/resolvelib" | ||
state: absent |
Oops, something went wrong.