def create_argument_parser():
    """ Creates command line parser. """
    parser = typ.ArgumentParser()
    required_args = parser.add_argument_group('required arguments')

    required_args.add_argument('--monochrome-apk',
                               required=True,
                               help='The path to the monochrome APK.')
    parser.add_argument('--monochrome-pathmap',
                        help='The monochrome APK resources pathmap path.')
    required_args.add_argument('--chrome-apk',
                               required=True,
                               help='The path to the chrome APK.')
    parser.add_argument('--chrome-pathmap',
                        help='The chrome APK resources pathmap path.')
    required_args.add_argument('--system-webview-apk',
                               required=True,
                               help='The path to the system webview APK.')
    parser.add_argument('--system-webview-pathmap',
                        help='The system webview APK resources pathmap path.')

    # --avd-config parameter is unused. Add it to the parser because typ.Runner
    # checks that all arguments are known. crbug.com/1084351
    parser.add_argument('--avd-config', help='Unused')
    return parser
def _CreateTestArgParsers():
  parser = typ.ArgumentParser(discovery=True, reporting=True, running=True)
  parser.add_argument('test', type=str, help='Name of the test suite to run')

  parser.add_argument(
      '--filter-tests-after-sharding', default=False, action='store_true',
      help=('Apply the test filter after tests are split for sharding. Useful '
            'for reproducing bugs related to the order in which tests run.'))
  parser.add_argument(
      '--read-abbreviated-json-results-from',
      metavar='FILENAME',
      action='store',
      help=(
          'If specified, reads abbreviated results from that path in json '
          'form. This information is used to more evenly distribute tests '
          'among shards.'))
  parser.add_argument(
      '--debug-shard-distributions',
      action='store_true', default=False,
      help='Print debugging information about the shards\' test distributions')

  parser.add_argument('--default-chrome-root', type=str, default=None)
  parser.add_argument(
      '--client-config', dest='client_configs', action='append', default=[])
  parser.add_argument(
      '--start-dir', dest='start_dirs', action='append', default=[])
  return parser
def create_argument_parser():
    argument_parser = typ.ArgumentParser()
    argument_parser.add_argument('--skip-unit-tests',
                                 default=False,
                                 action='store_true',
                                 help='Skip running unit tests.')
    return argument_parser
Exemple #4
0
def main():
    parser = typ.ArgumentParser()
    parser.add_argument('--build-dir',
                        help='Specifies chromium build directory.')
    parser.add_argument('--target-gen-dir')

    runner = typ.Runner()

    # Set this when using context that will be passed to tests.
    runner.win_multiprocessing = typ.WinMultiprocessing.importable

    runner.parse_args(parser,
                      argv=None,
                      tests=[path_finder.get_integration_tests_dir()])

    # setup logging level
    if runner.args.verbose > 1:
        level = logging.DEBUG
    else:
        level = logging.INFO
    logging.basicConfig(level=level)

    # copy dynamically generated updater version_info.py from
    # target gen directory to
    # //chrome/updater/test/integration_tests/updater so that
    # it can be imported as a module during test runs.
    target_gen_dir_abs_path = os.path.abspath(runner.args.target_gen_dir)
    version_file_path = os.path.join(target_gen_dir_abs_path, 'gen', 'chrome',
                                     'updater', 'version_info.py')
    if os.path.exists(version_file_path):
        dest = os.path.join(path_finder.get_integration_tests_dir(), 'updater',
                            'version_info.py')
        copy_file(version_file_path, dest)
    else:
        logging.info('File not found: %s' % version_file_path)
        return -1

    # copy dynamically generated updater branding_info.py from
    # target gen directory to
    # //chrome/updater/test/integration_tests/updater so that
    # it can be imported as a module during test runs.
    branding_file_path = os.path.join(target_gen_dir_abs_path, 'gen', 'chrome',
                                      'updater', 'branding_info.py')
    if os.path.exists(branding_file_path):
        dest = os.path.join(path_finder.get_integration_tests_dir(), 'updater',
                            'branding_info.py')
        copy_file(branding_file_path, dest)
    else:
        logging.info('File not found: %s' % branding_file_path)
        return -2

    runner.context = Context(runner.args.build_dir)
    return runner.run()[0]
Exemple #5
0
def create_argument_parser():
    """ Creates command line parser. """
    parser = typ.ArgumentParser()
    required_args = parser.add_argument_group('required arguments')

    required_args.add_argument('--monochrome-apk',
                               required=True,
                               help='The path to the monochrome APK.')
    parser.add_argument('--monochrome-pathmap',
                        help='The monochrome APK resources pathmap path.')
    required_args.add_argument('--chrome-apk',
                               required=True,
                               help='The path to the chrome APK.')
    parser.add_argument('--chrome-pathmap',
                        help='The chrome APK resources pathmap path.')
    required_args.add_argument('--system-webview-apk',
                               required=True,
                               help='The path to the system webview APK.')
    parser.add_argument('--system-webview-pathmap',
                        help='The system webview APK resources pathmap path.')

    return parser
Exemple #6
0
def create_argument_parser():
    argument_parser = typ.ArgumentParser()
    argument_parser.add_argument(
        '--reset-results',
        default=False,
        action='store_true',
        help='Overwrites reference files with the generated results.')
    argument_parser.add_argument(
        '--skip-unit-tests',
        default=False,
        action='store_true',
        help='Skip running unit tests (only run reference tests).')
    argument_parser.add_argument(
        '--skip-reference-tests',
        default=False,
        action='store_true',
        help='Skip running reference tests (only run unit tests).')
    argument_parser.add_argument('--suppress-diff',
                                 default=False,
                                 action='store_true',
                                 help='Suppress diff for reference tests.')
    return argument_parser
Exemple #7
0
def ArgumentParser(host=None):
    """Returns an argparse.ArgumentParser for the mini_installer test suite.

    Args:
        host: A typ.Host to pass to typ's argument parser.

    Returns:
        A filled out ArgumentParser instance.
    """
    parser = typ.ArgumentParser(host)
    group = parser.add_argument_group(title='run_mini_installer_tests')
    group.add_argument('--force-clean',
                       action='store_true',
                       default=False,
                       help='Force cleaning existing installations')
    group.add_argument(
        '--output-dir',
        metavar='DIR',
        help='Directory into which crash dumps and other output '
        ' files are to be written')
    group.add_argument('--installer-path',
                       default='mini_installer.exe',
                       metavar='FILENAME',
                       help='The path of the installer.')
    group.add_argument('--previous-version-installer-path',
                       default='previous_version_mini_installer.exe',
                       metavar='FILENAME',
                       help='The path of the previous version installer.')
    group.add_argument('--chromedriver-path',
                       default='chromedriver.exe',
                       help='The path to chromedriver.')
    group.add_argument('--config',
                       default='config.config',
                       metavar='FILENAME',
                       help='Path to test configuration file')
    return parser