2011-01-19 Dirk Pranke <dpranke@chromium.org>
authordpranke@chromium.org <dpranke@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Jan 2011 03:55:02 +0000 (03:55 +0000)
committerdpranke@chromium.org <dpranke@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Jan 2011 03:55:02 +0000 (03:55 +0000)
        Unreviewed, build fix.

        Fix a couple of minor bugs discovered while bringing up new bots
        for testing.

        * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76199 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/Scripts/webkitpy/common/system/filesystem.py
Tools/Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py
Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py

index 67fb18abe8c54d32e78576ca2f464e863d80520b..4ff749e6e56a115a1cc439c48a446958c30090ab 100644 (file)
@@ -1,3 +1,13 @@
+2011-01-19  Dirk Pranke  <dpranke@chromium.org>
+
+        Unreviewed, build fix.
+
+        Fix a couple of minor bugs discovered while bringing up new bots
+        for testing.
+
+        * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
 2011-01-19  James Robinson  <jamesr@chromium.org>
 
         Unreviewed, rolling out r76194.
index d75276eb3b35fb8ab9eeb794e3592363fef6d459..05513a957c8519f1217ebedeb2d3adcb378b9148 100644 (file)
@@ -185,7 +185,7 @@ class FileSystem(object):
         """Returns a file handle suitable for writing to."""
         mode = 'w'
         if append:
-            mode = 'wa'
+            mode = 'a'
         return codecs.open(path, mode, 'utf8')
 
     def read_binary_file(self, path):
index bd52e652da69dd13d82de1ae2fdaee34b1c88d6b..050eefae1b18ec2b1628da75f261488d0f2ac3a5 100644 (file)
@@ -384,8 +384,7 @@ class TestShellThread(WatchableThread):
         # This is created in run_webkit_tests.py:_PrepareListsAndPrintOutput.
         tests_run_filename = self._port._filesystem.join(self._options.results_directory,
                                           "tests_run.txt")
-        tests_run_file = self._port._filesystem.open_text_file_for_writing(tests_run_filename, append=True)
-
+        tests_run_file = self._port._filesystem.open_text_file_for_writing(tests_run_filename, append=False)
         while True:
             if self._canceled:
                 _log.debug('Testing cancelled')
index dcdcfaa33e7f706c39a3662b5167cdfcbf4440d1..c801fd17a1d49635adb5aa4c0da37082f738bef2 100755 (executable)
@@ -80,7 +80,7 @@ def run(port, options, args, regular_output=sys.stderr,
         printer.cleanup()
         return 0
 
-    last_unexpected_results = _gather_unexpected_results(options)
+    last_unexpected_results = _gather_unexpected_results(port, options)
     if options.print_last_failures:
         printer.write("\n".join(last_unexpected_results) + "\n")
         printer.cleanup()
@@ -162,15 +162,16 @@ def _set_up_derived_options(port_obj, options):
     return warnings
 
 
-def _gather_unexpected_results(options):
+def _gather_unexpected_results(port, options):
     """Returns the unexpected results from the previous run, if any."""
     last_unexpected_results = []
     if options.print_last_failures or options.retest_last_failures:
         unexpected_results_filename = os.path.join(
         options.results_directory, "unexpected_results.json")
-        with codecs.open(unexpected_results_filename, "r", "utf-8") as file:
+        if port._filesystem.exists(unexpected_results_filename):
+            file = port._filesystem.read_text_file(unexpected_results.json)
             results = simplejson.load(file)
-        last_unexpected_results = results['tests'].keys()
+            last_unexpected_results = results['tests'].keys()
     return last_unexpected_results