def GetDeviceStepsOptParser(): parser = bb_utils.GetParser() parser.add_option('--experimental', action='store_true', help='Run experiemental tests') parser.add_option('-f', '--test-filter', metavar='<filter>', default=[], action='append', help=('Run a test suite. Test suites: "%s"' % '", "'.join(VALID_TESTS))) parser.add_option('--gtest-filter', help='Filter for running a subset of tests of a gtest test') parser.add_option('--asan', action='store_true', help='Run tests with asan.') parser.add_option('--install', metavar='<apk name>', help='Install an apk by name') parser.add_option('--no-reboot', action='store_true', help='Do not reboot devices during provisioning.') parser.add_option('--coverage-bucket', help=('Bucket name to store coverage results. Coverage is ' 'only run if this is set.')) parser.add_option('--restart-usb', action='store_true', help='Restart usb ports before device status check.') parser.add_option( '--flakiness-server', help=('The flakiness dashboard server to which the results should be ' 'uploaded.')) parser.add_option( '--auto-reconnect', action='store_true', help='Push script to device which restarts adbd on disconnections.') parser.add_option( '--logcat-dump-output', help='The logcat dump output will be "tee"-ed into this file') parser.add_option('--disable-stack-tool', action='store_true', help='Do not run stack tool.') parser.add_option('--asan-symbolize', action='store_true', help='Run stack tool for ASAN') return parser
def GetRunBotOptParser(): parser = bb_utils.GetParser() parser.add_option('--bot-id', help='Specify bot id directly.') parser.add_option('--testing', action='store_true', help='For testing: print, but do not run commands') return parser
def GetDeviceStepsOptParser(): parser = bb_utils.GetParser() parser.add_option('--experimental', action='store_true', help='Run experiemental tests') parser.add_option('-f', '--test-filter', metavar='<filter>', default=[], action='append', help=('Run a test suite. Test suites: "%s"' % '", "'.join(VALID_TESTS))) parser.add_option('--asan', action='store_true', help='Run tests with asan.') parser.add_option('--install', metavar='<apk name>', help='Install an apk by name') parser.add_option('--reboot', action='store_true', help='Reboot devices before running tests') parser.add_option( '--flakiness-server', help='The flakiness dashboard server to which the results should be ' 'uploaded.') parser.add_option( '--auto-reconnect', action='store_true', help='Push script to device which restarts adbd on disconnections.') parser.add_option( '--logcat-dump-output', help='The logcat dump output will be "tee"-ed into this file') return parser
def GetDeviceStepsOptParser(): parser = bb_utils.GetParser() parser.add_option('--experimental', action='store_true', help='Run experiemental tests') parser.add_option('-f', '--test-filter', metavar='<filter>', default=[], action='append', help=('Run a test suite. Test suites: "%s"' % '", "'.join(VALID_TESTS))) parser.add_option( '--gtest-filter', help='Filter for running a subset of tests of a gtest test') parser.add_option('--asan', action='store_true', help='Run tests with asan.') parser.add_option('--install', metavar='<apk name>', help='Install an apk by name') parser.add_option('--no-reboot', action='store_true', help='Do not reboot devices during provisioning.') parser.add_option( '--coverage-bucket', help=('Bucket name to store coverage results. Coverage is ' 'only run if this is set.')) parser.add_option('--restart-usb', action='store_true', help='Restart usb ports before device status check.') parser.add_option( '--flakiness-server', help=('The flakiness dashboard server to which the results should be ' 'uploaded.')) parser.add_option( '--auto-reconnect', action='store_true', help='Push script to device which restarts adbd on disconnections.') parser.add_option('--skip-wipe', action='store_true', help='Do not wipe devices during provisioning.') parser.add_option( '--logcat-dump-output', help='The logcat dump output will be "tee"-ed into this file') # During processing perf bisects, a seperate working directory created under # which builds are produced. Therefore we should look for relevent output # file under this directory.(/b/build/slave/<slave_name>/build/bisect/src/out) parser.add_option( '--chrome-output-dir', help='Chrome output directory to be used while bisecting.') parser.add_option('--disable-stack-tool', action='store_true', help='Do not run stack tool.') parser.add_option('--asan-symbolize', action='store_true', help='Run stack tool for ASAN') return parser
def GetHostStepsOptParser(): parser = bb_utils.GetParser() parser.add_option('--steps', help='Comma separated list of host tests.') parser.add_option('--build-targets', default='All', help='Comma separated list of build targets.') parser.add_option('--experimental', action='store_true', help='Indicate whether to compile experimental targets.') return parser
def main(argv): parser = bb_utils.GetParser() parser.add_option('--experimental', action='store_true', help='Run experiemental tests') parser.add_option('-f', '--test-filter', metavar='<filter>', default=[], action='append', help=('Run a test suite. Test suites: "%s"' % '", "'.join(VALID_TESTS))) parser.add_option('--asan', action='store_true', help='Run tests with asan.') parser.add_option('--install', metavar='<apk name>', help='Install an apk by name') parser.add_option('--reboot', action='store_true', help='Reboot devices before running tests') parser.add_option('--upload-to-flakiness-server', action='store_true', help='Upload the results to the flakiness dashboard.') parser.add_option( '--auto-reconnect', action='store_true', help='Push script to device which restarts adbd on disconnections.') options, args = parser.parse_args(argv[1:]) if args: return sys.exit('Unused args %s' % args) unknown_tests = set(options.test_filter) - VALID_TESTS if unknown_tests: return sys.exit('Unknown tests %s' % list(unknown_tests)) setattr(options, 'target', options.factory_properties.get('target', 'Debug')) # Add adb binary and chromium-source platform-tools to tip of PATH variable. android_paths = [ os.path.join(constants.ANDROID_SDK_ROOT, 'platform-tools') ] # Bots checkout chrome in /b/build/slave/<name>/build/src build_internal_android = os.path.abspath( os.path.join(CHROME_SRC, '..', '..', '..', '..', '..', 'build_internal', 'scripts', 'slave', 'android')) if os.path.exists(build_internal_android): android_paths.insert(0, build_internal_android) os.environ['PATH'] = os.pathsep.join(android_paths + [os.environ['PATH']]) MainTestWrapper(options)
def GetHostStepsOptParser(): parser = bb_utils.GetParser() parser.add_option('--steps', help='Comma separated list of host tests.') parser.add_option('--build-targets', default='', help='Comma separated list of build targets.') parser.add_option('--experimental', action='store_true', help='Indicate whether to compile experimental targets.') parser.add_option('--extra_src', default='', help='Path to extra source file. If this is supplied, ' 'bisect script will use it to override default behavior.') return parser
def main(argv): parser = bb_utils.GetParser() parser.add_option('--bot-id', help='Specify bot id directly.') parser.add_option('--testing', action='store_true', help='For testing: print, but do not run commands') options, args = parser.parse_args(argv[1:]) if args: parser.error('Unused args: %s' % args) bot_id = options.bot_id or options.factory_properties.get('android_bot_id') if not bot_id: parser.error( 'A bot id must be specified through option or factory_props.') # Get a BotConfig object looking first for an exact bot-id match. If no exact # match, look for a bot-id which is a substring of the specified id. # This allows similar bots to have unique IDs, but to share config. # If multiple substring matches exist, pick the longest one. bot_map = GetBotStepMap() bot_config = bot_map.get(bot_id) if not bot_config: substring_matches = filter(lambda x: x in bot_id, bot_map.iterkeys()) if substring_matches: max_id = max(substring_matches, key=len) print 'Using config from id="%s" (substring match).' % max_id bot_config = bot_map[max_id] if not bot_config: print 'Error: config for id="%s" cannot be inferred.' % bot_id return 1 print 'Using config:', bot_config commands = GetCommands(options, bot_config) for command in commands: print 'Will run: ', bb_utils.CommandToString(command) print env = GetEnvironment(bot_config.host_obj, options.testing) print 'Environment changes:' print DictDiff(dict(os.environ), env) for command in commands: print bb_utils.CommandToString(command) sys.stdout.flush() if options.testing: env['BUILDBOT_TESTING'] = '1' return_code = subprocess.call(command, cwd=bb_utils.CHROME_SRC, env=env) if return_code != 0: return return_code
def main(argv): parser = bb_utils.GetParser() parser.add_option('--host-tests', help='Comma separated list of host tests.') parser.add_option('--build-args', default='All', help='Comma separated list of build targets.') parser.add_option('--compile', action='store_true', help='Indicate whether a compile step should be run.') parser.add_option('--experimental', action='store_true', help='Indicate whether to compile experimental targets.') parser.add_option('--zip-build', action='store_true', help='Indicate whether the build should be zipped.') parser.add_option('--extract-build', action='store_true', help='Indicate whether a build should be downloaded.') parser.add_option('--update-clang', action='store_true', help='Download or build the ASan runtime library.') options, args = parser.parse_args(argv[1:]) if args: return sys.exit('Unused args %s' % args) host_tests = [] if options.host_tests: host_tests = options.host_tests.split(',') unknown_tests = set(host_tests) - VALID_HOST_TESTS if unknown_tests: return sys.exit('Unknown host tests %s' % list(unknown_tests)) build_type = options.factory_properties.get('target', 'Debug') if options.compile: if 'check_webview_licenses' in host_tests: CheckWebViewLicenses() RunHooks() Compile(build_type, options.build_args.split(',')) if options.experimental: Compile(build_type, EXPERIMENTAL_TARGETS, True) if 'findbugs' in host_tests: FindBugs(build_type == 'Release') if options.zip_build: ZipBuild(options.factory_properties, options.build_properties) if options.update_clang: UpdateClang() if options.extract_build: ExtractBuild(options.factory_properties, options.build_properties)
def main(argv): parser = bb_utils.GetParser() parser.add_option('--steps', help='Comma separated list of host tests.') parser.add_option('--build-targets', default='All', help='Comma separated list of build targets.') parser.add_option('--experimental', action='store_true', help='Indicate whether to compile experimental targets.') options, args = parser.parse_args(argv[1:]) if args: return sys.exit('Unused args %s' % args) setattr(options, 'target', options.factory_properties.get('target', 'Debug')) bb_utils.RunSteps(GetHostSteps(), options)
def main(argv): parser = bb_utils.GetParser() parser.add_option('--experimental', action='store_true', help='Run experiemental tests') parser.add_option('-f', '--test-filter', metavar='<filter>', default=[], action='append', help=('Run a test suite. Test suites: "%s"' % '", "'.join(VALID_TESTS))) parser.add_option('--asan', action='store_true', help='Run tests with asan.') parser.add_option('--install', metavar='<apk name>', help='Install an apk by name') parser.add_option('--reboot', action='store_true', help='Reboot devices before running tests') parser.add_option('--upload-to-flakiness-server', action='store_true', help='Upload the results to the flakiness dashboard.') parser.add_option( '--auto-reconnect', action='store_true', help='Push script to device which restarts adbd on disconnections.') options, args = parser.parse_args(argv[1:]) if args: return sys.exit('Unused args %s' % args) unknown_tests = set(options.test_filter) - VALID_TESTS if unknown_tests: return sys.exit('Unknown tests %s' % list(unknown_tests)) setattr(options, 'target', options.factory_properties.get('target', 'Debug')) MainTestWrapper(options)