Skip to content

Commit

Permalink
Fix the bulk Job Launch Integration test in awx collection (ansible#1…
Browse files Browse the repository at this point in the history
…4702)

* fix the integration tests
  • Loading branch information
jainnikhil30 authored Dec 6, 2023
1 parent fb04e5d commit 87abbd4
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
- result['job_info']['skip_tags'] == "skipbaz"
- result['job_info']['limit'] == "localhost"
- 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\"}'"

# cleanup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

- assert:
that:
- "{{ matching_jobs.count }} == 1"
- matching_jobs.count == 1

- name: List failed jobs (which don't exist)
job_list:
Expand All @@ -26,7 +26,7 @@

- assert:
that:
- "{{ successful_jobs.count }} == 0"
- successful_jobs.count == 0

- name: Get ALL result pages!
job_list:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
that:
- wait_results is failed
- '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
- name: Generate a random string for test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@

- name: Get the ID of the first user created and verify that it is correct
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
set_fact:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

- name: Call ruleset with no rules
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
register: results

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
- assert:
that:
- 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
schedule:
Expand All @@ -62,7 +62,7 @@
- assert:
that:
- result is failed
- "'Unable to create schedule {{ sched1 }}' in result.msg"
- "'Unable to create schedule '~ sched1 in result.msg"

- name: Build a real schedule
schedule:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

- name: Test too many params (failure from validation of terms)
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
register: result

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
- assert:
that:
- 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
workflow_launch:
Expand Down

0 comments on commit 87abbd4

Please sign in to comment.