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

@ -14,8 +14,8 @@
- name: assert copy worked
assert:
that:
- 'copy_result|success'
- 'copy_result|changed'
- 'copy_result is successful'
- 'copy_result is changed'
- name: stat copied file
stat:

View file

@ -13,7 +13,7 @@
- name: Assert copy failed
assert:
that:
- 'copy_result|failed'
- 'copy_result is failed'
- name: Stat dest path
stat:

View file

@ -108,7 +108,7 @@
- name: Assert that the file was not changed
assert:
that:
- "not copy_result2|changed"
- "copy_result2 is not changed"
- name: Overwrite the file using the content system
copy:
@ -129,7 +129,7 @@
- name: Assert that the file has changed
assert:
that:
- "copy_result3|changed"
- "copy_result3 is changed"
- "'content' not in copy_result3"
- "stat_results.stat.checksum == ('modified'|hash('sha1'))"
- "stat_results.stat.mode != '0700'"
@ -154,7 +154,7 @@
- name: Assert that the file has changed
assert:
that:
- "copy_result3|changed"
- "copy_result3 is changed"
- "'content' not in copy_result3"
- "stat_results.stat.checksum == ('modified'|hash('sha1'))"
- "stat_results.stat.mode == '0700'"
@ -269,7 +269,7 @@
- name: Assert that empty source failed
assert:
that:
- failed_copy | failed
- failed_copy is failed
- "'src (or content) is required' in failed_copy.msg"
- name: Try without destination to ensure it fails
@ -285,7 +285,7 @@
- name: Assert that missing destination failed
assert:
that:
- failed_copy | failed
- failed_copy is failed
- "'dest is required' in failed_copy.msg"
- name: Try without source to ensure it fails
@ -301,7 +301,7 @@
- name: Assert that missing source failed
assert:
that:
- failed_copy | failed
- failed_copy is failed
- "'src (or content) is required' in failed_copy.msg"
- name: Try with both src and content to ensure it fails
@ -315,7 +315,7 @@
- name: Assert that mutually exclusive parameters failed
assert:
that:
- failed_copy | failed
- failed_copy is failed
- "'mutually exclusive' in failed_copy.msg"
- name: Try with content and directory as destination to ensure it fails
@ -332,7 +332,7 @@
- name: Assert that content and directory as destination failed
assert:
that:
- failed_copy | failed
- failed_copy is failed
- "'can not use content with a dir as dest' in failed_copy.msg"
- name: Clean up
@ -359,7 +359,7 @@
- name: Assert that the file has changed
assert:
that:
- "copy_results|changed"
- "copy_results is changed"
- "stat_results.stat.checksum == ('foo.txt\n'|hash('sha1'))"
- "stat_results.stat.mode == '0500'"
@ -386,7 +386,7 @@
- name: Assert that the file has changed and has correct mode
assert:
that:
- "copy_results|changed"
- "copy_results is changed"
- "copy_results.mode == '0547'"
- "stat_results.stat.checksum == ('foo.txt\n'|hash('sha1'))"
- "stat_results.stat.mode == '0547'"
@ -437,7 +437,7 @@
- name: Assert that the recursive copy did something
assert:
that:
- "recursive_copy_result|changed"
- "recursive_copy_result is changed"
- name: Check that a file in a directory was transferred
stat:
@ -547,7 +547,7 @@
- name: Assert that the second copy did not change anything
assert:
that:
- "not recursive_copy_result|changed"
- "recursive_copy_result is not changed"
- name: Cleanup the recursive copy subdir
file:
@ -594,7 +594,7 @@
- name: Assert that the recursive copy did something
assert:
that:
- "recursive_copy_result|changed"
- "recursive_copy_result is changed"
- name: Check that a file in a directory was transferred
stat:
@ -702,7 +702,7 @@
- name: Assert that the second copy did not change anything
assert:
that:
- "not recursive_copy_result|changed"
- "recursive_copy_result is not changed"
- name: Cleanup the recursive copy subdir
file:
@ -749,7 +749,7 @@
- name: Assert that the recursive copy did something
assert:
that:
- "recursive_copy_result|changed"
- "recursive_copy_result is changed"
- name: Check that a file in a directory was transferred
stat:
@ -867,7 +867,7 @@
- name: Assert that the second copy did not change anything
assert:
that:
- "not recursive_copy_result|changed"
- "recursive_copy_result is not changed"
- name: Cleanup the recursive copy subdir
file:
@ -1153,7 +1153,7 @@
- name: Assert that the file has changed and is not a link
assert:
that:
- "copy_results|changed"
- "copy_results is changed"
- "'content' not in copy_results"
- "stat_results.stat.checksum == ('modified'|hash('sha1'))"
- "not stat_results.stat.islnk"