From bd849b30762cf62135fa243b9788c9497a5964e2 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Tue, 31 May 2022 10:07:52 -0700 Subject: [PATCH] Fix ansible-runner integration tests. --- .../targets/ansible-runner/files/constraints.txt | 5 ----- test/integration/targets/ansible-runner/runme.sh | 2 ++ test/integration/targets/ansible-runner/tasks/main.yml | 1 - .../targets/ansible-runner/tasks/playbook_example1.yml | 9 ++++++++- test/integration/targets/ansible-runner/tasks/setup.yml | 4 +--- 5 files changed, 11 insertions(+), 10 deletions(-) delete mode 100644 test/integration/targets/ansible-runner/files/constraints.txt diff --git a/test/integration/targets/ansible-runner/files/constraints.txt b/test/integration/targets/ansible-runner/files/constraints.txt deleted file mode 100644 index c3e394029eb..00000000000 --- a/test/integration/targets/ansible-runner/files/constraints.txt +++ /dev/null @@ -1,5 +0,0 @@ -psutil < 5.7.0 # Greater than this version breaks on older pip -pexpect >= 4.5, <= 4.8.0 -python-daemon <= 2.2.4 -pyyaml < 5.1 ; python_version < '2.7' # pyyaml 5.1 and later require python 2.7 or later -six <= 1.14.0 diff --git a/test/integration/targets/ansible-runner/runme.sh b/test/integration/targets/ansible-runner/runme.sh index 384de80f725..97e6f4dab96 100755 --- a/test/integration/targets/ansible-runner/runme.sh +++ b/test/integration/targets/ansible-runner/runme.sh @@ -2,4 +2,6 @@ set -eux +source virtualenv.sh + ANSIBLE_ROLES_PATH=../ ansible-playbook test.yml -i inventory "$@" diff --git a/test/integration/targets/ansible-runner/tasks/main.yml b/test/integration/targets/ansible-runner/tasks/main.yml index 5608786b3f7..ba6a3a236f0 100644 --- a/test/integration/targets/ansible-runner/tasks/main.yml +++ b/test/integration/targets/ansible-runner/tasks/main.yml @@ -2,4 +2,3 @@ - include_tasks: setup.yml - include_tasks: adhoc_example1.yml - include_tasks: playbook_example1.yml - when: ansible_distribution in ('RedHat', 'CentOS') and ansible_distribution_major_version == '7' diff --git a/test/integration/targets/ansible-runner/tasks/playbook_example1.yml b/test/integration/targets/ansible-runner/tasks/playbook_example1.yml index 52df8458474..1fedb53f49d 100644 --- a/test/integration/targets/ansible-runner/tasks/playbook_example1.yml +++ b/test/integration/targets/ansible-runner/tasks/playbook_example1.yml @@ -6,9 +6,16 @@ # work around for ansible-runner showing ansible warnings on stdout set_fact: pbexec_json: "{{ script.stdout | parse_json }}" + expected_events: + - playbook_on_start + - playbook_on_play_start + - playbook_on_task_start + - runner_on_start + - runner_on_ok + - playbook_on_stats - assert: that: - "pbexec_json.rc == 0" - - "pbexec_json.events|length == 7" + - "pbexec_json.events == expected_events" - "'localhost' in pbexec_json.stats.ok" diff --git a/test/integration/targets/ansible-runner/tasks/setup.yml b/test/integration/targets/ansible-runner/tasks/setup.yml index d3a4606ae59..7ee66b242a7 100644 --- a/test/integration/targets/ansible-runner/tasks/setup.yml +++ b/test/integration/targets/ansible-runner/tasks/setup.yml @@ -1,6 +1,4 @@ - name: Install ansible-runner pip: name: ansible-runner - version: 1.4.6 - extra_args: - -c {{ role_path }}/files/constraints.txt + version: 2.2.0