Title: [98062] trunk/Tools
Revision
98062
Author
rn...@webkit.org
Date
2011-10-20 20:35:50 -0700 (Thu, 20 Oct 2011)

Log Message

nrwt: newly generated results are put in cross-platform directory
https://bugs.webkit.org/show_bug.cgi?id=68931

Reviewed by Dirk Pranke.

The bug was caused by SingleTestRunner._add_missing_baselines's always calling _save_baseline_data
with generate_new_baseline set to False. Fixed the bug by always passing True when .png file is missing
(because png images are typically different on each platform), and passing True when .txt file is missing
and the actual result's first line matches the regular _expression_ "layer at \(\d+,\d+\) size \d+x\d+".

* Scripts/webkitpy/layout_tests/controllers/single_test_runner.py:
* Scripts/webkitpy/layout_tests/port/test.py:
* Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py: Changed the expectation
and added a test case.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (98061 => 98062)


--- trunk/Tools/ChangeLog	2011-10-21 03:29:25 UTC (rev 98061)
+++ trunk/Tools/ChangeLog	2011-10-21 03:35:50 UTC (rev 98062)
@@ -1,3 +1,20 @@
+2011-10-20  Ryosuke Niwa  <rn...@webkit.org>
+
+        nrwt: newly generated results are put in cross-platform directory
+        https://bugs.webkit.org/show_bug.cgi?id=68931
+
+        Reviewed by Dirk Pranke.
+
+        The bug was caused by SingleTestRunner._add_missing_baselines's always calling _save_baseline_data
+        with generate_new_baseline set to False. Fixed the bug by always passing True when .png file is missing
+        (because png images are typically different on each platform), and passing True when .txt file is missing
+        and the actual result's first line matches the regular _expression_ "layer at \(\d+,\d+\) size \d+x\d+".
+
+        * Scripts/webkitpy/layout_tests/controllers/single_test_runner.py:
+        * Scripts/webkitpy/layout_tests/port/test.py:
+        * Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py: Changed the expectation
+        and added a test case.
+
 2011-10-20  Kent Tamura  <tk...@chromium.org>
 
         Unreviewed. Adding myself to watchlist.

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/controllers/single_test_runner.py (98061 => 98062)


--- trunk/Tools/Scripts/webkitpy/layout_tests/controllers/single_test_runner.py	2011-10-21 03:29:25 UTC (rev 98061)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/controllers/single_test_runner.py	2011-10-21 03:35:50 UTC (rev 98062)
@@ -28,6 +28,7 @@
 
 
 import logging
+import re
 import time
 
 from webkitpy.layout_tests.layout_package import test_result_writer
@@ -141,17 +142,16 @@
         self._overwrite_baselines(driver_output)
         return TestResult(self._test_name, failures, driver_output.test_time, driver_output.has_stderr())
 
+    _render_tree_dump_pattern = re.compile(r"^layer at \(\d+,\d+\) size \d+x\d+\n")
+
     def _add_missing_baselines(self, test_result, driver_output):
+        missingImage = test_result.has_failure_matching_types(test_failures.FailureMissingImage, test_failures.FailureMissingImageHash)
         if test_result.has_failure_matching_types(test_failures.FailureMissingResult):
-            # FIXME: We seem to be putting new text results in non-platform
-            # specific directories even when they're rendertree dumps. Maybe
-            # we should have a different kind of failure for render tree dumps
-            # than for text tests?
-            self._save_baseline_data(driver_output.text, ".txt", generate_new_baseline=False)
+            self._save_baseline_data(driver_output.text, ".txt", SingleTestRunner._render_tree_dump_pattern.match(driver_output.text))
         if test_result.has_failure_matching_types(test_failures.FailureMissingAudio):
             self._save_baseline_data(driver_output.audio, ".wav", generate_new_baseline=False)
-        if test_result.has_failure_matching_types(test_failures.FailureMissingImage, test_failures.FailureMissingImageHash):
-            self._save_baseline_data(driver_output.image, ".png", generate_new_baseline=False)
+        if missingImage:
+            self._save_baseline_data(driver_output.image, ".png", generate_new_baseline=True)
 
     def _overwrite_baselines(self, driver_output):
         # Although all DumpRenderTree output should be utf-8,
@@ -182,8 +182,7 @@
             relative_dir = fs.dirname(self._test_name)
             baseline_path = port.baseline_path()
             output_dir = fs.join(baseline_path, relative_dir)
-            output_file = fs.basename(fs.splitext(self._test_name)[0] +
-                "-expected" + modifier)
+            output_file = fs.basename(fs.splitext(self._test_name)[0] + "-expected" + modifier)
             fs.maybe_make_directory(output_dir)
             output_path = fs.join(output_dir, output_file)
         else:

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


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/test.py	2011-10-21 03:29:25 UTC (rev 98061)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/test.py	2011-10-21 03:35:50 UTC (rev 98062)
@@ -139,6 +139,14 @@
     tests.add('failures/expected/text.html', actual_text='text_fail-png')
     tests.add('failures/unexpected/missing_text.html', expected_text=None)
     tests.add('failures/unexpected/missing_image.html', expected_image=None)
+    tests.add('failures/unexpected/missing_render_tree_dump.html', actual_text="""layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x34
+  RenderBlock {HTML} at (0,0) size 800x34
+    RenderBody {BODY} at (8,8) size 784x18
+      RenderText {#text} at (0,0) size 133x18
+        text run at (0,0) width 133: "This is an image test!"
+""", expected_text=None)
     tests.add('failures/unexpected/crash.html', crash=True)
     tests.add('failures/unexpected/crash-with-stderr.html', crash=True,
               error="mock-std-error-output")

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py (98061 => 98062)


--- trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py	2011-10-21 03:29:25 UTC (rev 98061)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py	2011-10-21 03:35:50 UTC (rev 98062)
@@ -774,15 +774,17 @@
         res, out, err, _ = logging_run(['--no-show-results',
                      'failures/unexpected/missing_text.html',
                      'failures/unexpected/missing_image.html',
-                     'failures/unexpected/missing_audio.html'],
+                     'failures/unexpected/missing_audio.html',
+                     'failures/unexpected/missing_render_tree_dump.html'],
                      tests_included=True, filesystem=fs, new_results=True)
         file_list = fs.written_files.keys()
         file_list.remove('/tmp/layout-test-results/tests_run0.txt')
         self.assertEquals(res, 0)
         self.assertFalse(out.empty())
-        self.assertEqual(len(file_list), 4)
+        self.assertEqual(len(file_list), 6)
         self.assertBaselines(file_list, "/failures/unexpected/missing_text", [".txt"], err)
-        self.assertBaselines(file_list, "/failures/unexpected/missing_image", [".png"], err)
+        self.assertBaselines(file_list, "/platform/test-mac-leopard/failures/unexpected/missing_image", [".png"], err)
+        self.assertBaselines(file_list, "/platform/test-mac-leopard/failures/unexpected/missing_render_tree_dump", [".txt"], err)
 
     def test_new_baseline(self):
         # Test that we update the platform expectations. If the expectation
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to