run-webkit-tests should not truncate persistent lines
authorap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Nov 2015 06:27:09 +0000 (06:27 +0000)
committerap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Nov 2015 06:27:09 +0000 (06:27 +0000)
https://bugs.webkit.org/show_bug.cgi?id=151376
rdar://problem/23162775

Reviewed by Antti Koivisto.

It is OK to truncate progress lines, but it's not OK to truncate error (or otherwise
unexpected result) messages that remain on the screen to be read. In practice, this
almost always truncates the test path, which is important to see.

* Scripts/webkitpy/layout_tests/views/printing.py:
(Printer._test_status_line):
(Printer.print_finished_test):
* Scripts/webkitpy/layout_tests/views/printing_unittest.py:
(Testprinter.test_test_status_line):

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

Tools/ChangeLog
Tools/Scripts/webkitpy/layout_tests/views/printing.py
Tools/Scripts/webkitpy/layout_tests/views/printing_unittest.py

index 2c1ff2c..c8b142b 100644 (file)
@@ -1,3 +1,21 @@
+2015-11-17  Alexey Proskuryakov  <ap@apple.com>
+
+        run-webkit-tests should not truncate persistent lines
+        https://bugs.webkit.org/show_bug.cgi?id=151376
+        rdar://problem/23162775
+
+        Reviewed by Antti Koivisto.
+
+        It is OK to truncate progress lines, but it's not OK to truncate error (or otherwise
+        unexpected result) messages that remain on the screen to be read. In practice, this
+        almost always truncates the test path, which is important to see.
+
+        * Scripts/webkitpy/layout_tests/views/printing.py:
+        (Printer._test_status_line):
+        (Printer.print_finished_test):
+        * Scripts/webkitpy/layout_tests/views/printing_unittest.py:
+        (Testprinter.test_test_status_line):
+
 2015-11-16  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         Unreviewed. Fix GTK+ unit tests after r192469.
index 1c652c7..a1efb3c 100644 (file)
@@ -287,10 +287,10 @@ class Printer(object):
         self._print_quiet(summary)
         self._print_quiet("")
 
-    def _test_status_line(self, test_name, suffix):
+    def _test_status_line(self, test_name, suffix, truncate=True):
         format_string = '[%d/%d] %s%s'
         status_line = format_string % (self.num_started, self.num_tests, test_name, suffix)
-        if len(status_line) > self._meter.number_of_columns():
+        if truncate and len(status_line) > self._meter.number_of_columns():
             overflow_columns = len(status_line) - self._meter.number_of_columns()
             ellipsis = '...'
             if len(test_name) < overflow_columns + len(ellipsis) + 2:
@@ -324,7 +324,7 @@ class Printer(object):
         if self._options.details:
             self._print_test_trace(result, exp_str, got_str)
         elif (self._options.verbose and not self._options.debug_rwt_logging) or not expected:
-            self.writeln(self._test_status_line(test_name, result_message))
+            self.writeln(self._test_status_line(test_name, result_message, truncate=False))
         elif self.num_started == self.num_tests:
             self._meter.write_update('')
         else:
@@ -334,7 +334,7 @@ class Printer(object):
                 self._completed_tests.append([test_name, result_message])
 
             for test_name, result_message in self._completed_tests:
-                self._meter.write_throttled_update(self._test_status_line(test_name, result_message))
+                self._meter.write_throttled_update(self._test_status_line(test_name, result_message, truncate=False))
             self._completed_tests = []
         self._running_tests.remove(test_name)
 
index 562bddc..10f64a1 100644 (file)
@@ -150,6 +150,11 @@ class  Testprinter(unittest.TestCase):
         self.assertEqual(80, len(actual))
         self.assertEqual(actual, '[0/0] fast/dom/HTMLFormElement/associa...after-index-assertion-fail1.html passed')
 
+        printer._meter.number_of_columns = lambda: 80
+        actual = printer._test_status_line('fast/dom/HTMLFormElement/associated-elements-after-index-assertion-fail1.html', ' passed', truncate=False)
+        self.assertEqual(90, len(actual))
+        self.assertEqual(actual, '[0/0] fast/dom/HTMLFormElement/associated-elements-after-index-assertion-fail1.html passed')
+
         printer._meter.number_of_columns = lambda: 89
         actual = printer._test_status_line('fast/dom/HTMLFormElement/associated-elements-after-index-assertion-fail1.html', ' passed')
         self.assertEqual(89, len(actual))