コード例 #1
0
ファイル: data_parallel_main.py プロジェクト: dparalen/dva
def target(ostream, params, parallel_tests):
    global PROCESSED, REPORT_LOCK, TOTAL
    for result in process(params, pool_size=parallel_tests):
        with REPORT_LOCK:
            PROCESSED += 1
            print_progress_info(PROCESSED, TOTAL)
            save_result(ostream, strip_ephemeral(result))
コード例 #2
0
ファイル: data_parallel_main.py プロジェクト: alexxa/dva
def target(ostream, params, parallel_tests, sorted_mode):
    global PROCESSED, REPORT_LOCK, TOTAL
    for result in process(params, pool_size=parallel_tests, sorted_mode=sorted_mode):
        with REPORT_LOCK:
            PROCESSED += 1
            print_progress_info(PROCESSED, TOTAL)
            save_result(ostream, strip_ephemeral(result))
コード例 #3
0
ファイル: serial_main.py プロジェクト: alexxa/dva
def main(conf, istream, ostream, test_whitelist, test_blacklist, stage_whitelist, stage_blacklist,
            tags_whitelist, tags_blacklist, no_action):
    '''
    main worker function
    performs particular stages handling
    generates particular stage/test result list
    '''
    params = dict(test_whitelist=test_whitelist, test_blacklist=test_blacklist,
                    stage_whitelist=stage_whitelist, stage_blacklist=stage_blacklist,
                    tags_whitelist=tags_whitelist, tags_blacklist=tags_blacklist,
                   enabled=not no_action)
    params = load(istream, config_file=conf, augment=params)
    total = required_actions_count(params)
    processed = 0
    print_progress_info(processed, total)
    for item in params:
        for result in process(item):
            processed += 1
            save_result(ostream, strip_ephemeral(result))
            print_progress_info(processed, total)
コード例 #4
0
ファイル: singlemode_main.py プロジェクト: nirzari/dva
def main(conf,
         istream,
         ostream,
         test_whitelist,
         test_blacklist,
         stage_whitelist,
         stage_blacklist,
         tags_whitelist,
         tags_blacklist,
         no_action,
         parallel_instances=1):
    '''
    main worker function
    performs particular stages handling
    generates particular stage/test result list
    '''
    params = dict(test_whitelist=test_whitelist,
                  test_blacklist=test_blacklist,
                  stage_whitelist=stage_whitelist,
                  stage_blacklist=stage_blacklist,
                  tags_whitelist=tags_whitelist,
                  tags_blacklist=tags_blacklist,
                  enabled=not no_action)
    params = load(istream, config_file=conf, augment=params)
    progress_info = ProgressInfo(params)

    tests = []
    for item in params:
        for test_stage in item['test_stages']:
            for test in item['test_stages'][test_stage]:
                tests.append(
                    dict(test=dict(name=test, stage=test_stage), **item))

    from gevent.pool import Pool
    pool = Pool(size=parallel_instances)
    for result in pool.imap_unordered(
            lambda test: process(progress_info, test), tests):
        save_result(ostream, strip_ephemeral(result))
コード例 #5
0
ファイル: singlemode_main.py プロジェクト: RedHatQE/dva
def main(conf, istream, ostream, test_whitelist, test_blacklist, stage_whitelist, stage_blacklist,
            tags_whitelist, tags_blacklist, no_action, parallel_instances=1):
    '''
    main worker function
    performs particular stages handling
    generates particular stage/test result list
    '''
    params = dict(test_whitelist=test_whitelist, test_blacklist=test_blacklist,
                    stage_whitelist=stage_whitelist, stage_blacklist=stage_blacklist,
                    tags_whitelist=tags_whitelist, tags_blacklist=tags_blacklist,
                   enabled=not no_action)
    params = load(istream, config_file=conf, augment=params)
    progress_info = ProgressInfo(params)

    tests = []
    for item in params:
        for test_stage in item['test_stages']:
            for test in item['test_stages'][test_stage]:
                tests.append(dict(test=dict(name=test, stage=test_stage), **item))

    from gevent.pool import Pool
    pool = Pool(size=parallel_instances)
    for result in pool.imap_unordered(lambda test: process(progress_info, test), tests):
        save_result(ostream, strip_ephemeral(result))
コード例 #6
0
def main(conf, istream, ostream, test_whitelist, test_blacklist,
         stage_whitelist, stage_blacklist, tags_whitelist, tags_blacklist,
         no_action):
    '''
    main worker function
    performs particular stages handling
    generates particular stage/test result list
    '''
    params = dict(test_whitelist=test_whitelist,
                  test_blacklist=test_blacklist,
                  stage_whitelist=stage_whitelist,
                  stage_blacklist=stage_blacklist,
                  tags_whitelist=tags_whitelist,
                  tags_blacklist=tags_blacklist,
                  enabled=not no_action)
    params = load(istream, config_file=conf, augment=params)
    total = required_actions_count(params)
    processed = 0
    print_progress_info(processed, total)
    for item in params:
        for result in process(item):
            processed += 1
            save_result(ostream, strip_ephemeral(result))
            print_progress_info(processed, total)