def extract_task_info(luigi_task):
    """Extract task name and generate a routine id from a luigi task, from the date and test fields.

    Args:
        luigi_task (luigi.Task): Task to extract test and date parameters from.
    Returns:
        {test, routine_id} (tuple): Test flag, and routine ID for this task.
    """
    test = (luigi_task.test if 'test' in luigi_task.__dict__
            else not luigi_task.production)
    task_name = type(luigi_task).__name__
    routine_id = f'{task_name}-{luigi_task.date}-{test}'
    return test, routine_id