From 0c6a809eccb1cc5dacad1b7f8d1c6f7a472392ca Mon Sep 17 00:00:00 2001 From: Thomas Wang Date: Fri, 3 May 2024 12:22:18 +1000 Subject: [PATCH] added change log and integration test cases for unable to find pip in virutalenv with relative path --- ...o_find_pip_in_virutalenv_with_relative_path.yml | 2 ++ test/integration/targets/pip/tasks/pip.yml | 14 ++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 changelogs/fragments/81522_unable_to_find_pip_in_virutalenv_with_relative_path.yml diff --git a/changelogs/fragments/81522_unable_to_find_pip_in_virutalenv_with_relative_path.yml b/changelogs/fragments/81522_unable_to_find_pip_in_virutalenv_with_relative_path.yml new file mode 100644 index 00000000000..a427afbb487 --- /dev/null +++ b/changelogs/fragments/81522_unable_to_find_pip_in_virutalenv_with_relative_path.yml @@ -0,0 +1,2 @@ +bugfixes: + - fix unable to find pip in the virtualenv when using relative path \ No newline at end of file diff --git a/test/integration/targets/pip/tasks/pip.yml b/test/integration/targets/pip/tasks/pip.yml index 9f1034d29a9..000ba97f47c 100644 --- a/test/integration/targets/pip/tasks/pip.yml +++ b/test/integration/targets/pip/tasks/pip.yml @@ -621,3 +621,17 @@ - pip_prereleases is successful - pip_prereleases is not changed - '"fallible==0.0.1a2" in pip_prereleases.stdout_lines' + +#https://github.com/ansible/ansible/issues/81522 +- name: Unable to find pip in the virtualenv when using relative path + pip: + chdir: checkout-dir # a relative path + requirements: "{{ remote_tmp_dir}}/pipreq.txt" #we dont care about what we are trying to install here + virtualenv: venv + virtualenv_command: python3 -m venv + register: pip_output # Registering the output of the pip task + +- assert: + that: + - pip_output is successful + - '"checkout-dir/venv" in pip_output.virtualenv'