Title: [91028] trunk/Tools
Revision
91028
Author
[email protected]
Date
2011-07-14 14:21:24 -0700 (Thu, 14 Jul 2011)

Log Message

NRWT doesn't store the svn revision in full_results.json on chromium-win
https://bugs.webkit.org/show_bug.cgi?id=64492

Unreviewed.  Just fixing my test-webkitpy regression.

Fix the unit tests.  Unfortunately scm does not use a filesystem
object so we can't control the result of detect_scm_system.
When detect_scm_system would fail, we would log, which would
cause all passing_run integration tests to fail.

* Scripts/webkitpy/common/checkout/scm/scm.py:
* Scripts/webkitpy/layout_tests/controllers/manager.py:
* Scripts/webkitpy/layout_tests/port/base.py:
* Scripts/webkitpy/layout_tests/port/test.py:
* Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py:

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (91027 => 91028)


--- trunk/Tools/ChangeLog	2011-07-14 21:16:36 UTC (rev 91027)
+++ trunk/Tools/ChangeLog	2011-07-14 21:21:24 UTC (rev 91028)
@@ -3,6 +3,24 @@
         NRWT doesn't store the svn revision in full_results.json on chromium-win
         https://bugs.webkit.org/show_bug.cgi?id=64492
 
+        Unreviewed.  Just fixing my test-webkitpy regression.
+
+        Fix the unit tests.  Unfortunately scm does not use a filesystem
+        object so we can't control the result of detect_scm_system.
+        When detect_scm_system would fail, we would log, which would
+        cause all passing_run integration tests to fail.
+
+        * Scripts/webkitpy/common/checkout/scm/scm.py:
+        * Scripts/webkitpy/layout_tests/controllers/manager.py:
+        * Scripts/webkitpy/layout_tests/port/base.py:
+        * Scripts/webkitpy/layout_tests/port/test.py:
+        * Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py:
+
+2011-07-14  Eric Seidel  <[email protected]>
+
+        NRWT doesn't store the svn revision in full_results.json on chromium-win
+        https://bugs.webkit.org/show_bug.cgi?id=64492
+
         Reviewed by Ojan Vafai.
 
         This should fix the bug.  Unfortunately this code is currently

Modified: trunk/Tools/Scripts/webkitpy/common/checkout/scm/scm.py (91027 => 91028)


--- trunk/Tools/Scripts/webkitpy/common/checkout/scm/scm.py	2011-07-14 21:16:36 UTC (rev 91027)
+++ trunk/Tools/Scripts/webkitpy/common/checkout/scm/scm.py	2011-07-14 21:21:24 UTC (rev 91028)
@@ -93,8 +93,7 @@
         if self.working_directory_is_clean():
             return
         if not force_clean:
-            # FIXME: Shouldn't this use cwd=self.checkout_root?  (Git definitely would want that, unclear if SVN would.)
-            print self.run(self.status_command(), error_handler=Executive.ignore_error)
+            print self.run(self.status_command(), error_handler=Executive.ignore_error, cwd=self.checkout_root)
             raise ScriptError(message="Working directory has modifications, pass --force-clean or --no-clean to continue.")
         log("Cleaning working directory")
         self.clean_working_directory()

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py (91027 => 91028)


--- trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py	2011-07-14 21:16:36 UTC (rev 91027)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py	2011-07-14 21:21:24 UTC (rev 91028)
@@ -209,9 +209,14 @@
     results['has_wdiff'] = port_obj.wdiff_available()
     results['has_pretty_patch'] = port_obj.pretty_patch_available()
     try:
-        results['revision'] = port_object.webkit_scm().head_svn_revision()
+        results['revision'] = port_obj.webkit_scm().head_svn_revision()
     except Exception, e:
-        _log.warn("Failed to determine svn revision for checkout (cwd: %s), leaving 'revision' key blank in full_results.json.\n%s" % (port_obj._filesystem.getcwd(), e))
+        # FIXME: We would like to warn here, but that would cause all passing_run integration tests
+        # to fail, since they assert that we have no logging output.
+        # The revision lookup always fails when running the tests since it tries to read from
+        # "/mock" using the real file system (since there is no way to mock out detect_scm_system at current).
+        # Once we fix detect_scm_system to use the mock file system we can add this log back.
+        #_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.
         results['revision'] = ""
 

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py (91027 => 91028)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py	2011-07-14 21:16:36 UTC (rev 91027)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py	2011-07-14 21:21:24 UTC (rev 91028)
@@ -37,6 +37,7 @@
 import errno
 import os
 
+from webkitpy.common.checkout.scm import detect_scm_system
 from webkitpy.common.memoized import memoized
 from webkitpy.common.net.testoutputset import AggregateTestOutputSet
 
@@ -607,7 +608,7 @@
         # self._config.webkit_base_dir() knows where the webkit root is, no other
         # object in NRWT seems to keep an SCM around.  (Unlike webkit-patch where it's on the Tool/Host object.)
         # FIXME: We should be able to get the SCM from somewhere else.
-        return scm.detect_scm_system(self._config.webkit_base_dir())
+        return detect_scm_system(self._config.webkit_base_dir())
 
     def path_to_test_expectations_file(self):
         """Update the test expectations to the passed-in string.

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/test.py (91027 => 91028)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/test.py	2011-07-14 21:16:36 UTC (rev 91027)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/test.py	2011-07-14 21:21:24 UTC (rev 91028)
@@ -241,7 +241,7 @@
     # Add in a file should be ignored by test_files.find().
     files[LAYOUT_TEST_DIR + 'userscripts/resources/iframe.html'] = 'iframe'
 
-    fs = filesystem_mock.MockFileSystem(files)
+    fs = filesystem_mock.MockFileSystem(files, dirs=set(['/mock']))  # Make sure at least the checkout_root exists as a directory.
     fs._tests = test_list
     return fs
 

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py (91027 => 91028)


--- trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py	2011-07-14 21:16:36 UTC (rev 91027)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py	2011-07-14 21:21:24 UTC (rev 91028)
@@ -67,8 +67,7 @@
 from webkitpy.thirdparty.mock import Mock
 
 
-def parse_args(extra_args=None, record_results=False, tests_included=False,
-               new_results=False, print_nothing=True):
+def parse_args(extra_args=None, record_results=False, tests_included=False, new_results=False, print_nothing=True):
     extra_args = extra_args or []
     if print_nothing:
         args = ['--print', 'nothing']
@@ -93,17 +92,13 @@
     return run_webkit_tests.parse_args(args)
 
 
-def passing_run(extra_args=None, port_obj=None, record_results=False,
-                tests_included=False, filesystem=None):
-    options, parsed_args = parse_args(extra_args, record_results,
-                                      tests_included)
+def passing_run(extra_args=None, port_obj=None, record_results=False, tests_included=False, filesystem=None):
+    options, parsed_args = parse_args(extra_args, record_results, tests_included)
     if not port_obj:
-        port_obj = port.get(port_name=options.platform, options=options,
-                            user=mocktool.MockUser(), filesystem=filesystem)
+        port_obj = port.get(port_name=options.platform, options=options, user=mocktool.MockUser(), filesystem=filesystem)
     buildbot_output = array_stream.ArrayStream()
     regular_output = array_stream.ArrayStream()
-    res = run_webkit_tests.run(port_obj, options, parsed_args, buildbot_output=buildbot_output,
-                               regular_output=regular_output)
+    res = run_webkit_tests.run(port_obj, options, parsed_args, buildbot_output=buildbot_output, regular_output=regular_output)
     return res == 0 and regular_output.empty() and buildbot_output.empty()
 
 
@@ -114,11 +109,9 @@
                                       print_nothing=False, new_results=new_results)
     user = mocktool.MockUser()
     if not port_obj:
-        port_obj = port.get(port_name=options.platform, options=options,
-                            user=user, filesystem=filesystem)
+        port_obj = port.get(port_name=options.platform, options=options, user=user, filesystem=filesystem)
 
-    res, buildbot_output, regular_output = run_and_capture(port_obj, options,
-                                                           parsed_args)
+    res, buildbot_output, regular_output = run_and_capture(port_obj, options, parsed_args)
     return (res, buildbot_output, regular_output, user)
 
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to