##### 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.
"""
        :type path: str
        :type module_path: str | None
        :type module_prefix: str | None
        :type base_path: str
        :type symlink: bool | None
        """
        super(TestTarget, self).__init__()
        if symlink is None:
            symlink = os.path.islink(to_bytes(path.rstrip(os.path.sep)))
        self.name = path
        self.path = path
        self.base_path = base_path + '/' if base_path else None
        self.symlink = symlink
        name, ext = os.path.splitext(os.path.basename(self.path))
        if module_path and is_subdir(path, module_path) and name != '__init__' and ext in MODULE_EXTENSIONS:
            self.module = name[len(module_prefix or ''):].lstrip('_')
            self.modules = (self.module,)
        else:
            self.module = None
            self.modules = tuple()
        aliases = [self.path, self.module]
        parts = self.path.split('/')
        for i in range(1, len(parts)):
            alias = '%s/' % '/'.join(parts[:i])
            aliases.append(alias)
        aliases = [a for a in aliases if a]
        self.aliases = tuple(sorted(aliases))
class IntegrationTarget(CompletionTarget):