##### 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 args: IntegrationConfig
    :type test_dir: str
    :type target_names: list[str]
    :type targets_dict: dict[str, IntegrationTarget]
    :type targets_executed: set[str]
    :type inventory_path: str
    :type temp_path: str
    :type always: bool
    """
    for target_name in target_names:
        if not always and target_name in targets_executed:
            continue
        target = targets_dict[target_name]
        if not args.explain:
            
            remove_tree(test_dir)
            make_dirs(test_dir)
        if target.script_path:
            command_integration_script(args, target, test_dir, inventory_path, temp_path)
        else:
            command_integration_role(args, target, None, test_dir, inventory_path, temp_path)
        targets_executed.add(target_name)
def integration_environment(args, target, test_dir, inventory_path, ansible_config, env_config):
    """
    :type args: IntegrationConfig