Changeset 246303 in webkit
- Timestamp:
- Jun 10, 2019 10:05:19 PM (5 years ago)
- Location:
- trunk/Tools
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r246285 r246303 1 2019-06-10 Dewei Zhu <dewei_zhu@apple.com> 2 3 Extend run-benchmark to allow diagnosing before closing browser on test failure. 4 https://bugs.webkit.org/show_bug.cgi?id=198729 5 6 Reviewed by Ryosuke Niwa. 7 8 Add '--diagnose-directory' option to store diagnose information when test failed. 9 10 * Scripts/webkitpy/benchmark_runner/benchmark_runner.py: 11 (BenchmarkRunner.__init__): 12 * Scripts/webkitpy/benchmark_runner/browser_driver/browser_driver.py: 13 (BrowserDriver.diagnose_test_failure): Add default no-op function to base class. 14 * Scripts/webkitpy/benchmark_runner/run_benchmark.py: Added '--diagnose-directory' option. 15 (parse_args): 16 (run_benchmark_plan): 17 * Scripts/webkitpy/benchmark_runner/webdriver_benchmark_runner.py: 18 (WebDriverBenchmarkRunner._run_one_test): Added 'diagnose_test_failure' invocation on test failure. 19 * Scripts/webkitpy/benchmark_runner/webserver_benchmark_runner.py: 20 (WebServerBenchmarkRunner.__init__): 21 (WebServerBenchmarkRunner._run_one_test): Added 'diagnose_test_failure' invocation on test failure. 22 1 23 2019-06-10 Sam Weinig <weinig@apple.com> 2 24 -
trunk/Tools/Scripts/webkitpy/benchmark_runner/benchmark_runner.py
r244730 r246303 24 24 name = 'benchmark_runner' 25 25 26 def __init__(self, plan_file, local_copy, count_override, build_dir, output_file, platform, browser, browser_path, scale_unit=True, show_iteration_values=False, device_id=None ):26 def __init__(self, plan_file, local_copy, count_override, build_dir, output_file, platform, browser, browser_path, scale_unit=True, show_iteration_values=False, device_id=None, diagnose_dir=None): 27 27 try: 28 28 plan_file = self._find_plan_file(plan_file) … … 39 39 self._browser_path = browser_path 40 40 self._build_dir = os.path.abspath(build_dir) if build_dir else None 41 self._diagnose_dir = os.path.abspath(diagnose_dir) if diagnose_dir else None 41 42 self._output_file = output_file 42 43 self._scale_unit = scale_unit -
trunk/Tools/Scripts/webkitpy/benchmark_runner/browser_driver/browser_driver.py
r244730 r246303 43 43 pass 44 44 45 def diagnose_test_failure(self, debug_directory, error): 46 pass 47 45 48 @property 46 49 def webdriver_binary_path(self): -
trunk/Tools/Scripts/webkitpy/benchmark_runner/run_benchmark.py
r239522 r246303 48 48 parser.add_argument('--device-id', default=None, help='Undocumented option for mobile device testing.') 49 49 parser.add_argument('--debug', action='store_true', help='Enable debug logging.') 50 parser.add_argument('--diagnose-directory', dest='diagnose_dir', default=None, help='Directory for storing diagnose information on test failure. It\'s up to browser driver implementation when this option is not specified.') 50 51 parser.add_argument('--no-adjust-unit', dest='scale_unit', action='store_false', help="Don't convert to scientific notation.") 51 52 parser.add_argument('--show-iteration-values', dest='show_iteration_values', action='store_true', help="Show the measured value for each iteration in addition to averages.") … … 69 70 def run_benchmark_plan(args, plan): 70 71 benchmark_runner_class = benchmark_runner_subclasses[args.driver] 71 runner = benchmark_runner_class(plan, args.local_copy, args.count, args.build_dir, args.output_file, args.platform, args.browser, args.browser_path, args.scale_unit, args.show_iteration_values, args.device_id )72 runner = benchmark_runner_class(plan, args.local_copy, args.count, args.build_dir, args.output_file, args.platform, args.browser, args.browser_path, args.scale_unit, args.show_iteration_values, args.device_id, args.diagnose_dir) 72 73 runner.execute() 73 74 -
trunk/Tools/Scripts/webkitpy/benchmark_runner/webdriver_benchmark_runner.py
r239522 r246303 27 27 result = WebDriverWait(driver, self._plan['timeout'], poll_frequency=1.0).until(self._get_result) 28 28 driver.quit() 29 except Exception as error: 30 self._browser_driver.diagnose_test_failure(self._diagnose_dir, error) 31 raise error 29 32 finally: 30 33 self._browser_driver.close_browsers() -
trunk/Tools/Scripts/webkitpy/benchmark_runner/webserver_benchmark_runner.py
r239522 r246303 16 16 name = 'webserver' 17 17 18 def __init__(self, plan_file, local_copy, count_override, build_dir, output_file, platform, browser, browser_path, scale_unit=True, show_iteration_values=False, device_id=None ):18 def __init__(self, plan_file, local_copy, count_override, build_dir, output_file, platform, browser, browser_path, scale_unit=True, show_iteration_values=False, device_id=None, diagnose_dir=None): 19 19 self._http_server_driver = HTTPServerDriverFactory.create(platform) 20 20 self._http_server_driver.set_device_id(device_id) 21 super(WebServerBenchmarkRunner, self).__init__(plan_file, local_copy, count_override, build_dir, output_file, platform, browser, browser_path, scale_unit, show_iteration_values, device_id )21 super(WebServerBenchmarkRunner, self).__init__(plan_file, local_copy, count_override, build_dir, output_file, platform, browser, browser_path, scale_unit, show_iteration_values, device_id, diagnose_dir) 22 22 23 23 def _get_result(self, test_url): … … 34 34 with Timeout(self._plan['timeout']): 35 35 result = self._get_result(url) 36 except Exception as error: 37 self._browser_driver.diagnose_test_failure(self._diagnose_dir, error) 38 raise error 36 39 finally: 37 40 self._browser_driver.close_browsers()
Note: See TracChangeset
for help on using the changeset viewer.