diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:55:42 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:55:42 +0000 |
commit | 62d9962ec7d01c95bf5732169320d3857a41446e (patch) | |
tree | f60d8fc63ff738e5f5afec48a84cf41480ee1315 /test/integration/targets/pip | |
parent | Releasing progress-linux version 2.14.13-1~progress7.99u1. (diff) | |
download | ansible-core-62d9962ec7d01c95bf5732169320d3857a41446e.tar.xz ansible-core-62d9962ec7d01c95bf5732169320d3857a41446e.zip |
Merging upstream version 2.16.5.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/integration/targets/pip')
-rw-r--r-- | test/integration/targets/pip/tasks/main.yml | 3 | ||||
-rw-r--r-- | test/integration/targets/pip/tasks/no_setuptools.yml | 48 | ||||
-rw-r--r-- | test/integration/targets/pip/tasks/pip.yml | 22 |
3 files changed, 73 insertions, 0 deletions
diff --git a/test/integration/targets/pip/tasks/main.yml b/test/integration/targets/pip/tasks/main.yml index 66992fd..a377070 100644 --- a/test/integration/targets/pip/tasks/main.yml +++ b/test/integration/targets/pip/tasks/main.yml @@ -40,6 +40,9 @@ extra_args: "-c {{ remote_constraints }}" - include_tasks: pip.yml + + - include_tasks: no_setuptools.yml + when: ansible_python.version_info[:2] >= [3, 8] always: - name: platform specific cleanup include_tasks: "{{ cleanup_filename }}" diff --git a/test/integration/targets/pip/tasks/no_setuptools.yml b/test/integration/targets/pip/tasks/no_setuptools.yml new file mode 100644 index 0000000..695605e --- /dev/null +++ b/test/integration/targets/pip/tasks/no_setuptools.yml @@ -0,0 +1,48 @@ +- name: Get coverage version + pip: + name: coverage + check_mode: true + register: pip_coverage + +- name: create a virtualenv for use without setuptools + pip: + name: + - packaging + # coverage is needed when ansible-test is invoked with --coverage + # and using a custom ansible_python_interpreter below + - '{{ pip_coverage.stdout_lines|select("match", "coverage==")|first }}' + virtualenv: "{{ remote_tmp_dir }}/no_setuptools" + +- name: Remove setuptools + pip: + name: + - setuptools + - pkg_resources # This shouldn't be a thing, but ubuntu 20.04... + virtualenv: "{{ remote_tmp_dir }}/no_setuptools" + state: absent + +- name: Ensure pkg_resources is gone + command: "{{ remote_tmp_dir }}/no_setuptools/bin/python -c 'import pkg_resources'" + register: result + failed_when: result.rc == 0 + +- vars: + ansible_python_interpreter: "{{ remote_tmp_dir }}/no_setuptools/bin/python" + block: + - name: Checkmode install pip + pip: + name: pip + virtualenv: "{{ remote_tmp_dir }}/no_setuptools" + check_mode: true + register: pip_check_mode + + - assert: + that: + - pip_check_mode.stdout is contains "pip==" + - pip_check_mode.stdout is not contains "setuptools==" + + - name: Install fallible + pip: + name: fallible==0.0.1a2 + virtualenv: "{{ remote_tmp_dir }}/no_setuptools" + register: fallible_install diff --git a/test/integration/targets/pip/tasks/pip.yml b/test/integration/targets/pip/tasks/pip.yml index 3948061..9f1034d 100644 --- a/test/integration/targets/pip/tasks/pip.yml +++ b/test/integration/targets/pip/tasks/pip.yml @@ -568,6 +568,28 @@ that: - "version13 is success" +- name: Test virtualenv command with venv formatting + when: ansible_python.version.major > 2 + block: + - name: Clean up the virtualenv + file: + state: absent + name: "{{ remote_tmp_dir }}/pipenv" + + # ref: https://github.com/ansible/ansible/issues/76372 + - name: install using different venv formatting + pip: + name: "{{ pip_test_package }}" + virtualenv: "{{ remote_tmp_dir }}/pipenv" + virtualenv_command: "{{ ansible_python_interpreter ~ ' -mvenv' }}" + state: present + register: version14 + + - name: ensure install using virtualenv_command with venv formatting + assert: + that: + - "version14 is changed" + ### test virtualenv_command end ### # https://github.com/ansible/ansible/issues/68592 |