Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(231)

Side by Side Diff: scripts/slave/recipe_modules/chromium_android/api.py

Issue 1855663002: Make android's run_instrumentation_suite() use generated wrapper scripts (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@wrapper-1
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import contextlib 5 import contextlib
6 import datetime 6 import datetime
7 import json 7 import json
8 import os 8 import os
9 import re 9 import re
10 import urllib 10 import urllib
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after
654 source=archive, 654 source=archive,
655 bucket=upload_archives_to_bucket, 655 bucket=upload_archives_to_bucket,
656 dest=dest, 656 dest=dest,
657 link_name='output_dir.zip') 657 link_name='output_dir.zip')
658 658
659 if failures: 659 if failures:
660 raise self.m.step.StepFailure('sharded perf tests failed %s' % failures) 660 raise self.m.step.StepFailure('sharded perf tests failed %s' % failures)
661 661
662 def run_instrumentation_suite(self, 662 def run_instrumentation_suite(self,
663 name, 663 name,
664 test_apk, 664 test_apk=None, # no-op
665 apk_under_test=None, 665 apk_under_test=None, # no-op
666 additional_apks=None, 666 additional_apks=None, # no-op
667 isolate_file_path=None, 667 isolate_file_path=None, # no-op
668 flakiness_dashboard=None, 668 flakiness_dashboard=None,
669 annotation=None, except_annotation=None, 669 annotation=None, except_annotation=None,
670 screenshot=False, verbose=False, tool=None, 670 screenshot=False, verbose=False, tool=None,
671 apk_package=None, host_driven_root=None, 671 apk_package=None, # no-op
672 official_build=False, json_results_file=None, 672 host_driven_root=None, # unused?
673 official_build=False, # no-op
674 json_results_file=None,
673 timeout_scale=None, strict_mode=None, 675 timeout_scale=None, strict_mode=None,
674 suffix=None, num_retries=None, 676 suffix=None, num_retries=None,
675 device_flags=None, **kwargs): 677 device_flags=None, **kwargs):
676 if apk_under_test:
677 # TODO(jbudorick): Remove this once the test runner handles installation
678 # of the APK under test.
679 self.adb_install_apk(apk_under_test)
680
681 logcat_output_file = self.m.raw_io.output() 678 logcat_output_file = self.m.raw_io.output()
682 args = [ 679 args = [
683 '--test-apk', test_apk,
684 '--blacklist-file', self.blacklist_file, 680 '--blacklist-file', self.blacklist_file,
685 '--logcat-output-file', logcat_output_file, 681 '--logcat-output-file', logcat_output_file,
686 ] 682 ]
687 if apk_under_test:
688 args.extend(['--apk-under-test', apk_under_test])
689 for a in additional_apks or []:
690 args.extend(['--additional-apk', a])
691 if isolate_file_path:
692 args.extend(['--isolate-file-path', isolate_file_path])
693 if tool: 683 if tool:
694 args.append('--tool=%s' % tool) 684 args.append('--tool=%s' % tool)
695 if flakiness_dashboard: 685 if flakiness_dashboard:
696 args.extend(['--flakiness-dashboard-server', flakiness_dashboard]) 686 args.extend(['--flakiness-dashboard-server', flakiness_dashboard])
697 if annotation: 687 if annotation:
698 args.extend(['-A', annotation]) 688 args.extend(['-A', annotation])
699 if except_annotation: 689 if except_annotation:
700 args.extend(['-E', except_annotation]) 690 args.extend(['-E', except_annotation])
701 if screenshot: 691 if screenshot:
702 args.append('--screenshot') 692 args.append('--screenshot')
703 if verbose: 693 if verbose:
704 args.append('--verbose') 694 args.append('--verbose')
705 if self.m.chromium.c.BUILD_CONFIG == 'Release':
706 args.append('--release')
707 if self.c.coverage or self.c.incremental_coverage: 695 if self.c.coverage or self.c.incremental_coverage:
708 args.extend(['--coverage-dir', self.coverage_dir]) 696 args.extend(['--coverage-dir', self.coverage_dir])
709 if host_driven_root: 697 if host_driven_root:
710 args.extend(['--host-driven-root', host_driven_root]) 698 args.extend(['--host-driven-root', host_driven_root])
711 if official_build:
712 args.extend(['--official-build'])
713 if json_results_file: 699 if json_results_file:
714 args.extend(['--json-results-file', json_results_file]) 700 args.extend(['--json-results-file', json_results_file])
715 if timeout_scale: 701 if timeout_scale:
716 args.extend(['--timeout-scale', timeout_scale]) 702 args.extend(['--timeout-scale', timeout_scale])
717 if strict_mode: 703 if strict_mode:
718 args.extend(['--strict-mode', strict_mode]) 704 args.extend(['--strict-mode', strict_mode])
719 if num_retries is not None: 705 if num_retries is not None:
720 args.extend(['--num-retries', str(num_retries)]) 706 args.extend(['--num-retries', str(num_retries)])
721 if device_flags: 707 if device_flags:
722 args.extend(['--device-flags', device_flags]) 708 args.extend(['--device-flags', device_flags])
723 709
724 step_result = self.test_runner( 710 step_result = self.test_runner(
725 'Instrumentation test %s%s' % (annotation or name, 711 'Instrumentation test %s%s' % (annotation or name,
726 ' (%s)' % suffix if suffix else ''), 712 ' (%s)' % suffix if suffix else ''),
727 args=['instrumentation'] + args, 713 args=['instrumentation'] + args,
714 wrapper_script_suite_name=name,
728 **kwargs) 715 **kwargs)
729 if step_result.raw_io.output: 716 if step_result.raw_io.output:
730 step_result.presentation.logs['logcat'] = ( 717 step_result.presentation.logs['logcat'] = (
731 step_result.raw_io.output.splitlines()) 718 step_result.raw_io.output.splitlines())
732 return step_result 719 return step_result
733 720
734 def launch_gce_instances(self, snapshot='clean-17-l-phone-image-no-popups', 721 def launch_gce_instances(self, snapshot='clean-17-l-phone-image-no-popups',
735 count=6): 722 count=6):
736 args = [ 723 args = [
737 self.m.properties['slavename'], 724 self.m.properties['slavename'],
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after
1238 i.result.presentation.status = self.m.step.EXCEPTION 1225 i.result.presentation.status = self.m.step.EXCEPTION
1239 raise i 1226 raise i
1240 elif (f.result.retcode == EXIT_CODES['warning']): 1227 elif (f.result.retcode == EXIT_CODES['warning']):
1241 w = self.m.step.StepWarning(f.name or f.reason, result=f.result) 1228 w = self.m.step.StepWarning(f.name or f.reason, result=f.result)
1242 w.result.presentation.status = self.m.step.WARNING 1229 w.result.presentation.status = self.m.step.WARNING
1243 raise w 1230 raise w
1244 elif (f.result.retcode == EXIT_CODES['error']): 1231 elif (f.result.retcode == EXIT_CODES['error']):
1245 f.result.presentation.status = self.m.step.FAILURE 1232 f.result.presentation.status = self.m.step.FAILURE
1246 raise 1233 raise
1247 1234
1248 def test_runner(self, step_name, args=None, **kwargs): 1235 def test_runner(self, step_name, args=None, wrapper_script_suite_name=None, ** kwargs):
1249 """Wrapper for the python testrunner script. 1236 """Wrapper for the python testrunner script.
1250 1237
1251 Args: 1238 Args:
1252 step_name: Name of the step. 1239 step_name: Name of the step.
1253 args: Testrunner arguments. 1240 args: Testrunner arguments.
1254 """ 1241 """
1255 with self.handle_exit_codes(): 1242 with self.handle_exit_codes():
1256 return self.m.python( 1243 script = self.c.test_runner
1257 step_name, self.c.test_runner, args, **kwargs) 1244 if wrapper_script_suite_name:
1245 script = os.path.join('out', self.m.chromium.c.BUILD_CONFIG, 'bin',
jbudorick 2016/04/02 00:59:57 this should instead be self.m.chromium.output_dir.
agrieve 2016/04/05 02:37:01 Done.
1246 'run_%s' % wrapper_script_suite_name)
1247 return self.m.python(step_name, script, args, **kwargs)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698