Changeset 243732 in webkit
- Timestamp:
- Apr 1, 2019, 7:57:05 PM (7 years ago)
- Location:
- trunk/Tools
- Files:
-
- 11 edited
-
ChangeLog (modified) (1 diff)
-
Scripts/webkitpy/api_tests/manager.py (modified) (6 diffs)
-
Scripts/webkitpy/api_tests/run_api_tests.py (modified) (2 diffs)
-
Scripts/webkitpy/port/base.py (modified) (3 diffs)
-
Scripts/webkitpy/port/device.py (modified) (1 diff)
-
Scripts/webkitpy/port/device_port.py (modified) (3 diffs)
-
Scripts/webkitpy/port/ios_simulator_unittest.py (modified) (2 diffs)
-
Scripts/webkitpy/port/mac.py (modified) (2 diffs)
-
Scripts/webkitpy/port/mac_unittest.py (modified) (2 diffs)
-
Scripts/webkitpy/xcode/simulated_device.py (modified) (3 diffs)
-
Scripts/webkitpy/xcode/simulated_device_unittest.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r243728 r243732 1 2019-04-01 Jonathan Bedard <jbedard@apple.com> 2 3 run-api-tests: Upload test results 4 https://bugs.webkit.org/show_bug.cgi?id=196323 5 <rdar://problem/49356714> 6 7 Reviewed by Lucas Forschler. 8 9 * Scripts/webkitpy/api_tests/manager.py: 10 (Manager): 11 (Manager.run): Upload results to a results database. 12 * Scripts/webkitpy/api_tests/run_api_tests.py: 13 (parse_args): Add upload arguments. 14 * Scripts/webkitpy/port/base.py: 15 (Port): 16 (Port.configuration_for_upload): Creates a configuration dictionary for uploading results. 17 (Port.commits_for_upload): Create a list of commits from the WebKit repository tests are run from along 18 with commits from any other associated repositories. 19 * Scripts/webkitpy/port/device.py: 20 (Device): 21 (Device.build_version): Access build_versoin of underlying platform device. 22 * Scripts/webkitpy/port/ios_simulator_unittest.py: 23 (IOSSimulatorTest): 24 (IOSSimulatorTest.test_configuration_for_upload): 25 * Scripts/webkitpy/port/device_port.py: 26 (DevicePort): 27 (DevicePort.configuration_for_upload): Devices are unique because their configuration is not 28 the same as the machine uploading results. 29 * Scripts/webkitpy/port/mac.py: 30 (MacPort): 31 (MacPort.configuration_for_upload): Define SDK in upload configuration for Mac. 32 * Scripts/webkitpy/port/mac_unittest.py: 33 (MacTest): 34 (MacTest.test_configuration_for_upload): 35 * Scripts/webkitpy/xcode/simulated_device.py: 36 (SimulatedDeviceManager._create_device_with_runtime): 37 (SimulatedDevice.__init__): Create simulated device with a build_version. 38 * Scripts/webkitpy/xcode/simulated_device_unittest.py: 39 (test_existing_simulator): 40 1 41 2019-04-01 Aakash Jain <aakash_jain@apple.com> 2 42 -
trunk/Tools/Scripts/webkitpy/api_tests/manager.py
r240151 r243732 1 # Copyright (C) 2018 Apple Inc. All rights reserved.1 # Copyright (C) 2018-2019 Apple Inc. All rights reserved. 2 2 # 3 3 # Redistribution and use in source and binary forms, with or without … … 23 23 import json 24 24 import logging 25 import os25 import time 26 26 27 27 from webkitpy.api_tests.runner import Runner 28 28 from webkitpy.common.system.executive import ScriptError 29 from webkitpy.results.upload import Upload 30 29 31 from webkitpy.xcode.simulated_device import DeviceRequest, SimulatedDeviceManager 30 32 … … 40 42 FAILED_COLLECT_TESTS = 2 41 43 FAILED_TESTS = 3 44 FAILED_UPLOAD = 4 42 45 43 46 def __init__(self, port, options, stream): … … 155 158 raise RuntimeError('Cannot write to {}'.format(json_output)) 156 159 160 start_time = time.time() 161 157 162 self._stream.write_update('Checking build ...') 158 163 if not self._port.check_api_test_build(self._binaries_for_arguments(args)): … … 186 191 self._stream.writeln('') 187 192 193 end_time = time.time() 194 188 195 successful = runner.result_map_by_status(runner.STATUS_PASSED) 189 196 disabled = len(runner.result_map_by_status(runner.STATUS_DISABLED)) … … 198 205 199 206 self._stream.writeln('-' * 30) 207 result = Manager.SUCCESS 200 208 if len(successful) + disabled == len(test_names): 201 209 self._stream.writeln('All tests successfully passed!') 202 210 if json_output: 203 211 self.host.filesystem.write_text_file(json_output, json.dumps(result_dictionary, indent=4)) 204 return Manager.SUCCESS 205 206 self._stream.writeln('Test suite failed') 207 self._stream.writeln('') 208 209 skipped = [] 210 for test in test_names: 211 if test not in runner.results: 212 skipped.append(test) 213 result_dictionary['Skipped'].append({'name': test, 'output': None}) 214 if skipped: 215 self._stream.writeln('Skipped {} tests'.format(len(skipped))) 212 else: 213 self._stream.writeln('Test suite failed') 216 214 self._stream.writeln('') 217 if self._options.verbose: 218 for test in skipped: 219 self._stream.writeln(' {}'.format(test)) 220 221 self._print_tests_result_with_status(runner.STATUS_FAILED, runner) 222 self._print_tests_result_with_status(runner.STATUS_CRASHED, runner) 223 self._print_tests_result_with_status(runner.STATUS_TIMEOUT, runner) 224 225 for test, result in runner.results.iteritems(): 226 status_to_string = { 227 runner.STATUS_FAILED: 'Failed', 228 runner.STATUS_CRASHED: 'Crashed', 229 runner.STATUS_TIMEOUT: 'Timedout', 230 }.get(result[0]) 231 if not status_to_string: 232 continue 233 result_dictionary[status_to_string].append({'name': test, 'output': result[1]}) 234 235 if json_output: 236 self.host.filesystem.write_text_file(json_output, json.dumps(result_dictionary, indent=4)) 237 238 return Manager.FAILED_TESTS 215 216 skipped = [] 217 for test in test_names: 218 if test not in runner.results: 219 skipped.append(test) 220 result_dictionary['Skipped'].append({'name': test, 'output': None}) 221 if skipped: 222 self._stream.writeln('Skipped {} tests'.format(len(skipped))) 223 self._stream.writeln('') 224 if self._options.verbose: 225 for test in skipped: 226 self._stream.writeln(' {}'.format(test)) 227 228 self._print_tests_result_with_status(runner.STATUS_FAILED, runner) 229 self._print_tests_result_with_status(runner.STATUS_CRASHED, runner) 230 self._print_tests_result_with_status(runner.STATUS_TIMEOUT, runner) 231 232 for test, result in runner.results.iteritems(): 233 status_to_string = { 234 runner.STATUS_FAILED: 'Failed', 235 runner.STATUS_CRASHED: 'Crashed', 236 runner.STATUS_TIMEOUT: 'Timedout', 237 }.get(result[0]) 238 if not status_to_string: 239 continue 240 result_dictionary[status_to_string].append({'name': test, 'output': result[1]}) 241 242 if json_output: 243 self.host.filesystem.write_text_file(json_output, json.dumps(result_dictionary, indent=4)) 244 245 result = Manager.FAILED_TESTS 246 247 if self._options.report_urls: 248 self._stream.writeln('\n') 249 self._stream.write_update('Preparing upload data ...') 250 251 status_to_test_result = { 252 runner.STATUS_PASSED: None, 253 runner.STATUS_FAILED: Upload.Expectations.FAIL, 254 runner.STATUS_CRASHED: Upload.Expectations.CRASH, 255 runner.STATUS_TIMEOUT: Upload.Expectations.TIMEOUT, 256 } 257 upload = Upload( 258 suite='api-tests', 259 configuration=self._port.configuration_for_upload(self._port.target_host(0)), 260 details=Upload.create_details(options=self._options), 261 commits=self._port.commits_for_upload(), 262 run_stats=Upload.create_run_stats( 263 start_time=start_time, 264 end_time=end_time, 265 tests_skipped=len(result_dictionary['Skipped']), 266 ), 267 results={test: Upload.create_test_result(actual=status_to_test_result[result[0]]) 268 for test, result in runner.results.iteritems() if result[0] in status_to_test_result}, 269 ) 270 for url in self._options.report_urls: 271 self._stream.write_update('Uploading to {} ...'.format(url)) 272 if not upload.upload(url, log_line_func=self._stream.writeln): 273 result = Manager.FAILED_UPLOAD 274 self._stream.writeln('Uploads completed!') 275 276 return result -
trunk/Tools/Scripts/webkitpy/api_tests/run_api_tests.py
r235252 r243732 31 31 from webkitpy.layout_tests.views.metered_stream import MeteredStream 32 32 from webkitpy.port import configuration_options, platform_options, base, win 33 from webkitpy.results.options import upload_options 33 34 34 35 EXCEPTIONAL_EXIT_STATUS = -1 … … 135 136 help='Run all tests, even DISABLED tests'), 136 137 ])) 138 option_group_definitions.append(('Upload Options', upload_options())) 137 139 138 140 option_parser = optparse.OptionParser( -
trunk/Tools/Scripts/webkitpy/port/base.py
r243559 r243732 46 46 from webkitpy.common import find_files 47 47 from webkitpy.common import read_checksum_from_png 48 from webkitpy.common.checkout.scm.detection import SCMDetector 48 49 from webkitpy.common.memoized import memoized 49 50 from webkitpy.common.prettypatch import PrettyPatch … … 62 63 from webkitpy.layout_tests.servers import web_platform_test_server 63 64 from webkitpy.layout_tests.servers import websocket_server 65 from webkitpy.results.upload import Upload 64 66 65 67 _log = logging.getLogger(__name__) … … 1635 1637 # such as closing file descriptors that were implicitly cloned to the worker. 1636 1638 pass 1639 1640 def configuration_for_upload(self, host=None): 1641 configuration = self.test_configuration() 1642 host = self.host or host 1643 1644 return Upload.create_configuration( 1645 platform=host.platform.os_name, 1646 version=str(host.platform.os_version), 1647 version_name=host.platform.os_version_name(INTERNAL_TABLE) or host.platform.os_version_name(), 1648 architecture=configuration.architecture, 1649 style='guard-malloc' if self.get_option('guard_malloc') else configuration.build_type, 1650 sdk=host.platform.build_version(), 1651 ) 1652 1653 @memoized 1654 def commits_for_upload(self): 1655 self.host.initialize_scm() 1656 1657 if port_config.apple_additions() and getattr(port_config.apple_additions(), 'repos', False): 1658 repos = port_config.apple_additions().repos() 1659 else: 1660 repos = {} 1661 1662 up = os.path.dirname 1663 repos['webkit'] = up(up(up(up(up(os.path.abspath(__file__)))))) 1664 1665 commits = [] 1666 for repo_id, path in repos.iteritems(): 1667 scm = SCMDetector(self._filesystem, self._executive).detect_scm_system(path) 1668 commits.append(Upload.create_commit( 1669 repository_id=repo_id, 1670 id=scm.native_revision(path), 1671 branch=scm.native_branch(path), 1672 )) 1673 return commits -
trunk/Tools/Scripts/webkitpy/port/device.py
r239945 r243732 102 102 return self.platform_device.device_type 103 103 104 @property 105 def build_version(self): 106 return self.platform_device.build_version 107 104 108 def __nonzero__(self): 105 109 return self.platform_device is not None -
trunk/Tools/Scripts/webkitpy/port/device_port.py
r241147 r243732 1 # Copyright (C) 2018 Apple Inc. All rights reserved.1 # Copyright (C) 2018-2019 Apple Inc. All rights reserved. 2 2 # 3 3 # Redistribution and use in source and binary forms, with or without … … 24 24 import traceback 25 25 26 from webkitpy.common.version_name_map import VersionNameMap, PUBLIC_TABLE, INTERNAL_TABLE 26 27 from webkitpy.layout_tests.models.test_configuration import TestConfiguration 27 28 from webkitpy.port.darwin import DarwinPort 28 29 from webkitpy.port.simulator_process import SimulatorProcess 30 from webkitpy.results.upload import Upload 29 31 from webkitpy.xcode.device_type import DeviceType 30 32 from webkitpy.xcode.simulated_device import DeviceRequest, SimulatedDeviceManager … … 239 241 def device_version(self): 240 242 raise NotImplementedError 243 244 def configuration_for_upload(self, host=None): 245 configuration = self.test_configuration() 246 247 device_type = host.device_type if host else self.DEVICE_TYPE 248 model = device_type.hardware_family 249 if model and device_type.hardware_type: 250 model += ' {}'.format(device_type.hardware_type) 251 252 version = self.device_version() 253 version_name = None 254 for table in [INTERNAL_TABLE, PUBLIC_TABLE]: 255 version_name = VersionNameMap.map(self.host.platform).to_name(version, platform=device_type.software_variant.lower(), table=table) 256 if version_name: 257 break 258 259 return Upload.create_configuration( 260 platform=device_type.software_variant.lower(), 261 is_simulator=self.DEVICE_MANAGER == SimulatedDeviceManager, 262 version=str(version), 263 version_name=version_name, 264 architecture=configuration.architecture, 265 style='guard-malloc' if self.get_option('guard_malloc') else configuration.build_type, 266 model=model, 267 sdk=host.build_version if host else None, 268 ) -
trunk/Tools/Scripts/webkitpy/port/ios_simulator_unittest.py
r239875 r243732 1 # Copyright (C) 2014-201 6Apple Inc. All rights reserved.1 # Copyright (C) 2014-2019 Apple Inc. All rights reserved. 2 2 # 3 3 # Redistribution and use in source and binary forms, with or without … … 162 162 port = self.make_port() 163 163 self.assertEqual(port.max_child_processes(DeviceType.from_string('Apple Watch')), 0) 164 165 def test_configuration_for_upload(self): 166 port = self.make_port() 167 self.assertEqual( 168 dict( 169 platform='ios', 170 is_simulator=True, 171 architecture='x86_64', 172 version='11', 173 version_name='iOS 11', 174 style='release', 175 ), 176 port.configuration_for_upload(), 177 ) -
trunk/Tools/Scripts/webkitpy/port/mac.py
r239989 r243732 1 1 # Copyright (C) 2011 Google Inc. All rights reserved. 2 # Copyright (C) 2012 , 2013, 2016Apple Inc. All rights reserved.2 # Copyright (C) 2012-2019 Apple Inc. All rights reserved. 3 3 # 4 4 # Redistribution and use in source and binary forms, with or without … … 280 280 worthless_patterns.append((re.compile('.*<<< FFR_Common >>>.*\n'), '')) 281 281 return worthless_patterns 282 283 def configuration_for_upload(self, host=None): 284 host = host or self.host 285 configuration = super(MacPort, self).configuration_for_upload(host=host) 286 287 output = host.executive.run_command(['/usr/sbin/sysctl', 'hw.model']).rstrip() 288 match = re.match(r'hw.model: (?P<model>.*)', output) 289 if match: 290 configuration['model'] = match.group('model') 291 292 return configuration -
trunk/Tools/Scripts/webkitpy/port/mac_unittest.py
r232483 r243732 1 1 # Copyright (C) 2010 Google Inc. All rights reserved. 2 # Copyright (C) 2014-201 6Apple Inc. All rights reserved.2 # Copyright (C) 2014-2019 Apple Inc. All rights reserved. 3 3 # 4 4 # Redistribution and use in source and binary forms, with or without … … 225 225 port = self.make_port(options=MockOptions(webkit_test_runner=False), port_name='mac-wk2') 226 226 self.assertEqual(port.driver_name(), 'WebKitTestRunner') 227 228 def test_configuration_for_upload(self): 229 port = self.make_port() 230 self.assertEqual( 231 dict( 232 platform='mac', 233 is_simulator=False, 234 architecture='x86_64', 235 version='10.7', 236 version_name='Lion', 237 sdk='17A405', 238 style='release', 239 ), 240 port.configuration_for_upload(), 241 ) -
trunk/Tools/Scripts/webkitpy/xcode/simulated_device.py
r240022 r243732 114 114 host=host, 115 115 device_type=device_type, 116 build_version=runtime.build_version, 116 117 )) 117 118 SimulatedDeviceManager.AVAILABLE_DEVICES.append(result) … … 489 490 ] 490 491 491 def __init__(self, name, udid, host, device_type ):492 def __init__(self, name, udid, host, device_type, build_version): 492 493 assert device_type.software_version 493 494 … … 495 496 self.udid = udid 496 497 self.device_type = device_type 498 self.build_version = build_version 497 499 self._state = SimulatedDevice.DeviceState.SHUTTING_DOWN 498 500 self._last_updated_state = time.time() -
trunk/Tools/Scripts/webkitpy/xcode/simulated_device_unittest.py
r239945 r243732 606 606 self.assertEquals(1, len(SimulatedDeviceManager.INITIALIZED_DEVICES)) 607 607 self.assertEquals('34FB476C-6FA0-43C8-8945-1BD7A4EBF0DE', SimulatedDeviceManager.INITIALIZED_DEVICES[0].udid) 608 self.assertEquals('15A8401', SimulatedDeviceManager.INITIALIZED_DEVICES[0].build_version) 608 609 self.assertEquals(SimulatedDevice.DeviceState.BOOTED, SimulatedDeviceManager.INITIALIZED_DEVICES[0].platform_device.state()) 609 610
Note:
See TracChangeset
for help on using the changeset viewer.