##### 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.
"""
    :rtype: tuple[SanityFunc]
    """
    return SANITY_TESTS
class SanityIgnoreParser:
    """Parser for the consolidated sanity test ignore file."""
    NO_CODE = '_'
    def __init__(self, args):  
        if data_context().content.collection:
            ansible_version = '%s.%s' % tuple(get_ansible_version().split('.')[:2])
            ansible_label = 'Ansible %s' % ansible_version
            file_name = 'ignore-%s.txt' % ansible_version
        else:
            ansible_label = 'Ansible'
            file_name = 'ignore.txt'
        self.args = args
        self.relative_path = os.path.join(data_context().content.sanity_path, file_name)
        self.path = os.path.join(data_context().content.root, self.relative_path)
        self.ignores = collections.defaultdict(lambda: collections.defaultdict(dict))  
        self.skips = collections.defaultdict(lambda: collections.defaultdict(int))  
        self.parse_errors = []  
        self.file_not_found_errors = []  
        lines = read_lines_without_comments(self.path, optional=True)
        targets = SanityTargets.get_targets()
        paths = set(target.path for target in targets)
        tests_by_name = {}  
        versioned_test_names = set()  
        unversioned_test_names = {}