##### 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 pip: list[str]
    :type command: str
    :type packages: list[str] | None
    :rtype: list[str] | None
    """
    constraints = os.path.join(ANSIBLE_TEST_DATA_ROOT, 'requirements', 'constraints.txt')
    requirements = os.path.join(ANSIBLE_TEST_DATA_ROOT, 'requirements', '%s.txt' % command)
    options = []
    if os.path.exists(requirements) and os.path.getsize(requirements):
        options += ['-r', requirements]
    if data_context().content.is_ansible:
        if command == 'sanity':
            options += ['-r', os.path.join(data_context().content.root, 'test', 'sanity', 'requirements.txt')]
    if packages:
        options += packages
    if not options:
        return None
    return pip + ['install', '--disable-pip-version-check', '-c', constraints] + options
def command_shell(args):