def update_image_run_test_types()

in src/utils.py [0:0]


def update_image_run_test_types(image_build_string, test_type):
    """
    Map the test_types with image_tags or job_type values, we use this mapping in fetch_dlc_images_for_test_jobs
    to append images for each test job
    :param image_build_string: str (image_name or training or inference or all)
    :param test_type: str (all or ec2 or ecs or eks or sagemaker)
    :return:
    """
    if image_build_string in JobParameters.image_run_test_types.keys():
        test = JobParameters.image_run_test_types.get(image_build_string)
        # If image_build_string is already present
        # we will only append the test_type if it doesn't have all tests.
        if constants.ALL not in test and test_type != constants.ALL:
            test.append(test_type)
            JobParameters.image_run_test_types[image_build_string] = test
        # if test_type is "all" then we override existing value with that.
        elif test_type == constants.ALL:
            JobParameters.image_run_test_types[image_build_string] = [test_type]
    # Assigning the test_type to image_build_string for the first time
    else:
        JobParameters.image_run_test_types[image_build_string] = [test_type]