mirror of
https://github.com/ansible/awx.git
synced 2026-05-25 17:47:45 -02:30
Change job_wait collection test to always try and delete created objects
This commit is contained in:
@@ -9,7 +9,8 @@
|
||||
jt_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:
|
||||
name: "{{ proj_name }}"
|
||||
scm_type: 'git'
|
||||
@@ -25,7 +26,7 @@
|
||||
project: "{{ proj_name }}"
|
||||
inventory: "Demo Inventory"
|
||||
extra_vars:
|
||||
sleep_interval: 300
|
||||
sleep_interval: 600
|
||||
|
||||
- name: Check module fails with correct msg
|
||||
job_wait:
|
||||
@@ -100,21 +101,6 @@
|
||||
- 'wait_results.status == "canceled"'
|
||||
- "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
|
||||
- name: Generate a random string for test
|
||||
set_fact:
|
||||
@@ -156,7 +142,23 @@
|
||||
- "'elapsed' in wait_workflow_results"
|
||||
- "'id' in wait_workflow_results"
|
||||
|
||||
always:
|
||||
- name: Clean up test workflow
|
||||
workflow_job_template:
|
||||
name: "{{ wfjt_name2 }}"
|
||||
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