def create_task_record(*args, task_name:str, action:str, **kwargs):
    """Create a task record (for testing)"""
    all_actions = Task._actions
    if action not in all_actions:
        raise ValueError(f"Allowed actions: {all_actions}")
    if 'name' not in kwargs:
        kwargs['name'] = "rocketry.task"

    r = create_record(*args, level=logging.INFO if action != "fail" else logging.ERROR, **kwargs)
    r.task_name = task_name
    r.action = action
    return r
Create a task record (for testing)
rocketry/testing/log.py