ansible/test/units
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
2020-06-04 10:41:46 -05:00
..
ansible_test Add Shippable request signing to ansible-test. (#69526) 2020-05-15 15:38:02 -07:00
cli Add support to install collections from git repositories (#69154) 2020-05-29 13:33:32 -04:00
compat
config Fix inline vaults for plugins in ensure_type (#67492) 2020-02-25 10:42:31 -05:00
errors Remove empty overridden unittest.setUp and unittest.tearDown methods. 2019-11-05 09:12:11 -08:00
executor Make Python path warning say what it means to say (#69669) 2020-05-29 13:15:11 -04:00
galaxy Add support to install collections from git repositories (#69154) 2020-05-29 13:33:32 -04:00
inventory Clean up unit tests to assist with migration. (#67875) 2020-02-28 20:29:41 -08:00
inventory_test_data/group_vars
mock Replace TestCase.assertEquals with TestCase.assertEqual. 2019-11-11 10:24:21 -08:00
module_utils Discover Flatcar Linux properly for hostname (#69627) 2020-06-02 18:41:53 +05:30
modules Flatten the directory hierarchy of modules (#68966) 2020-05-13 19:14:53 -07:00
parsing Replace TestCase.assertEquals with TestCase.assertEqual. 2019-11-11 10:24:21 -08:00
playbook Fix IncludedFile equality check (#69524) 2020-06-04 10:41:46 -05:00
plugins Add FQCN mappings for network facts modules (#69601) 2020-05-22 23:20:21 +05:30
regex
template Do not treat AnsibleUndefined as being unsafe (#65202) 2019-11-25 15:06:29 +01:00
utils fix delegated loading when path is not a directory (#69713) 2020-05-26 15:55:17 -07:00
vars Remove empty setUp/tearDown/tearDownClass methods in test classes. 2019-11-06 08:14:29 -08:00
__init__.py
requirements.txt Remove unnecessary unit test requirements. 2020-03-23 11:14:21 -05:00
test_constants.py
test_context.py