<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[243748] branches/safari-607-branch/Tools</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/243748">243748</a></dd>
<dt>Author</dt> <dd>kocsen_chung@apple.com</dd>
<dt>Date</dt> <dd>2019-04-02 10:51:06 -0700 (Tue, 02 Apr 2019)</dd>
</dl>

<h3>Log Message</h3>
<pre>Cherry-pick <a href="http://trac.webkit.org/projects/webkit/changeset/243732">r243732</a>. rdar://problem/49356714

    run-api-tests: Upload test results
    https://bugs.webkit.org/show_bug.cgi?id=196323
    <rdar://problem/49356714>

    Reviewed by Lucas Forschler.

    * Scripts/webkitpy/api_tests/manager.py:
    (Manager):
    (Manager.run): Upload results to a results database.
    * Scripts/webkitpy/api_tests/run_api_tests.py:
    (parse_args): Add upload arguments.
    * Scripts/webkitpy/port/base.py:
    (Port):
    (Port.configuration_for_upload): Creates a configuration dictionary for uploading results.
    (Port.commits_for_upload): Create a list of commits from the WebKit repository tests are run from along
    with commits from any other associated repositories.
    * Scripts/webkitpy/port/device.py:
    (Device):
    (Device.build_version): Access build_versoin of underlying platform device.
    * Scripts/webkitpy/port/ios_simulator_unittest.py:
    (IOSSimulatorTest):
    (IOSSimulatorTest.test_configuration_for_upload):
    * Scripts/webkitpy/port/device_port.py:
    (DevicePort):
    (DevicePort.configuration_for_upload): Devices are unique because their configuration is not
    the same as the machine uploading results.
    * Scripts/webkitpy/port/mac.py:
    (MacPort):
    (MacPort.configuration_for_upload): Define SDK in upload configuration for Mac.
    * Scripts/webkitpy/port/mac_unittest.py:
    (MacTest):
    (MacTest.test_configuration_for_upload):
    * Scripts/webkitpy/xcode/simulated_device.py:
    (SimulatedDeviceManager._create_device_with_runtime):
    (SimulatedDevice.__init__): Create simulated device with a build_version.
    * Scripts/webkitpy/xcode/simulated_device_unittest.py:
    (test_existing_simulator):

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243732 268f45cc-cd09-0410-ab3c-d52691b4dbfc</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari607branchToolsChangeLog">branches/safari-607-branch/Tools/ChangeLog</a></li>
<li><a href="#branchessafari607branchToolsScriptswebkitpyapi_testsmanagerpy">branches/safari-607-branch/Tools/Scripts/webkitpy/api_tests/manager.py</a></li>
<li><a href="#branchessafari607branchToolsScriptswebkitpyapi_testsrun_api_testspy">branches/safari-607-branch/Tools/Scripts/webkitpy/api_tests/run_api_tests.py</a></li>
<li><a href="#branchessafari607branchToolsScriptswebkitpyportbasepy">branches/safari-607-branch/Tools/Scripts/webkitpy/port/base.py</a></li>
<li><a href="#branchessafari607branchToolsScriptswebkitpyportdevicepy">branches/safari-607-branch/Tools/Scripts/webkitpy/port/device.py</a></li>
<li><a href="#branchessafari607branchToolsScriptswebkitpyportdevice_portpy">branches/safari-607-branch/Tools/Scripts/webkitpy/port/device_port.py</a></li>
<li><a href="#branchessafari607branchToolsScriptswebkitpyportios_simulator_unittestpy">branches/safari-607-branch/Tools/Scripts/webkitpy/port/ios_simulator_unittest.py</a></li>
<li><a href="#branchessafari607branchToolsScriptswebkitpyportmacpy">branches/safari-607-branch/Tools/Scripts/webkitpy/port/mac.py</a></li>
<li><a href="#branchessafari607branchToolsScriptswebkitpyportmac_unittestpy">branches/safari-607-branch/Tools/Scripts/webkitpy/port/mac_unittest.py</a></li>
<li><a href="#branchessafari607branchToolsScriptswebkitpyxcodesimulated_devicepy">branches/safari-607-branch/Tools/Scripts/webkitpy/xcode/simulated_device.py</a></li>
<li><a href="#branchessafari607branchToolsScriptswebkitpyxcodesimulated_device_unittestpy">branches/safari-607-branch/Tools/Scripts/webkitpy/xcode/simulated_device_unittest.py</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari607branchToolsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-607-branch/Tools/ChangeLog (243747 => 243748)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-607-branch/Tools/ChangeLog       2019-04-02 17:46:07 UTC (rev 243747)
+++ branches/safari-607-branch/Tools/ChangeLog  2019-04-02 17:51:06 UTC (rev 243748)
</span><span class="lines">@@ -1,3 +1,87 @@
</span><ins>+2019-04-02  Kocsen Chung  <kocsen_chung@apple.com>
+
+        Cherry-pick r243732. rdar://problem/49356714
+
+    run-api-tests: Upload test results
+    https://bugs.webkit.org/show_bug.cgi?id=196323
+    <rdar://problem/49356714>
+    
+    Reviewed by Lucas Forschler.
+    
+    * Scripts/webkitpy/api_tests/manager.py:
+    (Manager):
+    (Manager.run): Upload results to a results database.
+    * Scripts/webkitpy/api_tests/run_api_tests.py:
+    (parse_args): Add upload arguments.
+    * Scripts/webkitpy/port/base.py:
+    (Port):
+    (Port.configuration_for_upload): Creates a configuration dictionary for uploading results.
+    (Port.commits_for_upload): Create a list of commits from the WebKit repository tests are run from along
+    with commits from any other associated repositories.
+    * Scripts/webkitpy/port/device.py:
+    (Device):
+    (Device.build_version): Access build_versoin of underlying platform device.
+    * Scripts/webkitpy/port/ios_simulator_unittest.py:
+    (IOSSimulatorTest):
+    (IOSSimulatorTest.test_configuration_for_upload):
+    * Scripts/webkitpy/port/device_port.py:
+    (DevicePort):
+    (DevicePort.configuration_for_upload): Devices are unique because their configuration is not
+    the same as the machine uploading results.
+    * Scripts/webkitpy/port/mac.py:
+    (MacPort):
+    (MacPort.configuration_for_upload): Define SDK in upload configuration for Mac.
+    * Scripts/webkitpy/port/mac_unittest.py:
+    (MacTest):
+    (MacTest.test_configuration_for_upload):
+    * Scripts/webkitpy/xcode/simulated_device.py:
+    (SimulatedDeviceManager._create_device_with_runtime):
+    (SimulatedDevice.__init__): Create simulated device with a build_version.
+    * Scripts/webkitpy/xcode/simulated_device_unittest.py:
+    (test_existing_simulator):
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243732 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-04-01  Jonathan Bedard  <jbedard@apple.com>
+
+            run-api-tests: Upload test results
+            https://bugs.webkit.org/show_bug.cgi?id=196323
+            <rdar://problem/49356714>
+
+            Reviewed by Lucas Forschler.
+
+            * Scripts/webkitpy/api_tests/manager.py:
+            (Manager):
+            (Manager.run): Upload results to a results database.
+            * Scripts/webkitpy/api_tests/run_api_tests.py:
+            (parse_args): Add upload arguments.
+            * Scripts/webkitpy/port/base.py:
+            (Port):
+            (Port.configuration_for_upload): Creates a configuration dictionary for uploading results.
+            (Port.commits_for_upload): Create a list of commits from the WebKit repository tests are run from along
+            with commits from any other associated repositories.
+            * Scripts/webkitpy/port/device.py:
+            (Device):
+            (Device.build_version): Access build_versoin of underlying platform device.
+            * Scripts/webkitpy/port/ios_simulator_unittest.py:
+            (IOSSimulatorTest):
+            (IOSSimulatorTest.test_configuration_for_upload):
+            * Scripts/webkitpy/port/device_port.py:
+            (DevicePort):
+            (DevicePort.configuration_for_upload): Devices are unique because their configuration is not
+            the same as the machine uploading results.
+            * Scripts/webkitpy/port/mac.py:
+            (MacPort):
+            (MacPort.configuration_for_upload): Define SDK in upload configuration for Mac.
+            * Scripts/webkitpy/port/mac_unittest.py:
+            (MacTest):
+            (MacTest.test_configuration_for_upload):
+            * Scripts/webkitpy/xcode/simulated_device.py:
+            (SimulatedDeviceManager._create_device_with_runtime):
+            (SimulatedDevice.__init__): Create simulated device with a build_version.
+            * Scripts/webkitpy/xcode/simulated_device_unittest.py:
+            (test_existing_simulator):
+
</ins><span class="cx"> 2019-03-18  Kocsen Chung  <kocsen_chung@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Cherry-pick r243030. rdar://problem/48896182
</span></span></pre></div>
<a id="branchessafari607branchToolsScriptswebkitpyapi_testsmanagerpy"></a>
<div class="modfile"><h4>Modified: branches/safari-607-branch/Tools/Scripts/webkitpy/api_tests/manager.py (243747 => 243748)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-607-branch/Tools/Scripts/webkitpy/api_tests/manager.py   2019-04-02 17:46:07 UTC (rev 243747)
+++ branches/safari-607-branch/Tools/Scripts/webkitpy/api_tests/manager.py      2019-04-02 17:51:06 UTC (rev 243748)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><del>-# Copyright (C) 2018 Apple Inc. All rights reserved.
</del><ins>+# Copyright (C) 2018-2019 Apple Inc. All rights reserved.
</ins><span class="cx"> #
</span><span class="cx"> # Redistribution and use in source and binary forms, with or without
</span><span class="cx"> # modification, are permitted provided that the following conditions
</span><span class="lines">@@ -22,10 +22,12 @@
</span><span class="cx"> 
</span><span class="cx"> import json
</span><span class="cx"> import logging
</span><del>-import os
</del><ins>+import time
</ins><span class="cx"> 
</span><span class="cx"> from webkitpy.api_tests.runner import Runner
</span><span class="cx"> from webkitpy.common.system.executive import ScriptError
</span><ins>+from webkitpy.results.upload import Upload
+
</ins><span class="cx"> from webkitpy.xcode.simulated_device import DeviceRequest, SimulatedDeviceManager
</span><span class="cx"> 
</span><span class="cx"> _log = logging.getLogger(__name__)
</span><span class="lines">@@ -39,6 +41,7 @@
</span><span class="cx">     FAILED_BUILD_CHECK = 1
</span><span class="cx">     FAILED_COLLECT_TESTS = 2
</span><span class="cx">     FAILED_TESTS = 3
</span><ins>+    FAILED_UPLOAD = 4
</ins><span class="cx"> 
</span><span class="cx">     def __init__(self, port, options, stream):
</span><span class="cx">         self._port = port
</span><span class="lines">@@ -154,6 +157,8 @@
</span><span class="cx">             if not self.host.filesystem.isdir(self.host.filesystem.dirname(json_output)) or self.host.filesystem.isdir(json_output):
</span><span class="cx">                 raise RuntimeError('Cannot write to {}'.format(json_output))
</span><span class="cx"> 
</span><ins>+        start_time = time.time()
+
</ins><span class="cx">         self._stream.write_update('Checking build ...')
</span><span class="cx">         if not self._port.check_api_test_build(self._binaries_for_arguments(args)):
</span><span class="cx">             _log.error('Build check failed')
</span><span class="lines">@@ -185,6 +190,8 @@
</span><span class="cx">             # If we receive a KeyboardInterrupt, print results.
</span><span class="cx">             self._stream.writeln('')
</span><span class="cx"> 
</span><ins>+        end_time = time.time()
+
</ins><span class="cx">         successful = runner.result_map_by_status(runner.STATUS_PASSED)
</span><span class="cx">         disabled = len(runner.result_map_by_status(runner.STATUS_DISABLED))
</span><span class="cx">         _log.info('Ran {} tests of {} with {} successful'.format(len(runner.results) - disabled, len(test_names), len(successful)))
</span><span class="lines">@@ -197,42 +204,73 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         self._stream.writeln('-' * 30)
</span><ins>+        result = Manager.SUCCESS
</ins><span class="cx">         if len(successful) + disabled == len(test_names):
</span><span class="cx">             self._stream.writeln('All tests successfully passed!')
</span><span class="cx">             if json_output:
</span><span class="cx">                 self.host.filesystem.write_text_file(json_output, json.dumps(result_dictionary, indent=4))
</span><del>-            return Manager.SUCCESS
</del><ins>+        else:
+            self._stream.writeln('Test suite failed')
+            self._stream.writeln('')
</ins><span class="cx"> 
</span><del>-        self._stream.writeln('Test suite failed')
-        self._stream.writeln('')
</del><ins>+            skipped = []
+            for test in test_names:
+                if test not in runner.results:
+                    skipped.append(test)
+                    result_dictionary['Skipped'].append({'name': test, 'output': None})
+            if skipped:
+                self._stream.writeln('Skipped {} tests'.format(len(skipped)))
+                self._stream.writeln('')
+                if self._options.verbose:
+                    for test in skipped:
+                        self._stream.writeln('    {}'.format(test))
</ins><span class="cx"> 
</span><del>-        skipped = []
-        for test in test_names:
-            if test not in runner.results:
-                skipped.append(test)
-                result_dictionary['Skipped'].append({'name': test, 'output': None})
-        if skipped:
-            self._stream.writeln('Skipped {} tests'.format(len(skipped)))
-            self._stream.writeln('')
-            if self._options.verbose:
-                for test in skipped:
-                    self._stream.writeln('    {}'.format(test))
</del><ins>+            self._print_tests_result_with_status(runner.STATUS_FAILED, runner)
+            self._print_tests_result_with_status(runner.STATUS_CRASHED, runner)
+            self._print_tests_result_with_status(runner.STATUS_TIMEOUT, runner)
</ins><span class="cx"> 
</span><del>-        self._print_tests_result_with_status(runner.STATUS_FAILED, runner)
-        self._print_tests_result_with_status(runner.STATUS_CRASHED, runner)
-        self._print_tests_result_with_status(runner.STATUS_TIMEOUT, runner)
</del><ins>+            for test, result in runner.results.iteritems():
+                status_to_string = {
+                    runner.STATUS_FAILED: 'Failed',
+                    runner.STATUS_CRASHED: 'Crashed',
+                    runner.STATUS_TIMEOUT: 'Timedout',
+                }.get(result[0])
+                if not status_to_string:
+                    continue
+                result_dictionary[status_to_string].append({'name': test, 'output': result[1]})
</ins><span class="cx"> 
</span><del>-        for test, result in runner.results.iteritems():
-            status_to_string = {
-                runner.STATUS_FAILED: 'Failed',
-                runner.STATUS_CRASHED: 'Crashed',
-                runner.STATUS_TIMEOUT: 'Timedout',
-            }.get(result[0])
-            if not status_to_string:
-                continue
-            result_dictionary[status_to_string].append({'name': test, 'output': result[1]})
</del><ins>+            if json_output:
+                self.host.filesystem.write_text_file(json_output, json.dumps(result_dictionary, indent=4))
</ins><span class="cx"> 
</span><del>-        if json_output:
-            self.host.filesystem.write_text_file(json_output, json.dumps(result_dictionary, indent=4))
</del><ins>+            result = Manager.FAILED_TESTS
</ins><span class="cx"> 
</span><del>-        return Manager.FAILED_TESTS
</del><ins>+        if self._options.report_urls:
+            self._stream.writeln('\n')
+            self._stream.write_update('Preparing upload data ...')
+
+            status_to_test_result = {
+                runner.STATUS_PASSED: None,
+                runner.STATUS_FAILED: Upload.Expectations.FAIL,
+                runner.STATUS_CRASHED: Upload.Expectations.CRASH,
+                runner.STATUS_TIMEOUT: Upload.Expectations.TIMEOUT,
+            }
+            upload = Upload(
+                suite='api-tests',
+                configuration=self._port.configuration_for_upload(self._port.target_host(0)),
+                details=Upload.create_details(options=self._options),
+                commits=self._port.commits_for_upload(),
+                run_stats=Upload.create_run_stats(
+                    start_time=start_time,
+                    end_time=end_time,
+                    tests_skipped=len(result_dictionary['Skipped']),
+                ),
+                results={test: Upload.create_test_result(actual=status_to_test_result[result[0]])
+                         for test, result in runner.results.iteritems() if result[0] in status_to_test_result},
+            )
+            for url in self._options.report_urls:
+                self._stream.write_update('Uploading to {} ...'.format(url))
+                if not upload.upload(url, log_line_func=self._stream.writeln):
+                    result = Manager.FAILED_UPLOAD
+            self._stream.writeln('Uploads completed!')
+
+        return result
</ins></span></pre></div>
<a id="branchessafari607branchToolsScriptswebkitpyapi_testsrun_api_testspy"></a>
<div class="modfile"><h4>Modified: branches/safari-607-branch/Tools/Scripts/webkitpy/api_tests/run_api_tests.py (243747 => 243748)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-607-branch/Tools/Scripts/webkitpy/api_tests/run_api_tests.py     2019-04-02 17:46:07 UTC (rev 243747)
+++ branches/safari-607-branch/Tools/Scripts/webkitpy/api_tests/run_api_tests.py        2019-04-02 17:51:06 UTC (rev 243748)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> from webkitpy.common.host import Host
</span><span class="cx"> from webkitpy.layout_tests.views.metered_stream import MeteredStream
</span><span class="cx"> from webkitpy.port import configuration_options, platform_options, base, win
</span><ins>+from webkitpy.results.options import upload_options
</ins><span class="cx"> 
</span><span class="cx"> EXCEPTIONAL_EXIT_STATUS = -1
</span><span class="cx"> INTERRUPT_EXIT_STATUS = -2
</span><span class="lines">@@ -134,6 +135,7 @@
</span><span class="cx">         optparse.make_option('--force', action='store_true', default=False,
</span><span class="cx">                              help='Run all tests, even DISABLED tests'),
</span><span class="cx">     ]))
</span><ins>+    option_group_definitions.append(('Upload Options', upload_options()))
</ins><span class="cx"> 
</span><span class="cx">     option_parser = optparse.OptionParser(
</span><span class="cx">         usage='run-api-tests [options] [<test names>...]',
</span></span></pre></div>
<a id="branchessafari607branchToolsScriptswebkitpyportbasepy"></a>
<div class="modfile"><h4>Modified: branches/safari-607-branch/Tools/Scripts/webkitpy/port/base.py (243747 => 243748)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-607-branch/Tools/Scripts/webkitpy/port/base.py   2019-04-02 17:46:07 UTC (rev 243747)
+++ branches/safari-607-branch/Tools/Scripts/webkitpy/port/base.py      2019-04-02 17:51:06 UTC (rev 243748)
</span><span class="lines">@@ -45,6 +45,7 @@
</span><span class="cx"> 
</span><span class="cx"> from webkitpy.common import find_files
</span><span class="cx"> from webkitpy.common import read_checksum_from_png
</span><ins>+from webkitpy.common.checkout.scm.detection import SCMDetector
</ins><span class="cx"> from webkitpy.common.memoized import memoized
</span><span class="cx"> from webkitpy.common.prettypatch import PrettyPatch
</span><span class="cx"> from webkitpy.common.system import path, pemfile
</span><span class="lines">@@ -61,6 +62,7 @@
</span><span class="cx"> from webkitpy.layout_tests.servers import apache_http_server, http_server, http_server_base
</span><span class="cx"> from webkitpy.layout_tests.servers import web_platform_test_server
</span><span class="cx"> from webkitpy.layout_tests.servers import websocket_server
</span><ins>+from webkitpy.results.upload import Upload
</ins><span class="cx"> 
</span><span class="cx"> _log = logging.getLogger(__name__)
</span><span class="cx"> 
</span><span class="lines">@@ -1628,3 +1630,38 @@
</span><span class="cx">         # This is overridden by ports that need to do work in the parent process after a worker subprocess is spawned,
</span><span class="cx">         # such as closing file descriptors that were implicitly cloned to the worker.
</span><span class="cx">         pass
</span><ins>+
+    def configuration_for_upload(self, host=None):
+        configuration = self.test_configuration()
+        host = self.host or host
+
+        return Upload.create_configuration(
+            platform=host.platform.os_name,
+            version=str(host.platform.os_version),
+            version_name=host.platform.os_version_name(INTERNAL_TABLE) or host.platform.os_version_name(),
+            architecture=configuration.architecture,
+            style='guard-malloc' if self.get_option('guard_malloc') else configuration.build_type,
+            sdk=host.platform.build_version(),
+        )
+
+    @memoized
+    def commits_for_upload(self):
+        self.host.initialize_scm()
+
+        if port_config.apple_additions() and getattr(port_config.apple_additions(), 'repos', False):
+            repos = port_config.apple_additions().repos()
+        else:
+            repos = {}
+
+        up = os.path.dirname
+        repos['webkit'] = up(up(up(up(up(os.path.abspath(__file__))))))
+
+        commits = []
+        for repo_id, path in repos.iteritems():
+            scm = SCMDetector(self._filesystem, self._executive).detect_scm_system(path)
+            commits.append(Upload.create_commit(
+                repository_id=repo_id,
+                id=scm.native_revision(path),
+                branch=scm.native_branch(path),
+            ))
+        return commits
</ins></span></pre></div>
<a id="branchessafari607branchToolsScriptswebkitpyportdevicepy"></a>
<div class="modfile"><h4>Modified: branches/safari-607-branch/Tools/Scripts/webkitpy/port/device.py (243747 => 243748)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-607-branch/Tools/Scripts/webkitpy/port/device.py 2019-04-02 17:46:07 UTC (rev 243747)
+++ branches/safari-607-branch/Tools/Scripts/webkitpy/port/device.py    2019-04-02 17:51:06 UTC (rev 243748)
</span><span class="lines">@@ -97,6 +97,14 @@
</span><span class="cx">     def udid(self):
</span><span class="cx">         return self.platform_device.udid
</span><span class="cx"> 
</span><ins>+    @property
+    def device_type(self):
+        return self.platform_device.device_type
+
+    @property
+    def build_version(self):
+        return self.platform_device.build_version
+
</ins><span class="cx">     def __nonzero__(self):
</span><span class="cx">         return self.platform_device is not None
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari607branchToolsScriptswebkitpyportdevice_portpy"></a>
<div class="modfile"><h4>Modified: branches/safari-607-branch/Tools/Scripts/webkitpy/port/device_port.py (243747 => 243748)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-607-branch/Tools/Scripts/webkitpy/port/device_port.py    2019-04-02 17:46:07 UTC (rev 243747)
+++ branches/safari-607-branch/Tools/Scripts/webkitpy/port/device_port.py       2019-04-02 17:51:06 UTC (rev 243748)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><del>-# Copyright (C) 2018 Apple Inc. All rights reserved.
</del><ins>+# Copyright (C) 2018-2019 Apple Inc. All rights reserved.
</ins><span class="cx"> #
</span><span class="cx"> # Redistribution and use in source and binary forms, with or without
</span><span class="cx"> # modification, are permitted provided that the following conditions
</span><span class="lines">@@ -23,9 +23,11 @@
</span><span class="cx"> import logging
</span><span class="cx"> import traceback
</span><span class="cx"> 
</span><ins>+from webkitpy.common.version_name_map import VersionNameMap, PUBLIC_TABLE, INTERNAL_TABLE
</ins><span class="cx"> from webkitpy.layout_tests.models.test_configuration import TestConfiguration
</span><span class="cx"> from webkitpy.port.darwin import DarwinPort
</span><span class="cx"> from webkitpy.port.simulator_process import SimulatorProcess
</span><ins>+from webkitpy.results.upload import Upload
</ins><span class="cx"> from webkitpy.xcode.device_type import DeviceType
</span><span class="cx"> from webkitpy.xcode.simulated_device import DeviceRequest, SimulatedDeviceManager
</span><span class="cx"> 
</span><span class="lines">@@ -222,3 +224,29 @@
</span><span class="cx"> 
</span><span class="cx">     def device_version(self):
</span><span class="cx">         raise NotImplementedError
</span><ins>+
+    def configuration_for_upload(self, host=None):
+        configuration = self.test_configuration()
+
+        device_type = host.device_type if host else self.DEVICE_TYPE
+        model = device_type.hardware_family
+        if model and device_type.hardware_type:
+            model += ' {}'.format(device_type.hardware_type)
+
+        version = self.device_version()
+        version_name = None
+        for table in [INTERNAL_TABLE, PUBLIC_TABLE]:
+            version_name = VersionNameMap.map(self.host.platform).to_name(version, platform=device_type.software_variant.lower(), table=table)
+            if version_name:
+                break
+
+        return Upload.create_configuration(
+            platform=device_type.software_variant.lower(),
+            is_simulator=self.DEVICE_MANAGER == SimulatedDeviceManager,
+            version=str(version),
+            version_name=version_name,
+            architecture=configuration.architecture,
+            style='guard-malloc' if self.get_option('guard_malloc') else configuration.build_type,
+            model=model,
+            sdk=host.build_version if host else None,
+        )
</ins></span></pre></div>
<a id="branchessafari607branchToolsScriptswebkitpyportios_simulator_unittestpy"></a>
<div class="modfile"><h4>Modified: branches/safari-607-branch/Tools/Scripts/webkitpy/port/ios_simulator_unittest.py (243747 => 243748)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-607-branch/Tools/Scripts/webkitpy/port/ios_simulator_unittest.py 2019-04-02 17:46:07 UTC (rev 243747)
+++ branches/safari-607-branch/Tools/Scripts/webkitpy/port/ios_simulator_unittest.py    2019-04-02 17:51:06 UTC (rev 243748)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><del>-# Copyright (C) 2014-2016 Apple Inc. All rights reserved.
</del><ins>+# Copyright (C) 2014-2019 Apple Inc. All rights reserved.
</ins><span class="cx"> #
</span><span class="cx"> # Redistribution and use in source and binary forms, with or without
</span><span class="cx"> # modification, are permitted provided that the following conditions
</span><span class="lines">@@ -120,3 +120,17 @@
</span><span class="cx">     def test_max_child_processes(self):
</span><span class="cx">         port = self.make_port()
</span><span class="cx">         self.assertEqual(port.max_child_processes(DeviceType.from_string('Apple Watch')), 0)
</span><ins>+
+    def test_configuration_for_upload(self):
+        port = self.make_port()
+        self.assertEqual(
+            dict(
+                platform='ios',
+                is_simulator=True,
+                architecture='x86_64',
+                version='11',
+                version_name='iOS 11',
+                style='release',
+            ),
+            port.configuration_for_upload(),
+        )
</ins></span></pre></div>
<a id="branchessafari607branchToolsScriptswebkitpyportmacpy"></a>
<div class="modfile"><h4>Modified: branches/safari-607-branch/Tools/Scripts/webkitpy/port/mac.py (243747 => 243748)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-607-branch/Tools/Scripts/webkitpy/port/mac.py    2019-04-02 17:46:07 UTC (rev 243747)
+++ branches/safari-607-branch/Tools/Scripts/webkitpy/port/mac.py       2019-04-02 17:51:06 UTC (rev 243748)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> # Copyright (C) 2011 Google Inc. All rights reserved.
</span><del>-# Copyright (C) 2012, 2013, 2016 Apple Inc. All rights reserved.
</del><ins>+# Copyright (C) 2012-2019 Apple Inc. All rights reserved.
</ins><span class="cx"> #
</span><span class="cx"> # Redistribution and use in source and binary forms, with or without
</span><span class="cx"> # modification, are permitted provided that the following conditions are
</span><span class="lines">@@ -280,3 +280,14 @@
</span><span class="cx">         worthless_patterns.append((re.compile('.*<<<< VMC >>>>.*\n'), ''))
</span><span class="cx">         worthless_patterns.append((re.compile('.*<<< FFR_Common >>>.*\n'), ''))
</span><span class="cx">         return worthless_patterns
</span><ins>+
+    def configuration_for_upload(self, host=None):
+        host = host or self.host
+        configuration = super(MacPort, self).configuration_for_upload(host=host)
+
+        output = host.executive.run_command(['/usr/sbin/sysctl', 'hw.model']).rstrip()
+        match = re.match(r'hw.model: (?P<model>.*)', output)
+        if match:
+            configuration['model'] = match.group('model')
+
+        return configuration
</ins></span></pre></div>
<a id="branchessafari607branchToolsScriptswebkitpyportmac_unittestpy"></a>
<div class="modfile"><h4>Modified: branches/safari-607-branch/Tools/Scripts/webkitpy/port/mac_unittest.py (243747 => 243748)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-607-branch/Tools/Scripts/webkitpy/port/mac_unittest.py   2019-04-02 17:46:07 UTC (rev 243747)
+++ branches/safari-607-branch/Tools/Scripts/webkitpy/port/mac_unittest.py      2019-04-02 17:51:06 UTC (rev 243748)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> # Copyright (C) 2010 Google Inc. All rights reserved.
</span><del>-# Copyright (C) 2014-2016 Apple Inc. All rights reserved.
</del><ins>+# Copyright (C) 2014-2019 Apple Inc. All rights reserved.
</ins><span class="cx"> #
</span><span class="cx"> # Redistribution and use in source and binary forms, with or without
</span><span class="cx"> # modification, are permitted provided that the following conditions are
</span><span class="lines">@@ -224,3 +224,18 @@
</span><span class="cx"> 
</span><span class="cx">         port = self.make_port(options=MockOptions(webkit_test_runner=False), port_name='mac-wk2')
</span><span class="cx">         self.assertEqual(port.driver_name(), 'WebKitTestRunner')
</span><ins>+
+    def test_configuration_for_upload(self):
+        port = self.make_port()
+        self.assertEqual(
+            dict(
+                platform='mac',
+                is_simulator=False,
+                architecture='x86_64',
+                version='10.7',
+                version_name='Lion',
+                sdk='17A405',
+                style='release',
+            ),
+            port.configuration_for_upload(),
+        )
</ins></span></pre></div>
<a id="branchessafari607branchToolsScriptswebkitpyxcodesimulated_devicepy"></a>
<div class="modfile"><h4>Modified: branches/safari-607-branch/Tools/Scripts/webkitpy/xcode/simulated_device.py (243747 => 243748)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-607-branch/Tools/Scripts/webkitpy/xcode/simulated_device.py      2019-04-02 17:46:07 UTC (rev 243747)
+++ branches/safari-607-branch/Tools/Scripts/webkitpy/xcode/simulated_device.py 2019-04-02 17:51:06 UTC (rev 243748)
</span><span class="lines">@@ -113,6 +113,7 @@
</span><span class="cx">             udid=device_info['udid'],
</span><span class="cx">             host=host,
</span><span class="cx">             device_type=device_type,
</span><ins>+            build_version=runtime.build_version,
</ins><span class="cx">         ))
</span><span class="cx">         SimulatedDeviceManager.AVAILABLE_DEVICES.append(result)
</span><span class="cx">         return result
</span><span class="lines">@@ -488,12 +489,13 @@
</span><span class="cx">         'SHUTTING DOWN',
</span><span class="cx">     ]
</span><span class="cx"> 
</span><del>-    def __init__(self, name, udid, host, device_type):
</del><ins>+    def __init__(self, name, udid, host, device_type, build_version):
</ins><span class="cx">         assert device_type.software_version
</span><span class="cx"> 
</span><span class="cx">         self.name = name
</span><span class="cx">         self.udid = udid
</span><span class="cx">         self.device_type = device_type
</span><ins>+        self.build_version = build_version
</ins><span class="cx">         self._state = SimulatedDevice.DeviceState.SHUTTING_DOWN
</span><span class="cx">         self._last_updated_state = time.time()
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari607branchToolsScriptswebkitpyxcodesimulated_device_unittestpy"></a>
<div class="modfile"><h4>Modified: branches/safari-607-branch/Tools/Scripts/webkitpy/xcode/simulated_device_unittest.py (243747 => 243748)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-607-branch/Tools/Scripts/webkitpy/xcode/simulated_device_unittest.py     2019-04-02 17:46:07 UTC (rev 243747)
+++ branches/safari-607-branch/Tools/Scripts/webkitpy/xcode/simulated_device_unittest.py        2019-04-02 17:51:06 UTC (rev 243748)
</span><span class="lines">@@ -605,6 +605,7 @@
</span><span class="cx"> 
</span><span class="cx">         self.assertEquals(1, len(SimulatedDeviceManager.INITIALIZED_DEVICES))
</span><span class="cx">         self.assertEquals('34FB476C-6FA0-43C8-8945-1BD7A4EBF0DE', SimulatedDeviceManager.INITIALIZED_DEVICES[0].udid)
</span><ins>+        self.assertEquals('15A8401', SimulatedDeviceManager.INITIALIZED_DEVICES[0].build_version)
</ins><span class="cx">         self.assertEquals(SimulatedDevice.DeviceState.BOOTED, SimulatedDeviceManager.INITIALIZED_DEVICES[0].platform_device.state())
</span><span class="cx"> 
</span><span class="cx">         SimulatedDeviceManager.tear_down(host)
</span></span></pre>
</div>
</div>

</body>
</html>