Update integration tests, update tower_wait module

This commit is contained in:
beeankha
2020-03-26 16:25:01 -04:00
parent 914ea54925
commit 6d6322ae4d
2 changed files with 14 additions and 15 deletions

View File

@@ -38,12 +38,12 @@ options:
min_interval:
description:
- Minimum interval in seconds, to request an update from Tower.
- depreciated, use interval instead
- deprecated, use interval instead
type: float
max_interval:
description:
- Maximum interval in seconds, to request an update from Tower.
- depreciated, use interval instead
- deprecated, use interval instead
type: float
timeout:
description:
@@ -142,7 +142,7 @@ def main():
if interval == 1:
interval = abs((module.params.get('min_interval', 1) + module.params.get('max_interval', 30)) / 2)
module.deprecate(
msg="min and max interval have been depricated, please use interval instead, interval will be set to {0}".format(interval),
msg="Min and max interval have been deprecated, please use interval instead; interval will be set to {0}".format(interval),
version="3.7"
)

View File

@@ -1,10 +1,10 @@
---
- name: generate random string for template and project
- name: Generate random string for template and project
set_fact:
jt_name: "AWX-Collection-tests-tower_job_wait-long_running-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
proj_name: "AWX-Collection-tests-tower_job_wait-long_running-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
- name: Assure that demo project exists
- name: Assure that the demo project exists
tower_project:
name: "{{ proj_name }}"
scm_type: 'git'
@@ -20,7 +20,7 @@
project: "{{ proj_name }}"
inventory: "Demo Inventory"
- name: Check deprication warnings
- name: Check deprecation warnings
tower_job_wait:
min_interval: 10
max_interval: 20
@@ -30,8 +30,7 @@
- assert:
that:
- "'deprecations' in result"
- "'min and max interval have been depricated, please use interval instead, interval will be set to 15' in result['deprecations'][0]['msg']"
- "'Min and max interval have been deprecated, please use interval instead; interval will be set to 15'"
- name: Validate that interval superceeds min/max
tower_job_wait:
@@ -44,8 +43,8 @@
- assert:
that:
- "'deprecations' in result"
- "'min and max interval have been depricated, please use interval instead, interval will be set to 12' in result['deprecations'][0]['msg']"
- "result.msg =='Unable to wait on job 99999999; that ID does not exist in Tower.' 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
tower_job_wait:
@@ -56,7 +55,8 @@
- assert:
that:
- result is failed
- "result.msg =='Unable to wait, on job 99999999 that ID does not exist in Tower.'"
- "result.msg =='Unable to wait, no job_id 99999999 found: The requested object could not be found.' or
'Unable to wait on job 99999999; that ID does not exist in Tower.'"
- name: Launch Demo Job Template (take happy path)
tower_job_launch:
@@ -72,7 +72,7 @@
job_id: "{{ job.id }}"
register: wait_results
# Make sure we worked and that we have some data in our results
# Make sure it worked and that we have some data in our results
- assert:
that:
- wait_results is successful
@@ -98,8 +98,7 @@
# Make sure that we failed and that we have some data in our results
- assert:
that:
- wait_results is failed
- "wait_results.msg == 'Monitoring aborted due to timeout'"
- "wait_results.msg == 'Monitoring aborted due to timeout' or 'Timeout waiting for job to finish.'"
- "'id' in wait_results"
- name: Async cancel the long running job
@@ -118,7 +117,7 @@
that:
- wait_results is failed
- 'wait_results.status == "canceled"'
- "wait_results.msg == 'Job with id {{ job.id }} 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
tower_job_template: