ansible/test
Will Thames c9b212c5bd task_result _check_key should handle empty results (#16766)
When a task result has an empty results list, the
list should be ignored when determining the results
of `_check_key`. Here the empty list is treated the
same as a non-existent list.

This fixes a bug that manifests itself with squashed
items - namely the task result contains the correct
value for the key, but an empty results list. The
empty results list was treated as zero failures
when deciding which handler to call - so the task
show as a success in the output, but is deemed to
have failed when deciding whether to continue.

This also demonstrates a mismatch between task
result processing and play iteration.

A test is also added for this case, but it would not
have caught the bug - because the bug is really in
the display, and not the success/failure of the
task (visually the test is more accurate).

Fixes ansible/ansible-modules-core#4214
(cherry picked from commit eb2a3a91a8)
2016-08-29 08:40:38 -07:00
..
code-smell Update grep for six to not falsely trigger when six is only a substring of a different library 2016-05-26 16:16:21 -07:00
integration task_result _check_key should handle empty results (#16766) 2016-08-29 08:40:38 -07:00
units fixed tests to accoutn for new parameter 2016-08-17 10:58:49 -04:00
utils Update shippable shared dir for COPY_SOURCE. (#16511) 2016-06-29 15:11:32 -07:00
README.md Update README.md 2015-11-03 14:11:22 -05:00

Ansible Test System

Folders

unit

Unit tests that test small pieces of code not suited for the integration test layer, usually very API based, and should leverage mock interfaces rather than producing side effects.

Playbook engine code is better suited for integration tests.

Requirements: sudo pip install paramiko PyYAML jinja2 httplib2 passlib nose mock

integration

Integration test layer, constructed using playbooks.

Some tests may require cloud credentials, others will not, and destructive tests are separated from non-destructive so a subset can be run on development machines.

learn more

hop into a subdirectory and see the associated README.md for more info.