##### SUMMARY

Support collection roles as integration test targets.

Now that https://github.com/ansible/ansible/issues/59462 has been merged, ansible-test can be updated to support running integration test targets that are collection roles.

The planned convention is to look for targets under `roles/test/` and allow use of target-specific plugins from `plugins/{plugin_type}/test/{target_name}/`.

##### ISSUE TYPE

Feature Idea

##### COMPONENT NAME

ansible-test

##### ADDITIONAL INFORMATION

This will allow integration test targets to be written using collections instead of pre-collection roles.
"""Make the given inventory available during delegation."""
    if isinstance(args, PosixIntegrationConfig):
        return
    def inventory_callback(files):  
        """
        Add the inventory file to the payload file list.
        This will preserve the file during delegation even if it is ignored or is outside the content and install roots.
        """
        if data_context().content.collection:
            working_path = data_context().content.collection.directory
        else:
            working_path = ''
        inventory_path = os.path.join(working_path, get_inventory_relative_path(args))
        if os.path.isfile(inventory_path_src) and os.path.relpath(inventory_path_src, data_context().content.root) != inventory_path:
            originals = [item for item in files if item[1] == inventory_path]
            if originals:
                for original in originals:
                    files.remove(original)
                display.warning('Overriding inventory file "%s" with "%s".' % (inventory_path, inventory_path_src))
            else:
                display.notice('Sourcing inventory file "%s" from "%s".' % (inventory_path, inventory_path_src))
            files.append((inventory_path_src, inventory_path))
    data_context().register_payload_callback(inventory_callback)
@contextlib.contextmanager
def integration_test_environment(args, target, inventory_path_src):