mirror of
https://github.com/ansible/awx.git
synced 2026-05-12 03:47:36 -02:30
Fix the bulk Job Launch Integration test in awx collection (#14702)
* fix the integration tests
This commit is contained in:
@@ -60,7 +60,7 @@
|
|||||||
- result['job_info']['skip_tags'] == "skipbaz"
|
- result['job_info']['skip_tags'] == "skipbaz"
|
||||||
- result['job_info']['limit'] == "localhost"
|
- result['job_info']['limit'] == "localhost"
|
||||||
- result['job_info']['job_tags'] == "Hello World"
|
- result['job_info']['job_tags'] == "Hello World"
|
||||||
- result['job_info']['inventory'] == {{ inventory_id }}
|
- result['job_info']['inventory'] == inventory_id | int
|
||||||
- "result['job_info']['extra_vars'] == '{\"animal\": \"bear\", \"food\": \"carrot\"}'"
|
- "result['job_info']['extra_vars'] == '{\"animal\": \"bear\", \"food\": \"carrot\"}'"
|
||||||
|
|
||||||
# cleanup
|
# cleanup
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
that:
|
that:
|
||||||
- "{{ matching_jobs.count }} == 1"
|
- matching_jobs.count == 1
|
||||||
|
|
||||||
- name: List failed jobs (which don't exist)
|
- name: List failed jobs (which don't exist)
|
||||||
job_list:
|
job_list:
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
that:
|
that:
|
||||||
- "{{ successful_jobs.count }} == 0"
|
- successful_jobs.count == 0
|
||||||
|
|
||||||
- name: Get ALL result pages!
|
- name: Get ALL result pages!
|
||||||
job_list:
|
job_list:
|
||||||
|
|||||||
@@ -99,7 +99,7 @@
|
|||||||
that:
|
that:
|
||||||
- wait_results is failed
|
- wait_results is failed
|
||||||
- '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.'"
|
- "'Job with id ~ job.id failed' or 'Job with id= ~ job.id failed, error: Job failed.' is in wait_results.msg"
|
||||||
|
|
||||||
# workflow wait test
|
# workflow wait test
|
||||||
- name: Generate a random string for test
|
- name: Generate a random string for test
|
||||||
|
|||||||
@@ -132,7 +132,7 @@
|
|||||||
|
|
||||||
- name: Get the ID of the first user created and verify that it is correct
|
- name: Get the ID of the first user created and verify that it is correct
|
||||||
assert:
|
assert:
|
||||||
that: "{{ query(plugin_name, 'users', query_params={ 'username' : user_creation_results['results'][0]['item'] }, return_ids=True)[0] }} == {{ user_creation_results['results'][0]['id'] }}"
|
that: "query(plugin_name, 'users', query_params={ 'username' : user_creation_results['results'][0]['item'] }, return_ids=True)[0] == user_creation_results['results'][0]['id'] | string"
|
||||||
|
|
||||||
- name: Try to get an ID of someone who does not exist
|
- name: Try to get an ID of someone who does not exist
|
||||||
set_fact:
|
set_fact:
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
- name: Call ruleset with no rules
|
- name: Call ruleset with no rules
|
||||||
set_fact:
|
set_fact:
|
||||||
complex_rule: "{{ query(ruleset_plugin_name, '2022-04-30 10:30:45') }}"
|
complex_rule: "{{ query(ruleset_plugin_name | string, '2022-04-30 10:30:45') }}"
|
||||||
ignore_errors: True
|
ignore_errors: True
|
||||||
register: results
|
register: results
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
- assert:
|
- assert:
|
||||||
that:
|
that:
|
||||||
- result is failed
|
- result is failed
|
||||||
- "'Unable to create schedule {{ sched1 }}' in result.msg"
|
- "'Unable to create schedule '~ sched1 in result.msg"
|
||||||
|
|
||||||
- name: Create with options that the JT does not support
|
- name: Create with options that the JT does not support
|
||||||
schedule:
|
schedule:
|
||||||
@@ -62,7 +62,7 @@
|
|||||||
- assert:
|
- assert:
|
||||||
that:
|
that:
|
||||||
- result is failed
|
- result is failed
|
||||||
- "'Unable to create schedule {{ sched1 }}' in result.msg"
|
- "'Unable to create schedule '~ sched1 in result.msg"
|
||||||
|
|
||||||
- name: Build a real schedule
|
- name: Build a real schedule
|
||||||
schedule:
|
schedule:
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
- name: Test too many params (failure from validation of terms)
|
- name: Test too many params (failure from validation of terms)
|
||||||
debug:
|
debug:
|
||||||
msg: "{{ query(plugin_name, 'none', 'weekly', start_date='2020-4-16 03:45:07') }}"
|
msg: "{{ query(plugin_name | string, 'none', 'weekly', start_date='2020-4-16 03:45:07') }}"
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,7 @@
|
|||||||
- assert:
|
- assert:
|
||||||
that:
|
that:
|
||||||
- result is failed
|
- result is failed
|
||||||
- "'Monitoring of Workflow Job - {{ wfjt_name1 }} aborted due to timeout' in result.msg"
|
- "'Monitoring of Workflow Job - '~ wfjt_name1 ~ ' aborted due to timeout' in result.msg"
|
||||||
|
|
||||||
- name: Kick off a workflow and wait for it
|
- name: Kick off a workflow and wait for it
|
||||||
workflow_launch:
|
workflow_launch:
|
||||||
|
|||||||
Reference in New Issue
Block a user