mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-09 14:50:02 -07:00
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:
parent
fd4a6cf7ad
commit
4fe08441be
349 changed files with 4086 additions and 3844 deletions
|
@ -5,8 +5,8 @@
|
|||
- name: validate result
|
||||
assert:
|
||||
that:
|
||||
- cmdout|success
|
||||
- cmdout|changed
|
||||
- cmdout is successful
|
||||
- cmdout is changed
|
||||
- cmdout.cmd == 'whoami /groups'
|
||||
- cmdout.delta is match('^\d:(\d){2}:(\d){2}.(\d){6}$')
|
||||
- cmdout.end is match('^(\d){4}\-(\d){2}\-(\d){2} (\d){2}:(\d){2}:(\d){2}.(\d){6}$')
|
||||
|
@ -24,8 +24,8 @@
|
|||
- name: validate result
|
||||
assert:
|
||||
that:
|
||||
- cmdout|failed
|
||||
- not cmdout|changed
|
||||
- cmdout is failed
|
||||
- cmdout is not changed
|
||||
- cmdout.cmd == 'bogus_command1234'
|
||||
- cmdout.rc == 2
|
||||
- "'Could not locate the following executable bogus_command1234' in cmdout.msg"
|
||||
|
@ -37,8 +37,8 @@
|
|||
- name: validate result
|
||||
assert:
|
||||
that:
|
||||
- cmdout|success
|
||||
- cmdout|changed
|
||||
- cmdout is successful
|
||||
- cmdout is changed
|
||||
- cmdout.cmd == 'cmd /c "echo some output & echo some error 1>&2"'
|
||||
- cmdout.delta is match('^\d:(\d){2}:(\d){2}.(\d){6}$')
|
||||
- cmdout.end is match('^(\d){4}\-(\d){2}\-(\d){2} (\d){2}:(\d){2}:(\d){2}.(\d){6}$')
|
||||
|
@ -62,8 +62,8 @@
|
|||
- name: validate result
|
||||
assert:
|
||||
that:
|
||||
- cmdout|success
|
||||
- cmdout|changed
|
||||
- cmdout is successful
|
||||
- cmdout is changed
|
||||
|
||||
- name: run again with creates, should skip
|
||||
win_command: cmd /c "echo $null >> c:\testfile.txt"
|
||||
|
@ -74,7 +74,7 @@
|
|||
- name: validate result
|
||||
assert:
|
||||
that:
|
||||
- cmdout|skipped
|
||||
- cmdout is skipped
|
||||
- cmdout.msg is search('exists')
|
||||
|
||||
- name: test creates with hidden system file, should skip
|
||||
|
@ -86,7 +86,7 @@
|
|||
- name: validate result
|
||||
assert:
|
||||
that:
|
||||
- cmdout|skipped
|
||||
- cmdout is skipped
|
||||
- cmdout.msg is search('exists')
|
||||
|
||||
- name: ensure testfile is still present
|
||||
|
@ -108,8 +108,8 @@
|
|||
- name: validate result
|
||||
assert:
|
||||
that:
|
||||
- cmdout|success
|
||||
- cmdout|changed
|
||||
- cmdout is successful
|
||||
- cmdout is changed
|
||||
|
||||
- name: run again with removes, should skip
|
||||
win_command: cmd /c "del c:\testfile.txt"
|
||||
|
@ -120,7 +120,7 @@
|
|||
- name: validate result
|
||||
assert:
|
||||
that:
|
||||
- cmdout|skipped
|
||||
- cmdout is skipped
|
||||
- cmdout.msg is search('does not exist')
|
||||
|
||||
- name: run something with known nonzero exit code
|
||||
|
@ -131,7 +131,7 @@
|
|||
- name: validate result
|
||||
assert:
|
||||
that:
|
||||
- cmdout|failed
|
||||
- cmdout is failed
|
||||
- cmdout.failed == True # check the failure key explicitly, since failed does magic with RC
|
||||
- cmdout.rc == 254
|
||||
|
||||
|
@ -164,7 +164,7 @@
|
|||
- name: assert call to argv binary with absolute path
|
||||
assert:
|
||||
that:
|
||||
- cmdout|changed
|
||||
- cmdout is changed
|
||||
- cmdout.rc == 0
|
||||
- cmdout.stdout_lines[0] == 'arg1'
|
||||
- cmdout.stdout_lines[1] == 'arg 2'
|
||||
|
@ -180,7 +180,7 @@
|
|||
- name: assert call to argv binary with relative path
|
||||
assert:
|
||||
that:
|
||||
- cmdout|changed
|
||||
- cmdout is changed
|
||||
- cmdout.rc == 0
|
||||
- cmdout.stdout_lines[0] == 'C:\\path\\end\\slash\\'
|
||||
- cmdout.stdout_lines[1] == 'ADDLOCAL=msi,example'
|
||||
|
@ -200,7 +200,7 @@
|
|||
- name: assert run stdin test
|
||||
assert:
|
||||
that:
|
||||
- cmdout|changed
|
||||
- cmdout is changed
|
||||
- cmdout.rc == 0
|
||||
- cmdout.stdout_lines|count == 1
|
||||
- cmdout.stdout_lines[0] == "some input"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue