def add_provider_result_to_root(dict_data):
    """Add provider result to test object.
    Try to create one and continue if test does not exist.
    """
    logger.info('Add provider result to root.')
    # make sure test in created and running. If not do that first.
    start_test_if_required()
    test_result = TestResult()
    dict_data = result_utils.insert_report_group_if_not_defined(dict_data)
    test_result.add_provider_data(dict_data)
def end_iterator(force_stop=False):
    logger.info('End iteration.')
    itr_result_obj = iterator_utils.get_leaf_iterator()
    if itr_result_obj is None:
        logger.error('There is no iterator running to end iterator.')
        return
    iterator = Iterator(0, itr_result_obj)
    data = iterator.complete(force_stop)
    parentIterator = iterator_utils.get_leaf_iterator_no_throw()
    if parentIterator is None:
        logger.info('Adding iteration result to Test.')
        data[pc.STATUS][pc.APPLY_VERDICT] = True
        test_result = TestResult()
        test_result.add_provider_data(data)
    else:
        logger.info('Adding iteration result to parent iterator.')
        logger.debug_result_object_info(itr_result_obj)
        parent_itr = Iterator(0, parentIterator)
        parent_itr.add_child_iterator_data(data)
    logger.debug('End iteration completed')