Ejemplo n.º 1
0
def register(coordinator):
    """Registers this module as a worker with the given coordinator."""
    utils.verify_binary('pdiff_compare_binary', ['-version'])
    utils.verify_binary('pdiff_composite_binary', ['-version'])

    assert FLAGS.pdiff_threads > 0
    assert FLAGS.queue_server_prefix

    item = queue_worker.RemoteQueueWorkflow(
        constants.PDIFF_QUEUE_NAME,
        DoPdiffQueueWorkflow,
        max_tasks=FLAGS.pdiff_threads,
        wait_seconds=FLAGS.pdiff_wait_seconds)
    item.root = True
    coordinator.input_queue.put(item)
Ejemplo n.º 2
0
def register(coordinator):
    """Registers this module as a worker with the given coordinator."""
    utils.verify_binary('pdiff_compare_binary', ['-version'])
    utils.verify_binary('pdiff_composite_binary', ['-version'])

    assert FLAGS.pdiff_threads > 0
    assert FLAGS.queue_server_prefix

    item = queue_worker.RemoteQueueWorkflow(
        constants.PDIFF_QUEUE_NAME,
        DoPdiffQueueWorkflow,
        max_tasks=FLAGS.pdiff_threads,
        wait_seconds=FLAGS.pdiff_wait_seconds)
    item.root = True
    coordinator.input_queue.put(item)
Ejemplo n.º 3
0
def register(coordinator):
    """Registers this module as a worker with the given coordinator."""
    utils.verify_binary('phantomjs_binary', ['--version'])

    assert FLAGS.phantomjs_script
    assert os.path.exists(FLAGS.phantomjs_script)

    assert FLAGS.capture_threads > 0
    assert FLAGS.queue_server_prefix

    item = queue_worker.RemoteQueueWorkflow(
        constants.CAPTURE_QUEUE_NAME,
        DoCaptureQueueWorkflow,
        max_tasks=FLAGS.capture_threads,
        wait_seconds=FLAGS.capture_wait_seconds)
    item.root = True
    coordinator.input_queue.put(item)
Ejemplo n.º 4
0
        sys.stderr.write('%s\n' % e)
        usage()
        sys.exit(1)

    if len(argv) < 3:
        sys.stderr.write('Too few arguments\n')
        usage(short=True)
        sys.exit(1)

    mode = argv[1]
    assert mode in MODES, 'Invalid mode: %s (expected %r)' % (mode, MODES)

    config_dir = argv[2]
    assert os.path.isdir(config_dir), 'Expected directory, got %s' % config_dir

    utils.verify_binary('phantomjs_binary', ['--version'])
    utils.verify_binary('pdiff_compare_binary', ['--version'])
    utils.verify_binary('pdiff_composite_binary', ['--version'])

    assert os.path.exists(FLAGS.phantomjs_script)

    logging.basicConfig()
    logging.getLogger().addFilter(RepetitiveLogFilterer())
    logging.getLogger().handlers[0].setFormatter(CompactExceptionLogger())
    if FLAGS.verbose:
        logging.getLogger().setLevel(logging.DEBUG)

    coordinator = workers.get_coordinator()
    timer_worker.register(coordinator)

    global FAILED_TESTS
Ejemplo n.º 5
0
        sys.stderr.write('%s\n' % e)
        usage()
        sys.exit(1)

    if len(argv) < 3:
        sys.stderr.write('Too few arguments\n')
        usage(short=True)
        sys.exit(1)

    mode = argv[1]
    assert mode in MODES, 'Invalid mode: %s (expected %r)' % (mode, MODES)

    config_dir = argv[2]
    assert os.path.isdir(config_dir), 'Expected directory, got %s' % config_dir

    utils.verify_binary('phantomjs_binary', ['--version'])
    utils.verify_binary('pdiff_compare_binary', ['--version'])
    utils.verify_binary('pdiff_composite_binary', ['--version'])

    assert os.path.exists(FLAGS.phantomjs_script)

    logging.basicConfig()
    logging.getLogger().addFilter(RepetitiveLogFilterer())
    logging.getLogger().handlers[0].setFormatter(CompactExceptionLogger())
    if FLAGS.verbose:
        logging.getLogger().setLevel(logging.DEBUG)

    coordinator = workers.get_coordinator()
    timer_worker.register(coordinator)

    global FAILED_TESTS