Deprecate tests used as filters (#32361)

* Warn on tests used as filters

* Update docs, add aliases for tests that fit more gramatically with test syntax

* Fix rst formatting

* Add successful filter, alias of success

* Remove renamed_deprecation, it was overkill

* Make directory alias for is_dir

* Update tests to use proper jinja test syntax

* Update additional documentation, living outside of YAML files, to reflect proper jinja test syntax

* Add conversion script, porting guide updates, and changelog updates

* Update newly added uses of tests as filters

* No underscore variable

* Convert recent tests as filter changes to win_stat

* Fix some changes related to rebasing a few integration tests

* Make tests_as_filters_warning explicitly accept the name of the test, instead of inferring the name

* Add test for tests_as_filters_warning

* Update tests as filters in newly added/modified tests

* Address recent changes to several integration tests

* Address recent changes in cs_vpc
This commit is contained in:
Matt Martz 2017-11-27 16:58:08 -06:00 committed by ansibot
commit 4fe08441be
349 changed files with 4086 additions and 3844 deletions

View file

@ -7,7 +7,7 @@
- name: check if module fails gracefully when older than 2008r2
win_power_plan:
name: "high performance"
when: os_version.stdout_lines[0] | version_compare('6.1','lt')
when: os_version.stdout_lines[0] is version('6.1','lt')
check_mode: yes
register: old_os_check
failed_when: old_os_check.msg != 'The win_power_plan Ansible module is only available on Server 2008r2 (6.1) and newer'
@ -40,7 +40,7 @@
- name: assert setting plan (check mode)
assert:
that:
- set_plan_check|changed
- set_plan_check is changed
- set_plan_check_result.stdout == 'False\r\n'
#Test that setting plan and that change is applied
@ -57,7 +57,7 @@
- name: assert setting plan
assert:
that:
- set_plan|changed
- set_plan is changed
- set_plan_result.stdout == 'True\r\n'
#Test that plan doesn't apply change if it is already set
@ -69,9 +69,9 @@
- name: assert setting plan (idempotent)
assert:
that:
- not set_plan_idempotent|changed
- set_plan_idempotent is not changed
when: os_version.stdout_lines[0] | version_compare('6.1','ge')
when: os_version.stdout_lines[0] is version('6.1','ge')
always:
- name: always change back plan to high performance when done testing
win_power_plan: