You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/test/units/playbook
Alex Schultz 247e43b252
Fix IncludedFile equality check (#69524)
In the case of a free style strategy, it is possible to end up with
multiple hosts trying to include from the same role, however the tasks
being included may be different with the use of tasks_from.  Previously
if you had two hosts that were included the same role when the
process_include_results function tries to determine if a included needs
to be run on a specific host, it would end up merging two different
tasks into which ever one was processed first.

This change updates the equality check to also check if the task uuid
associated with the IncludedFile is the same. The previous check only
checked if the task's parent uuid was the same. This breaks down when
both includes have the same parent.

    - hosts: all
      strategy: free
      gather_facts: false
      tasks:
        - include_role:
            name: random_sleep
        - block:
          - name: set a fact (1)
            include_role:
              name: set_a_fact
              tasks_from: fact1.yml
          - name: set a fact (2)
            include_role:
              name: set_a_fact
              tasks_from: fact2.yml
        - name: include didn't run
          fail:
            msg: >
              set_a_fact didn't run
              fact1: {{ fact1 | default('not defined')}}
              fact2: {{ fact2 | default('not defined') }}"
          when: (fact1 is not defined or fact2 is not defined)

Closes #69521
4 years ago
..
role Remove empty setUp/tearDown/tearDownClass methods in test classes. 5 years ago
__init__.py
test_attribute.py
test_base.py Replace TestCase.assertEquals with TestCase.assertEqual. 5 years ago
test_block.py Remove empty overridden unittest.setUp and unittest.tearDown methods. 5 years ago
test_collectionsearch.py Make sure collection is a list if a str is given (#69081) 4 years ago
test_conditional.py
test_helpers.py Make sure collection is a list if a str is given (#69081) 4 years ago
test_included_file.py Fix IncludedFile equality check (#69524) 4 years ago
test_play.py Remove empty overridden unittest.setUp and unittest.tearDown methods. 5 years ago
test_play_context.py Split test_play_context_make_become_cmd into files (#68026) 5 years ago
test_playbook.py Remove empty setUp/tearDown/tearDownClass methods in test classes. 5 years ago
test_taggable.py
test_task.py Replace TestCase.assertEquals with TestCase.assertEqual. 5 years ago