From 1cfbc02d98ea9f61ee07a4c0fd34f4bd52af5421 Mon Sep 17 00:00:00 2001 From: John Westcott IV Date: Thu, 22 Sep 2022 09:07:28 -0400 Subject: [PATCH] Collection test fixes from prompting changes DNE can sometimes be dne depending on versions, fixing test to find either Adding additional node to Demo Inventory for job slice counting --- .../targets/lookup_api_plugin/tasks/main.yml | 2 +- .../workflow_job_template/tasks/main.yml | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/awx_collection/tests/integration/targets/lookup_api_plugin/tasks/main.yml b/awx_collection/tests/integration/targets/lookup_api_plugin/tasks/main.yml index 7ecfa84a8c..5abed9dcd4 100644 --- a/awx_collection/tests/integration/targets/lookup_api_plugin/tasks/main.yml +++ b/awx_collection/tests/integration/targets/lookup_api_plugin/tasks/main.yml @@ -40,7 +40,7 @@ - assert: that: - - "'DNE' in results.msg" + - "'dne' in (results.msg | lower)" - name: Create our hosts host: diff --git a/awx_collection/tests/integration/targets/workflow_job_template/tasks/main.yml b/awx_collection/tests/integration/targets/workflow_job_template/tasks/main.yml index 633cc72b53..cc44becf99 100644 --- a/awx_collection/tests/integration/targets/workflow_job_template/tasks/main.yml +++ b/awx_collection/tests/integration/targets/workflow_job_template/tasks/main.yml @@ -25,6 +25,7 @@ label2: "AWX-Collection-tests-workflow_job_template-l2-{{ test_id }}" ig1: "AWX-Collection-tests-workflow_job_template-ig1-{{ test_id }}" ig2: "AWX-Collection-tests-workflow_job_template-ig2-{{ test_id }}" + host1: "AWX-Collection-tests-workflow_job_template-h1-{{ test_id }}" - block: - name: "Create a new organization" @@ -150,6 +151,18 @@ that: - "project_inv_source_result is changed" + - name: Add a node to demo inventory so we can use a slice count properly + host: + name: "{{ host1 }}" + inventory: Demo Inventory + variables: + ansible_connection: local + register: results + + - assert: + that: + - "result is changed" + - name: Create a Job Template job_template: name: "{{ jt1_name }}" @@ -908,3 +921,10 @@ name: "{{ org_name }}" state: absent ignore_errors: True + + - name: Remove node + host: + name: "{{ host1 }}" + inventory: Demo Inventory + state: absent + ignore_errors: True