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
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
6 years ago
..
ansible_test Add Shippable request signing to ansible-test. (#69526) 6 years ago
cli Add support to install collections from git repositories (#69154) 6 years ago
compat Move unit test compat code out of `lib/ansible/`. (#46996) 7 years ago
config Fix inline vaults for plugins in ensure_type (#67492) 6 years ago
errors Remove empty overridden unittest.setUp and unittest.tearDown methods. 6 years ago
executor Make Python path warning say what it means to say (#69669) 6 years ago
galaxy Add support to install collections from git repositories (#69154) 6 years ago
inventory Clean up unit tests to assist with migration. (#67875) 6 years ago
inventory_test_data/group_vars Merge branch 'v2_final' into devel_switch_v2 11 years ago
mock Replace TestCase.assertEquals with TestCase.assertEqual. 6 years ago
module_utils Discover Flatcar Linux properly for hostname (#69627) 6 years ago
modules Flatten the directory hierarchy of modules (#68966) 6 years ago
parsing Replace TestCase.assertEquals with TestCase.assertEqual. 6 years ago
playbook Fix IncludedFile equality check (#69524) 6 years ago
plugins Add FQCN mappings for network facts modules (#69601) 6 years ago
regex Add toggle to control invalid character substitution in group names (#52748) 7 years ago
template Do not treat AnsibleUndefined as being unsafe (#65202) 6 years ago
utils fix delegated loading when path is not a directory (#69713) 6 years ago
vars Remove empty setUp/tearDown/tearDownClass methods in test classes. 6 years ago
__init__.py Add empty-init code-smell script. (#18406) 9 years ago
requirements.txt Remove unnecessary unit test requirements. 6 years ago
test_constants.py 1st part of ansible config, adds ansible-config to view/manage configs (#12797) 9 years ago
test_context.py Unit tests: remove unused imports (#59740) 7 years ago