##### 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.
require_targets = set(filter_targets(targets, requires, errors=True, directories=False))
        include_targets = [require_target for require_target in include_targets if require_target in require_targets]
    if excludes:
        list(filter_targets(targets, excludes, errors=True, include=False, directories=False))
    internal_targets = set(filter_targets(include_targets, excludes, errors=False, include=False, directories=False))
    return tuple(sorted(internal_targets, key=lambda sort_target: sort_target.name))
def filter_targets(targets,  
                   patterns,  
                   include=True,  
                   directories=True,  
                   errors=True,  
                   ):  
    """Iterate over the given targets and filter them based on the supplied arguments."""
    unmatched = set(patterns or ())
    compiled_patterns = dict((p, re.compile('^%s$' % p)) for p in patterns) if patterns else None
    for target in targets:
        matched_directories = set()
        match = False
        if patterns:
            for alias in target.aliases:
                for pattern in patterns:
                    if compiled_patterns[pattern].match(alias):
                        match = True
                        try:
                            unmatched.remove(pattern)
                        except KeyError:
                            pass
                        if alias.endswith('/'):
                            if target.base_path and len(target.base_path) > len(alias):
                                matched_directories.add(target.base_path)