diff options
author | Abhijeet Kasurde <akasurde@redhat.com> | 2024-11-12 16:09:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-12 16:09:39 +0100 |
commit | ca0810da85d729a526b8ae97204b9da5c5c2ea25 (patch) | |
tree | e6bcc0409afbae28117b0e2f4b5d4ee76024656a | |
parent | package_facts fix empty packages on foreign mgr (#83855) (diff) | |
download | ansible-ca0810da85d729a526b8ae97204b9da5c5c2ea25.tar.xz ansible-ca0810da85d729a526b8ae97204b9da5c5c2ea25.zip |
Add tests for deprecations (#84284)
* Check for module deprecation
* Check for module option deprecation
* Check for plugin deprecation
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
-rw-r--r-- | test/integration/targets/deprecations/cache_plugins/notjsonfile.py | 4 | ||||
-rwxr-xr-x | test/integration/targets/deprecations/runme.sh | 11 |
2 files changed, 12 insertions, 3 deletions
diff --git a/test/integration/targets/deprecations/cache_plugins/notjsonfile.py b/test/integration/targets/deprecations/cache_plugins/notjsonfile.py index 800fe3bb36..3af587abb7 100644 --- a/test/integration/targets/deprecations/cache_plugins/notjsonfile.py +++ b/test/integration/targets/deprecations/cache_plugins/notjsonfile.py @@ -9,6 +9,10 @@ DOCUMENTATION = """ description: This cache uses is NOT JSON author: Ansible Core (@ansible-core) version_added: 0.7.0 + deprecated: + alternative: cause I need to test it + why: Test deprecation + version: '2.0.0' options: _uri: required: True diff --git a/test/integration/targets/deprecations/runme.sh b/test/integration/targets/deprecations/runme.sh index 48a02760ad..bd52ef8ff4 100755 --- a/test/integration/targets/deprecations/runme.sh +++ b/test/integration/targets/deprecations/runme.sh @@ -34,6 +34,11 @@ export ANSIBLE_CACHE_PLUGIN=notjsonfile # check for plugin(s) config option deprecation [ "$(ANSIBLE_NOTJSON_CACHE_PLUGIN_REMOVEME=1 ansible -m meta -a 'noop' localhost --playbook-dir ./ 2>&1 | grep -c 'DEPRECATION')" -eq "1" ] -# TODO: check for module deprecation -# TODO: check for module option deprecation -# TODO: check for plugin deprecation +# check for the module deprecation +[ "$(ansible-doc willremove --playbook-dir ./ | grep -c 'DEPRECATED')" -eq "1" ] + +# check for the module option deprecation +[ "$(ansible-doc removeoption --playbook-dir ./ | grep -c 'deprecated:')" -eq "1" ] + +# check for plugin deprecation +[ "$(ansible-doc -t cache notjsonfile --playbook-dir ./ | grep -c 'DEPRECATED:')" -eq "1" ] |