Пример #1
0
def AddMatrixArgs(parser):
  """Register the repeatable args which define the the axes for a test matrix.

  Args:
    parser: An argparse parser used to add arguments that follow a command
        in the CLI.
  """
  parser.add_argument(
      '--device-ids', '-d',
      type=arg_parsers.ArgList(min_length=1),
      metavar='DEVICE_ID',
      help='The list of DEVICE_IDs to test against (default: one device '
      'determined by Google Cloud Test Lab\'s device catalog; see TAGS listed '
      'by the *$ {parent_command} devices list* command).')
  parser.add_argument(
      '--os-version-ids', '-v',
      type=arg_parsers.ArgList(min_length=1),
      metavar='OS_VERSION_ID',
      help='The list of OS_VERSION_IDs to test against (default: a version ID '
      'determined by Google Cloud Test Lab\'s device catalog).')
  parser.add_argument(
      '--locales', '-l',
      type=arg_parsers.ArgList(min_length=1),
      metavar='LOCALE',
      help='The list of LOCALEs to test against (default: a single locale '
      'determined by Google Cloud Test Lab\'s device catalog).')
  orientation = parser.add_argument(
      '--orientations', '-o',
      metavar='ORIENTATION',
      type=arg_parsers.ArgList(min_length=1, max_length=2,
                               choices=arg_validate.ORIENTATION_LIST),
      default='portrait',
      help='The device orientation(s) to test against.')
  orientation.completer = arg_parsers.GetMultiCompleter(OrientationsCompleter)
Пример #2
0
def AddMatrixArgs(parser):
    """Register the repeatable args which define the axes for a test matrix.

  Args:
    parser: An argparse parser used to add arguments that follow a command
        in the CLI.
  """
    parser.add_argument('--device',
                        category=base.COMMONLY_USED_FLAGS,
                        type=arg_parsers.ArgDict(min_length=1),
                        action='append',
                        metavar='DIMENSION=VALUE',
                        help="""\
      A list of ``DIMENSION=VALUE'' pairs which specify a target device to test
      against. This flag may be repeated to specify multiple devices. The four
      device dimensions are: *model*, *version*, *locale*, and *orientation*. If
      any dimensions are omitted, they will use a default value. The default
      value, and all possible values, for each dimension can be found with the
      ``list'' command for that dimension, such as `$ {parent_command} models
      list`. *--device* is now the preferred way to specify test devices and may
      not be used in conjunction with *--devices-ids*, *--os-version-ids*,
      *--locales*, or *--orientations*. Omitting all of the preceding
      dimension-related flags will run tests against a single device using
      defaults for all four device dimensions.

      Examples:\n
      ```
      --device model=Nexus6
      --device version=23,orientation=portrait
      --device model=shamu,version=22,locale=zh_CN,orientation=default
      ```
      """)
    parser.add_argument(
        '--device-ids',
        '-d',
        category=DEPRECATED_DEVICE_DIMENSIONS,
        type=arg_parsers.ArgList(min_length=1),
        metavar='MODEL_ID',
        help='The list of MODEL_IDs to test against (default: one device model '
        'determined by the Firebase Test Lab device catalog; see TAGS listed '
        'by the `$ {parent_command} devices list` command).')
    parser.add_argument(
        '--os-version-ids',
        '-v',
        category=DEPRECATED_DEVICE_DIMENSIONS,
        type=arg_parsers.ArgList(min_length=1),
        metavar='OS_VERSION_ID',
        help='The list of OS_VERSION_IDs to test against (default: a version ID '
        'determined by the Firebase Test Lab device catalog).')
    parser.add_argument(
        '--locales',
        '-l',
        category=DEPRECATED_DEVICE_DIMENSIONS,
        type=arg_parsers.ArgList(min_length=1),
        metavar='LOCALE',
        help='The list of LOCALEs to test against (default: a single locale '
        'determined by the Firebase Test Lab device catalog).')
    parser.add_argument(
        '--orientations',
        '-o',
        category=DEPRECATED_DEVICE_DIMENSIONS,
        type=arg_parsers.ArgList(min_length=1,
                                 max_length=2,
                                 choices=arg_validate.ORIENTATION_LIST),
        completer=arg_parsers.GetMultiCompleter(OrientationsCompleter),
        metavar='ORIENTATION',
        help='The device orientation(s) to test against (default: portrait). '
        'Specifying \'default\' will pick the preferred orientation '
        'for the app.')