Fixing PlayIterator bugs

* Unit tests exposed a problem where nested blocks did not correctly
  hit rescue/always portions of parent blocks
* Cleaned up logic in PlayIterator
* Unfortunately fixing the above exposed a potential problem in the
  block integration tests, where a failure in an "always" section may
  always lead to a failed state and the termination of execution
  beyond that point, so certain parts of the block integration test
  were disabled.
This commit is contained in:
James Cammarata
2016-03-09 13:29:22 -05:00
parent d7bd5fc075
commit 9d61a6cba8
3 changed files with 120 additions and 82 deletions

View File

@@ -33,17 +33,17 @@
- name: set block always run flag
set_fact:
block_always_run: true
- block:
- meta: noop
always:
- name: set nested block always run flag
set_fact:
nested_block_always_run: true
- name: fail in always
fail:
- name: tasks flag should not be set after failure in always
set_fact:
always_run_after_failure: true
#- block:
# - meta: noop
# always:
# - name: set nested block always run flag
# set_fact:
# nested_block_always_run: true
# - name: fail in always
# fail:
# - name: tasks flag should not be set after failure in always
# set_fact:
# always_run_after_failure: true
- meta: clear_host_errors
post_tasks:
@@ -52,7 +52,7 @@
- block_tasks_run
- block_rescue_run
- block_always_run
- nested_block_always_run
#- nested_block_always_run
- not tasks_run_after_failure
- not rescue_run_after_failure
- not always_run_after_failure
@@ -84,7 +84,7 @@
include: fail.yml
args:
msg: "failed from rescue"
- name: tasks flag should not be set after failure in rescue
- name: flag should not be set after failure in rescue
set_fact:
rescue_run_after_failure: true
always: