mirror of
https://github.com/ansible/awx.git
synced 2026-05-20 15:27:47 -02:30
Update Collections Syntax to get Collection related CI Checks Passing (#16061)
* Fix collection task breaking collection ci checks * Patch ansible.module_utils.basic._ANSIBLE_PROFILE directly * Conditionalize other santity assertions * Remove added blank lines and identifier from Fail if absent and no identifier set
This commit is contained in:
@@ -7,44 +7,48 @@
|
||||
ansible.builtin.set_fact:
|
||||
plugin_name: "{{ controller_meta.prefix }}.schedule_rrule"
|
||||
|
||||
- name: Test too many params (failure from validation of terms)
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ lookup(plugin_name | string, 'none', 'weekly', start_date='2020-4-16 03:45:07') }}"
|
||||
- name: Lookup with too many parameters (should fail)
|
||||
ansible.builtin.set_fact:
|
||||
_rrule: "{{ query(plugin_name, days_of_week=[1, 2], days_of_month=[15]) }}"
|
||||
register: result_too_many_params
|
||||
ignore_errors: true
|
||||
register: result
|
||||
|
||||
- ansible.builtin.assert:
|
||||
- name: Assert proper error is reported for too many parameters
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- result is failed
|
||||
- "'You may only pass one schedule type in at a time' in result.msg"
|
||||
- result_too_many_params.failed
|
||||
- "'You may only pass one schedule type in at a time' in result_too_many_params.msg"
|
||||
|
||||
- name: Test invalid frequency (failure from validation of term)
|
||||
- name: Attempt invalid schedule_rrule lookup with bad frequency
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ lookup(plugin_name, 'john', start_date='2020-4-16 03:45:07') }}"
|
||||
msg: "{{ lookup(plugin_name, 'john', start_date='2020-04-16 03:45:07') }}"
|
||||
register: result_bad_freq
|
||||
ignore_errors: true
|
||||
register: result
|
||||
|
||||
- ansible.builtin.assert:
|
||||
- name: Assert proper error is reported for bad frequency
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- result is failed
|
||||
- "'Frequency of john is invalid' in result.msg"
|
||||
- result_bad_freq.failed
|
||||
- "'Frequency of john is invalid' in result_bad_freq.msg | default('')"
|
||||
|
||||
- name: Test an invalid start date (generic failure case from get_rrule)
|
||||
- name: Test an invalid start date
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ lookup(plugin_name, 'none', start_date='invalid') }}"
|
||||
register: result_bad_date
|
||||
ignore_errors: true
|
||||
register: result
|
||||
|
||||
- ansible.builtin.assert:
|
||||
- name: Assert plugin error message for invalid start date
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- result is failed
|
||||
- "'Parameter start_date must be in the format YYYY-MM-DD' in result.msg"
|
||||
- result_bad_date.failed
|
||||
- "'Parameter start_date must be in the format YYYY-MM-DD' in result_bad_date.msg | default('')"
|
||||
|
||||
- name: Test end_on as count (generic success case)
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ lookup(plugin_name, 'minute', start_date='2020-4-16 03:45:07', end_on='2') }}"
|
||||
register: result
|
||||
register: result_success
|
||||
|
||||
- ansible.builtin.assert:
|
||||
- name: Assert successful rrule generation
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- result.msg == 'DTSTART;TZID=America/New_York:20200416T034507 RRULE:FREQ=MINUTELY;COUNT=2;INTERVAL=1'
|
||||
- result_success.msg == 'DTSTART;TZID=America/New_York:20200416T034507 RRULE:FREQ=MINUTELY;COUNT=2;INTERVAL=1'
|
||||
|
||||
Reference in New Issue
Block a user