def finish_system_testing_session_and_get_report():
    """Finish, copy and return full session report.

    Also clear collections to free memory.
    """
    ### Add the last missing data

    ## session end time
    _SESSION_DATA['end_time'] = str(datetime.now())

    ## session result

    result_set = {
        case_stats['result']
        for case_stats in _TEST_CASES_STATS.values() 
    }

    if 'error' in result_set:
        _SESSION_DATA['result'] = 'error'

    elif 'failed' in result_set:
        _SESSION_DATA['result'] = 'failed'

    else:
        _SESSION_DATA['result'] = 'passed'

    ### deepcopy session data
    full_session_report = deepcopy(_SESSION_DATA)

    ### include system information
    full_session_report.update(APP_REFS.system_info)

    ### clear collections
    clear_collections()

    ### return full session report
    return full_session_report
Finish, copy and return full session report.

    Also clear collections to free memory.
    
nodezator/systemtesting/playsupport.py