From 2d2ea756a61deabf80f63da82fb83c647afeb91c Mon Sep 17 00:00:00 2001 From: Sam Doooran Date: Mon, 4 Jan 2021 15:53:56 -0500 Subject: [stable-2.8] Constrain pexpect and ptyprocess (#73109) The recent update of ptyprocess to 0.7.0 is incompatible with Python 2.6 and is causing test failures. * Add setup_pexpect role to expect test (cherry picked from commit 003a9e890d) Co-authored-by: Sam Doooran --- test/integration/targets/expect/aliases | 1 + test/integration/targets/expect/tasks/main.yml | 5 ++--- test/integration/targets/setup_pexpect/files/constraints.txt | 2 ++ test/integration/targets/setup_pexpect/meta/main.yml | 2 ++ test/integration/targets/setup_pexpect/tasks/main.yml | 6 ++++++ 5 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 test/integration/targets/setup_pexpect/files/constraints.txt create mode 100644 test/integration/targets/setup_pexpect/meta/main.yml diff --git a/test/integration/targets/expect/aliases b/test/integration/targets/expect/aliases index ca7c912851..7211b8d09a 100644 --- a/test/integration/targets/expect/aliases +++ b/test/integration/targets/expect/aliases @@ -1,2 +1,3 @@ shippable/posix/group2 destructive +needs/target/setup_pexpect diff --git a/test/integration/targets/expect/tasks/main.yml b/test/integration/targets/expect/tasks/main.yml index 7feaec4d81..0c408d282d 100644 --- a/test/integration/targets/expect/tasks/main.yml +++ b/test/integration/targets/expect/tasks/main.yml @@ -16,9 +16,8 @@ # You should have received a copy of the GNU General Public License # along with Ansible. If not, see . - name: Install test requirements - pip: - name: pexpect - state: present + import_role: + name: setup_pexpect - name: record the test_command file set_fact: test_command_file={{output_dir | expanduser}}/test_command.py diff --git a/test/integration/targets/setup_pexpect/files/constraints.txt b/test/integration/targets/setup_pexpect/files/constraints.txt new file mode 100644 index 0000000000..c78ecdad66 --- /dev/null +++ b/test/integration/targets/setup_pexpect/files/constraints.txt @@ -0,0 +1,2 @@ +pexpect == 4.8.0 +ptyprocess < 0.7.0 ; python_version < '2.7' # ptyprocess >= 0.7.0 not compatible with Python 2.6 diff --git a/test/integration/targets/setup_pexpect/meta/main.yml b/test/integration/targets/setup_pexpect/meta/main.yml new file mode 100644 index 0000000000..1810d4bec9 --- /dev/null +++ b/test/integration/targets/setup_pexpect/meta/main.yml @@ -0,0 +1,2 @@ +dependencies: + - setup_remote_tmp_dir diff --git a/test/integration/targets/setup_pexpect/tasks/main.yml b/test/integration/targets/setup_pexpect/tasks/main.yml index ef57fe6fd2..690fe44152 100644 --- a/test/integration/targets/setup_pexpect/tasks/main.yml +++ b/test/integration/targets/setup_pexpect/tasks/main.yml @@ -1,4 +1,10 @@ +- name: Copy constraints file + copy: + src: constraints.txt + dest: "{{ remote_tmp_dir }}/pexpect-constraints.txt" + - name: Install pexpect pip: name: pexpect + extra_args: '--constraint "{{ remote_tmp_dir }}/pexpect-constraints.txt"' state: present -- cgit v1.2.1