mirror of
https://github.com/ansible/awx.git
synced 2026-08-01 18:39:54 -02:30
Merge pull request #13976 from john-westcott-iv/collection_job_wait_remove_depreciated_field_check
Change the job_wait integration test
This commit is contained in:
@@ -9,7 +9,8 @@
|
|||||||
jt_name: "AWX-Collection-tests-job_wait-long_running-{{ test_id }}"
|
jt_name: "AWX-Collection-tests-job_wait-long_running-{{ test_id }}"
|
||||||
proj_name: "AWX-Collection-tests-job_wait-long_running-{{ test_id }}"
|
proj_name: "AWX-Collection-tests-job_wait-long_running-{{ test_id }}"
|
||||||
|
|
||||||
- name: Assure that the demo project exists
|
- block:
|
||||||
|
- name: Create a project
|
||||||
project:
|
project:
|
||||||
name: "{{ proj_name }}"
|
name: "{{ proj_name }}"
|
||||||
scm_type: 'git'
|
scm_type: 'git'
|
||||||
@@ -25,21 +26,7 @@
|
|||||||
project: "{{ proj_name }}"
|
project: "{{ proj_name }}"
|
||||||
inventory: "Demo Inventory"
|
inventory: "Demo Inventory"
|
||||||
extra_vars:
|
extra_vars:
|
||||||
sleep_interval: 300
|
sleep_interval: 600
|
||||||
|
|
||||||
- name: Validate that interval superceeds min/max
|
|
||||||
job_wait:
|
|
||||||
min_interval: 10
|
|
||||||
max_interval: 20
|
|
||||||
interval: 12
|
|
||||||
job_id: "99999999"
|
|
||||||
register: result
|
|
||||||
ignore_errors: true
|
|
||||||
|
|
||||||
- assert:
|
|
||||||
that:
|
|
||||||
- "result.msg =='Unable to wait on job 99999999; that ID does not exist.' or
|
|
||||||
'min and max interval have been depricated, please use interval instead, interval will be set to 12'"
|
|
||||||
|
|
||||||
- name: Check module fails with correct msg
|
- name: Check module fails with correct msg
|
||||||
job_wait:
|
job_wait:
|
||||||
@@ -114,21 +101,6 @@
|
|||||||
- 'wait_results.status == "canceled"'
|
- 'wait_results.status == "canceled"'
|
||||||
- "wait_results.msg == 'Job with id {{ job.id }} failed' or 'Job with id={{ job.id }} failed, error: Job failed.'"
|
- "wait_results.msg == 'Job with id {{ job.id }} failed' or 'Job with id={{ job.id }} failed, error: Job failed.'"
|
||||||
|
|
||||||
- name: Delete the job template
|
|
||||||
job_template:
|
|
||||||
name: "{{ jt_name }}"
|
|
||||||
playbook: "sleep.yml"
|
|
||||||
job_type: run
|
|
||||||
project: "{{ proj_name }}"
|
|
||||||
inventory: "Demo Inventory"
|
|
||||||
state: absent
|
|
||||||
|
|
||||||
- name: Delete the project
|
|
||||||
project:
|
|
||||||
name: "{{ proj_name }}"
|
|
||||||
organization: Default
|
|
||||||
state: absent
|
|
||||||
|
|
||||||
# workflow wait test
|
# workflow wait test
|
||||||
- name: Generate a random string for test
|
- name: Generate a random string for test
|
||||||
set_fact:
|
set_fact:
|
||||||
@@ -170,7 +142,23 @@
|
|||||||
- "'elapsed' in wait_workflow_results"
|
- "'elapsed' in wait_workflow_results"
|
||||||
- "'id' in wait_workflow_results"
|
- "'id' in wait_workflow_results"
|
||||||
|
|
||||||
|
always:
|
||||||
- name: Clean up test workflow
|
- name: Clean up test workflow
|
||||||
workflow_job_template:
|
workflow_job_template:
|
||||||
name: "{{ wfjt_name2 }}"
|
name: "{{ wfjt_name2 }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
|
- name: Delete the job template
|
||||||
|
job_template:
|
||||||
|
name: "{{ jt_name }}"
|
||||||
|
playbook: "sleep.yml"
|
||||||
|
job_type: run
|
||||||
|
project: "{{ proj_name }}"
|
||||||
|
inventory: "Demo Inventory"
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: Delete the project
|
||||||
|
project:
|
||||||
|
name: "{{ proj_name }}"
|
||||||
|
organization: Default
|
||||||
|
state: absent
|
||||||
|
|||||||
Reference in New Issue
Block a user