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

@ -5,8 +5,8 @@
- name: validate result
assert:
that:
- shellout|success
- shellout|changed
- shellout is successful
- shellout is changed
- shellout.cmd == 'Write-Output "hello from Ansible"'
- shellout.delta is match('^\d:(\d){2}:(\d){2}.(\d){6}$')
- shellout.end is match('^(\d){4}\-(\d){2}\-(\d){2} (\d){2}:(\d){2}:(\d){2}.(\d){6}$')
@ -26,8 +26,8 @@
- name: validate result
assert:
that:
- shellout|success
- shellout|changed
- shellout is successful
- shellout is changed
- shellout.cmd == 'Write-Output "hello from Ansible"; Write-Output "another line"; Write-Output "yet another line"; Write-Output "envvar was $env:taskvar"'
- shellout.delta is match('^\d:(\d){2}:(\d){2}.(\d){6}$')
- shellout.end is match('^(\d){4}\-(\d){2}\-(\d){2} (\d){2}:(\d){2}:(\d){2}.(\d){6}$')
@ -46,9 +46,9 @@
- name: validate result
assert:
that:
- shellout|failed
- shellout is failed
- shellout.failed == true # check the failure key explicitly, since failed does magic with RC
- shellout|changed
- shellout is changed
- shellout.cmd == 'bogus_command1234'
- shellout.delta is match('^\d:(\d){2}:(\d){2}.(\d){6}$')
- shellout.end is match('^(\d){4}\-(\d){2}\-(\d){2} (\d){2}:(\d){2}:(\d){2}.(\d){6}$')
@ -65,8 +65,8 @@
- name: validate result
assert:
that:
- shellout|success
- shellout|changed
- shellout is successful
- shellout is changed
- shellout.cmd == 'Write-Error "it broke"; Write-Output "some output"'
- shellout.delta is match('^\d:(\d){2}:(\d){2}.(\d){6}$')
- shellout.end is match('^(\d){4}\-(\d){2}\-(\d){2} (\d){2}:(\d){2}:(\d){2}.(\d){6}$')
@ -90,8 +90,8 @@
- name: validate result
assert:
that:
- shellout|success
- shellout|changed
- shellout is successful
- shellout is changed
- name: run again with creates, should skip
win_shell: echo $null >> c:\testfile.txt
@ -102,7 +102,7 @@
- name: validate result
assert:
that:
- shellout|skipped
- shellout is skipped
- shellout.msg is search('exists')
- name: test creates with hidden system file, should skip
@ -114,7 +114,7 @@
- name: validate result
assert:
that:
- shellout|skipped
- shellout is skipped
- shellout.msg is search('exists')
- name: ensure testfile is still present
@ -136,8 +136,8 @@
- name: validate result
assert:
that:
- shellout|success
- shellout|changed
- shellout is successful
- shellout is changed
- name: run again with removes, should skip
win_shell: echo $null >> c:\testfile.txt
@ -148,7 +148,7 @@
- name: validate result
assert:
that:
- shellout|skipped
- shellout is skipped
- shellout.msg is search('does not exist')
- name: run something with known nonzero exit code
@ -159,7 +159,7 @@
- name: validate result
assert:
that:
- shellout|failed
- shellout is failed
- shellout.failed == True # check the failure key explicitly, since failed does magic with RC
- shellout.rc == 254
@ -172,8 +172,8 @@
- name: validate result
assert:
that:
- shellout|success
- shellout|changed
- shellout is successful
- shellout is changed
- shellout.rc == 0
- shellout.stdout == "line1 \r\nline2\r\n"
- shellout.stdout_lines == ["line1 ", "line2"]
@ -186,7 +186,7 @@
- name: check job result
assert:
that:
- shellout | succeeded
- shellout is successful
- shellout.stdout_lines[0] == 'yo'
- name: interleave large writes between stdout/stderr (check for buffer consumption deadlock)
@ -210,7 +210,7 @@
- name: assert run stdin test
assert:
that:
- shellout|changed
- shellout is changed
- shellout.rc == 0
- shellout.stderr == ""
- shellout.stdout == "some input\r\n"