コード例 #1
0
def main():
  """Note: this is solely to run the current master's code and can totally
  differ from the underlying script flags.

  To update these flags:
  - Update the following code to support both the previous flag and the new
    flag.
  - Change scripts/master/factory/swarm_commands.py to pass the new flag.
  - Restart all the masters using swarming.
  - Remove the old flag from this code.
  """
  client = swarming_utils.find_client(os.getcwd())
  if not client:
    print >> sys.stderr, 'Failed to find swarm(ing)_client'
    return 1

  parser = optparse.OptionParser()
  parser.add_option('-u', '--swarming', help='Swarm server')
  parser.add_option(
      '-s', '--shards', type='int', default=-1, help='Number of shards')
  chromium_utils.AddPropertiesOptions(parser)
  (options, args) = parser.parse_args()
  options.swarming = options.swarming.rstrip('/')

  if not args:
    parser.error('Must specify one test name.')
  elif len(args) > 1:
    parser.error('Must specify only one test name.')
  print('Found %s' % client)
  sys.stdout.flush()
  return determine_version_and_run_handler(client, options, args[0])
コード例 #2
0
def main():
  """Note: this is solely to run the current master's code and can totally
  differ from the underlying script flags.

  To update these flags:
  - Update the following code to support both the previous flag and the new
    flag.
  - Change scripts/master/factory/swarm_commands.py to pass the new flag.
  - Restart all the masters using swarming.
  - Remove the old flag from this code.
  """
  client = swarming_utils.find_client(os.getcwd())
  if not client:
    print >> sys.stderr, 'Failed to find swarm(ing)_client'
    return 1

  parser = optparse.OptionParser(description=sys.modules[__name__].__doc__)
  parser.add_option('--swarming')
  parser.add_option('--isolate-server')
  parser.add_option(
      '--task', nargs=4, action='append', default=[], dest='tasks')
  chromium_utils.AddPropertiesOptions(parser)
  options, args = parser.parse_args()
  if args:
    parser.error('Unsupported args: %s' % args)

  # Loads the other flags implicitly.
  task_prefix, slave_os, priority = process_build_properties(options)

  return trigger(
      client, options.swarming, options.isolate_server, priority,
      options.tasks, task_prefix, slave_os)
コード例 #3
0
def main():
    """Note: this is solely to run the current master's code and can totally
  differ from the underlying script flags.

  To update these flags:
  - Update the following code to support both the previous flag and the new
    flag.
  - Change scripts/master/factory/swarm_commands.py to pass the new flag.
  - Restart all the masters using swarming.
  - Remove the old flag from this code.
  """
    client = swarming_utils.find_client(os.getcwd())
    if not client:
        print >> sys.stderr, 'Failed to find swarm(ing)_client'
        return 1

    parser = optparse.OptionParser()
    parser.add_option('-u', '--swarming', help='Swarm server')
    parser.add_option('-s',
                      '--shards',
                      type='int',
                      default=-1,
                      help='Number of shards')
    chromium_utils.AddPropertiesOptions(parser)
    (options, args) = parser.parse_args()
    options.swarming = options.swarming.rstrip('/')

    if not args:
        parser.error('Must specify one test name.')
    elif len(args) > 1:
        parser.error('Must specify only one test name.')
    print('Found %s' % client)
    sys.stdout.flush()
    return determine_version_and_run_handler(client, options, args[0])
コード例 #4
0
def main():
    """Note: this is solely to run the current master's code and can totally
  differ from the underlying script flags.

  To update these flags:
  - Update the following code to support both the previous flag and the new
    flag.
  - Change scripts/master/factory/swarm_commands.py to pass the new flag.
  - Restart all the masters using swarming.
  - Remove the old flag from this code.
  """
    client = swarming_utils.find_client(os.getcwd())
    if not client:
        print >> sys.stderr, 'Failed to find swarm(ing)_client'
        return 1

    parser = optparse.OptionParser(description=sys.modules[__name__].__doc__)
    parser.add_option('--swarming')
    parser.add_option('--isolate-server')
    parser.add_option('--task',
                      nargs=4,
                      action='append',
                      default=[],
                      dest='tasks')
    chromium_utils.AddPropertiesOptions(parser)
    options, args = parser.parse_args()
    if args:
        parser.error('Unsupported args: %s' % args)

    # Loads the other flags implicitly.
    task_prefix, slave_os, priority = process_build_properties(options)

    return trigger(client, options.swarming, options.isolate_server, priority,
                   options.tasks, task_prefix, slave_os)
コード例 #5
0
def main(args):
  """Note: this is solely to run the current master's code and can totally
  differ from the underlying script flags.

  To update these flags:
  - Update the following code to support both the previous flag and the new
    flag.
  - Change scripts/master/factory/swarm_commands.py to pass the new flag.
  - Restart all the masters using swarming.
  - Remove the old flag from this code.
  """
  client = swarming_utils.find_client(os.getcwd())
  if not client:
    print >> sys.stderr, 'Failed to find swarm(ing)_client'
    return 1
  version = swarming_utils.get_version(client)
  if version < (0, 3):
    print >> sys.stderr, (
        '%s is version %s which is too old. Please run the test locally' %
        (client, '.'.join(version)))
    return 1

  parser = optparse.OptionParser(description=sys.modules[__name__].__doc__)
  parser.add_option('--verbose', action='store_true')
  parser.add_option('--swarming')
  parser.add_option('--isolate-server')
  chromium_utils.AddPropertiesOptions(parser)
  options, args = parser.parse_args(args)
  if args:
    parser.error('Unsupported args: %s' % args)
  if not options.swarming or not options.isolate_server:
    parser.error('Require both --swarming and --isolate-server')

  logging.basicConfig(level=logging.DEBUG if options.verbose else logging.ERROR)
  # Loads the other flags implicitly.
  slave_os, priority, steps, builder, build_number = process_build_properties(
      options)
  logging.info('To run: %s, %s, %s', slave_os, priority, steps)
  if not steps:
    print('Nothing to trigger')
    annotator.AdvancedAnnotationStep(sys.stdout, False).step_warnings()
    return 0
  print('Selected tests:')
  print('\n'.join(' %s' % s for s in sorted(steps)))
  selected_os = swarming_utils.OS_MAPPING[slave_os]
  print('Selected OS: %s' % selected_os)
  return drive_many(
      client,
      version,
      options.swarming,
      options.isolate_server,
      priority,
      {'os': selected_os},
      steps,
      builder,
      build_number)
コード例 #6
0
def main(args):
    """Note: this is solely to run the current master's code and can totally
  differ from the underlying script flags.

  To update these flags:
  - Update the following code to support both the previous flag and the new
    flag.
  - Change scripts/master/factory/swarm_commands.py to pass the new flag.
  - Restart all the masters using swarming.
  - Remove the old flag from this code.
  """
    client = swarming_utils.find_client(os.getcwd())
    if not client:
        print >> sys.stderr, 'Failed to find swarm(ing)_client'
        return 1
    version = swarming_utils.get_version(client)
    if version < (0, 3):
        print >> sys.stderr, (
            '%s is version %s which is too old. Please run the test locally' %
            (client, '.'.join(version)))
        return 1

    parser = optparse.OptionParser(description=sys.modules[__name__].__doc__)
    parser.add_option('--verbose', action='store_true')
    parser.add_option('--swarming')
    parser.add_option('--isolate-server')
    chromium_utils.AddPropertiesOptions(parser)
    options, args = parser.parse_args(args)
    if args:
        parser.error('Unsupported args: %s' % args)
    if not options.swarming or not options.isolate_server:
        parser.error('Require both --swarming and --isolate-server')

    logging.basicConfig(
        level=logging.DEBUG if options.verbose else logging.ERROR)
    # Loads the other flags implicitly.
    slave_os, priority, steps, builder, build_number = process_build_properties(
        options)
    logging.info('To run: %s, %s, %s', slave_os, priority, steps)
    if not steps:
        print('Nothing to trigger')
        annotator.AdvancedAnnotationStep(sys.stdout, False).step_warnings()
        return 0
    print('Selected tests:')
    print('\n'.join(' %s' % s for s in sorted(steps)))
    selected_os = swarming_utils.OS_MAPPING[slave_os]
    print('Selected OS: %s' % selected_os)
    return drive_many(client, version, options.swarming,
                      options.isolate_server, priority, {'os': selected_os},
                      steps, builder, build_number)
コード例 #7
0
def main():
    client = swarming_utils.find_client(os.getcwd())
    if not client:
        print >> sys.stderr, 'Failed to find swarm(ing)_client'
        return 1
    # Replace the 'isolate_shim.py' wrapper with 'isolate.py'.
    args = [sys.executable, os.path.join(client, 'isolate.py')] + sys.argv[1:]
    build_dir, args = InterceptFlag('--build-dir', args)
    target, args = InterceptFlag('--target', args)

    if build_dir:
        assert target
        build_dir = build_directory.GetBuildOutputDirectory()
        AdjustIsolatedFlag(args, os.path.join(build_dir, target))

    return chromium_utils.RunCommand(args)
コード例 #8
0
def main():
  client = swarming_utils.find_client(os.getcwd())
  if not client:
    print >> sys.stderr, 'Failed to find swarm(ing)_client'
    return 1
  # Replace the 'isolate_shim.py' wrapper with 'isolate.py'.
  args = [sys.executable, os.path.join(client, 'isolate.py')] + sys.argv[1:]
  build_dir, args = InterceptFlag('--build-dir', args)
  target, args = InterceptFlag('--target', args)

  if build_dir:
    assert target
    build_dir = build_directory.GetBuildOutputDirectory()
    AdjustIsolatedFlag(args, os.path.join(build_dir, target))

  return chromium_utils.RunCommand(args)