Title: [256851] trunk/Tools
Revision
256851
Author
jlew...@apple.com
Date
2020-02-18 12:17:36 -0800 (Tue, 18 Feb 2020)

Log Message

Stub repositories fail to upload some results due to missing head svn revision
https://bugs.webkit.org/show_bug.cgi?id=207684

Reviewed by Jonathan Bedard.

* Scripts/webkitpy/api_tests/run_api_tests.py:
(main): Added initializing the scm to the host object.
* Scripts/webkitpy/layout_tests/models/test_run_results.py:
(summarize_results): Changed call to head_svn_revision to port.commits_for_upload() to bring
it in line with modern code.
* Scripts/webkitpy/layout_tests/run_webkit_tests.py:
(main): Added inializing the scm to the host object.
* Scripts/webkitpy/port/base.py:
(Port.commits_for_upload): Removed the forced movement up the systems tree that prevented us
from using mock SCMs and more
* Scripts/webkitpy/test/main.py:
(main):  Removed the forced movement up the systems tree, initialized the SCM on the host object,
and converted the webkit_root variable to the SCM checkout root.
(Tester._run_tests):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (256850 => 256851)


--- trunk/Tools/ChangeLog	2020-02-18 20:09:29 UTC (rev 256850)
+++ trunk/Tools/ChangeLog	2020-02-18 20:17:36 UTC (rev 256851)
@@ -1,3 +1,25 @@
+2020-02-18  Matt Lewis  <jlew...@apple.com>
+
+        Stub repositories fail to upload some results due to missing head svn revision
+        https://bugs.webkit.org/show_bug.cgi?id=207684
+
+        Reviewed by Jonathan Bedard.
+
+        * Scripts/webkitpy/api_tests/run_api_tests.py:
+        (main): Added initializing the scm to the host object.
+        * Scripts/webkitpy/layout_tests/models/test_run_results.py:
+        (summarize_results): Changed call to head_svn_revision to port.commits_for_upload() to bring
+        it in line with modern code.
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+        (main): Added inializing the scm to the host object.
+        * Scripts/webkitpy/port/base.py:
+        (Port.commits_for_upload): Removed the forced movement up the systems tree that prevented us
+        from using mock SCMs and more
+        * Scripts/webkitpy/test/main.py:
+        (main):  Removed the forced movement up the systems tree, initialized the SCM on the host object,
+        and converted the webkit_root variable to the SCM checkout root.
+        (Tester._run_tests):
+
 2020-02-18  Per Arne Vollan  <pvol...@apple.com>
 
         Move [UIDevice currentDevice] calls to UI process

Modified: trunk/Tools/Scripts/webkitpy/api_tests/run_api_tests.py (256850 => 256851)


--- trunk/Tools/Scripts/webkitpy/api_tests/run_api_tests.py	2020-02-18 20:09:29 UTC (rev 256850)
+++ trunk/Tools/Scripts/webkitpy/api_tests/run_api_tests.py	2020-02-18 20:17:36 UTC (rev 256851)
@@ -41,6 +41,7 @@
 def main(argv, stdout, stderr):
     options, args = parse_args(argv)
     host = Host()
+    host.initialize_scm()
 
     try:
         options.webkit_test_runner = True

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/models/test_run_results.py (256850 => 256851)


--- trunk/Tools/Scripts/webkitpy/layout_tests/models/test_run_results.py	2020-02-18 20:09:29 UTC (rev 256850)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/models/test_run_results.py	2020-02-18 20:17:36 UTC (rev 256851)
@@ -359,7 +359,7 @@
         # FIXME: Do we really need to populate this both here and in the json_results_generator?
         if port_obj.get_option("builder_name"):
             port_obj.host.initialize_scm()
-            results['revision'] = port_obj.host.scm().head_svn_revision()
+            results['revision'] = port_obj.commits_for_upload()[0]['id']
     except Exception as e:
         _log.warn("Failed to determine svn revision for checkout (cwd: %s, webkit_base: %s), leaving 'revision' key blank in full_results.json.\n%s" % (port_obj._filesystem.getcwd(), port_obj.path_from_webkit_base(), e))
         # Handle cases where we're running outside of version control.

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py (256850 => 256851)


--- trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py	2020-02-18 20:09:29 UTC (rev 256850)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py	2020-02-18 20:17:36 UTC (rev 256851)
@@ -64,6 +64,7 @@
         host = MockHost()
     else:
         host = Host()
+        host.initialize_scm()
 
     if options.lint_test_files:
         from webkitpy.layout_tests.lint_test_expectations import lint

Modified: trunk/Tools/Scripts/webkitpy/port/base.py (256850 => 256851)


--- trunk/Tools/Scripts/webkitpy/port/base.py	2020-02-18 20:09:29 UTC (rev 256850)
+++ trunk/Tools/Scripts/webkitpy/port/base.py	2020-02-18 20:17:36 UTC (rev 256851)
@@ -1601,16 +1601,12 @@
         repos = {}
         if port_config.apple_additions() and getattr(port_config.apple_additions(), 'repos', False):
             repos = port_config.apple_additions().repos()
-
-        up = os.path.dirname
-        repos['webkit'] = up(up(up(up(up(os.path.abspath(__file__))))))
-
+        repos['webkit'] = self.host.scm().checkout_root
         commits = []
         for repo_id, path in repos.items():
-            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),
+                id=self.host.scm().native_revision(path),
+                branch=self.host.scm().native_branch(path),
             ))
         return commits

Modified: trunk/Tools/Scripts/webkitpy/test/main.py (256850 => 256851)


--- trunk/Tools/Scripts/webkitpy/test/main.py	2020-02-18 20:09:29 UTC (rev 256850)
+++ trunk/Tools/Scripts/webkitpy/test/main.py	2020-02-18 20:17:36 UTC (rev 256851)
@@ -50,6 +50,7 @@
 _log = logging.getLogger(__name__)
 
 _host = Host()
+_host.initialize_scm()
 _webkit_root = None
 
 
@@ -57,8 +58,7 @@
     global _webkit_root
     configure_logging(logger=_log)
 
-    up = os.path.dirname
-    _webkit_root = up(up(up(up(up(os.path.abspath(__file__))))))
+    _webkit_root = _host.scm().checkout_root
 
     tester = Tester()
     tester.add_tree(os.path.join(_webkit_root, 'Tools', 'Scripts'), 'webkitpy')
@@ -226,7 +226,6 @@
             for test, failures in test_runner.failures:
                 results[test] = Upload.create_test_result(actual=Upload.Expectations.FAIL, log='/n'.join(failures))
 
-            _host.initialize_scm()
             upload = Upload(
                 suite='webkitpy-tests',
                 configuration=Upload.create_configuration(
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to